Library Package requirements:
- sudo apt install python3-pip
- pip3 install flask
- cd ./flaskproject
- export FLASK_APP=app.py
- export FLASK_ENV=development
- flask run
- Output:
1. Homepage: ( / )
The four main components of the homepage are Navigation Bar, Top Picks, Search Bar and the Categories. The Nav bar and top picks column are consistent components of every page for easier navigation and better experience.
1. Navigation Bar: The navigation bar in the top header of the webpage contains 3 links: one that leads to homepage, one to all categories page and lastly one that leads to creating a book page. The navigation bar is a common feature that is available on all pages to make accessibility to main pages easier.
2. Top Picks Column: There is a Top Picks Column on the right hand side of every page that returns a display of the top 9 books based on overall reviews. It is a clickable image that leads directly to the book and its reviews.
3. Search Book Function: The search book function on the main body of the homepage allows a user to search for a book based on its ASIN number. If an invalid ASIN number or no input is entered into the search function, a popup informs the user to enter a valid ASIN number. If the book ASIN number exists, the page redirects the user to the book and its reviews.
4. Top Categories Section: On the homepage main body, there is also a top categories section. This section allows the user to access the top categories of Great Reads. It redirects to the books classified in that category. Since the homepage can only access up to a number of categories, there is a redirect link to all the categories in Great Reads.
2. All Categories Page ( /allcategories)
It is accessible from Categories in the navigation bar.
Figure 2: All Categories Page
Categories:( /categorypage/<categoryname>
)
This page accesses all the available categories in the Great Reads database. Each category link redirects to the specific categories page that showcases all books in that particular category.
Figure 3: (Specific) Categories Page
3. Book Reviews Page:( /book/<asin>
)
This page is accessible by clicking on a book from top picks, a book from the specific category or by searching up the exact ASIN number. It shows all the reviews of a particular book (identified by ASIN number), including the name of reviewer, review content and how many people have found the reviews helpful.
Create a Review Popup:
At the left hand side of the page, there is a create a review button that brings up a popup to create a new review (for that particular book). Certain fields are required and if are not properly filled in, will result in an alert to “fill in the required fields”.
Figure 5: Write a New Review Page
3. Create Book Page: Once Add Book from Navigation bar is clicked, a pop-up for admin password pops up.
Admin Login Pop-up: A normal user of the webpage is not allowed to create a new book. Therefore, we have added an additional function that only allow admins to create new book in the system. The admin password to access the create a book page is: admin.
Figure 6: Admin Login for Creating a New Book
Create a Book Page: This page is only allowed for admins and will only be accessible by those who have the admin password. It contains the form to create a new book that would be inputted into mongoDB.