Web Programming with Python and JavaScript
This project is a collection of more than 4500 books. Here, you can find books with their detail information like ISBN, year, author, etc. You can see the rating for the book you desired after you logged in here. You can submit review to any book you like and comment it as well.
I have added "Goodreads" API too, from where you can see a book's global desire with its rating number and average rating from readers world wide.
And the project has also API, you can get information from The database and build your own web application.
application.py
the main app file and ORM to setup the databaseimport.py
used to import csv data into a configured databasehelpers.py
Decorate routes to require loginbooks.csv
csv datarequirements.txt
dependencies to installdatabase.sql
create the tables.
Template descriptions:
layout.html
base template with common structure user can search and logoutresults.html
books detailslogin.html
after user /invalid login credentialsregister.html
user can registerindex.html
search results pagebook.html
display the book details, user can review and comment the bookerror.html
error message
username and password.
Log in using username and password.
Logged in users should be able to log out of the site.
Import books.csv into PostgreSQL database.
Once logged in, search for ANY matches on a new page.
Book details and reviews users left on my page.
One review per user: a rating from 1 to 5 and a review text (optional).
Display the average and number of ratings.
GET request to your website’s /api/<\isbn> route. Output a json file. Otherwise, Invalid book ISBN.
$ python3 -m venv myvirtualenv
ref: database.sql file
$ pip3 install -r requirements.txt
$ export FLASK_APP=application.py # flask run $ export DATABASE_URL="Heroku Postgres DB URI" $ export GOODREADS_KEY"="Goodreads API Key" Here
$ python import.py
Screencast presentation: here