Hello, World! This is my submission for CS50W's Project 1: Books.
This website is for reviewing books. The application allows users to register / login / logout, search for books, leave a review for individual books, and see reviews made by other people. The application also allows users to see book information and reviews made by other people using the Goodreads API. Finally, book details and reviews can be queried programmatically via a custom API.
A short video demonstrating the website can be found here.
- Set
api_key
environment variable to your Goodreads API key. - Set
secret_key
environment variable to your Flask secret key. - Set
DATABASE_URL
environment variable to the address of your Heroku database. - When in the same directory as
application.py
, executeflask run
to launch the application.
- All files stored within the
project1
directory. - CSS and image files stored within the
static
directory. - HTML files stored within the
templates
directory. - Website Flask / Python code stored within
application.py
. books_tables
: SQL code for three database tables.books.csv
: CSV file of 5000 booksimport.py:
Python code to upload CSV file contents to a database table.
To view a book's details in JSON format, navigate to .../api/ISBN_NUMBER
. JSON returns data in the following format:
{
"title": "Memory",
"author": "Doug Lloyd",
"year": 2015,
"isbn": "1632168146",
"review_count": 28,
"average_score": 5.0
}