ENGO 551 - Adv. Topics on Geospatial Technologies
This website is an assignment for the second lab of (Adv. Topics on Geospatial Technologies). On this website, I created login and registration pages to make an account in this website. Then after logging in, you will get the book search page where you search for any book by its ISBN, title, or author name. If you click on any book name that appeared after searching, you will get all information about this book, included other users' reviews and Book API reviews and you add your review, also. Moreover, you get JSON data for the book by typing its ISBN.
- Any platform you like such as Windows, Linux, and so on.
- use any browsers (Firefox, Google Chrome,...) to display the html pages.
- python 3.6 or higher
- Flask
- Flask-Session
- psycopg2-binary
- SQLAlchemy
You can find all of these libraries in the
requirements.txt
and install all of them by running this commandpip3 install -r requirements.txt
in the terminal window.
- HTML 5
- CSS
- python flask
- After installing all libraries required in your evironment, run
application.py
in any IDE you like. - Then open any browser and type
http://127.0.0.1:5000/
in link box to go the login page.
- If you don't have an account, click on
Don't have acount?
link to go to the registration page where you can write your (first name, last name, username, and password), then click on submit.
-
Go back again to the login page and write your username and password and click on login.
-
You will find the book search page. In this page, you search for any book you like by its ISBN, title, or author name.
- Click on any book you like to get all information about this book as you can see in the image below.
-
Also, you can submit your review for this book by rating and adding comment for it.
-
Additionally, you can get json data for any book you like by typing this link
http://127.0.0.1:5000/api/<isbn>
in the browser, where<isbn>
is the ISBN of the book required. Then, you will get json data as you see below.
books.csv
: all books information, included ISBN, title name, author name, and publication year.import.py
: is utilized for creating a table for book in postgres database and inserting all book values from thebooks.csv
. Also, create a table for users and another one for reviews. The attributes of the users table are (id,firstName, lastName, username, password), but the attributes of the reviews table are (id, rate, commment, book_id, and user_id)application.py
: is responsible for python flask coding and database transactions, namely backend.templates/login_registration_layout.html
: this is a layout for the login and registration pages.login_page.html
andregistration.html
files inherit structure from it.templates/login_page.html
: this HTML file is specified for the login page.templates/registration.html
: contains structure of the registration page.templates/book_search_page.html
: has the structure of the book search page.templates/book_details.html
: The structure of all information about the book, reviews, and adding reviews exists in this file.templates/messages_layout.html
: contains the layout of the messages either a successful submit message or an error message.success_submit.html
anderror.html
inherit structure of the messages from it.templates/success_submit.html
: has the strcuture of any successful submit.templates/error.html
: is specified for any type of the error message.static/styles/login_registration_page.css
: this is a specified style sheet file forlogin_page.html
andregistration.html
files.static/styles/book_search_page.css
: it is a style sheet for thebook_search_page.html
.static/styles/book_details.css
: similarily, it is a style sheet for thebook_details.html
.
- You can find the demo video for this program at this Link