To Develop an application that provides a list of items within a variety of categories as well as provide a user registration and authentication system. Registered users will have the ability to post, edit and delete their own items.
Modern web applications perform a variety of functions and provide amazing features and utilities to their users; but deep down, it’s really all just creating, reading, updating and deleting data. In this project, you’ll combine your knowledge of building dynamic websites with persistent data storage to create a web application that provides a compelling service to your users.
- Develop a RESTful web application using the Python framework Flask
- Implementing third-party OAuth authentication.
- Implementing CRUD (create, read, update and delete) operations.
This web app is a project for the Udacity FSND Course.
The project is a RESTful web application utilizing the Flask framework which accesses a SQL database that populates Books under some categories. OAuth2 provides authentication for further CRUD functionality on the application. Currently OAuth2 is implemented for Google Accounts.
This project has one main Python module main.py which runs the Flask application. A SQL database is created using the database_setup.py module and you can populate the database with test data including Admin User who created them using lotsofbookstoadd.py.
The Flask application uses stored HTML templates in the templates folder to build the front-end of the application. CSS/JS/Images are stored in the static directory.
- Python
- HTML
- CSS
- OAuth
- Flask Framework
There are some dependencies and a few instructions on how to run the application. Separate instructions are provided to get GConnect working also.
- Install Vagrant & VirtualBox
- Clone Or Download fullstack-nanodegree-vm repository
- Go to Vagrant directory and either clone this repo or download and place zip here
- Launch the Vagrant VM (
vagrant up) - Log into Vagrant VM (
vagrant ssh) - Navigate to
cd/vagrantas instructed in terminal - The main.py imports requests which is not on this vm. Run sudo pip install requests
- Setup application database
python /catalog/database_setup.py - *Insert fake data
python /catalog/lotsofbookstoadd.py - Run application using
python /catalog/main.py - Access the application locally using http://localhost:5000
*Optional step(s)
To get the Google login working there are a few additional steps:
- Go to Google Dev Console
- Sign up or Login if prompted
- Go to Credentials
- Select Create Credentials > OAuth Client ID
- Select Web application
- Enter name 'Book Catalog App'
- Authorized JavaScript origins = 'http://localhost:5000'
- Authorized redirect URIs = 'http://localhost:5000/login' && 'http://localhost:5000/gconnect'
- Select Create
- Copy the Client ID and paste it into the
google-signin-client_idin base.html and app.js file (for Google sign in) - On the Dev Console Select Download JSON
- Rename JSON file to client_secret.json
- Place JSON file in catalog directory that you cloned from fullstack-nanodegree-vm repository
- Run application using
python /catalog/main.py
The following are open to the public:
Book Catalog JSON: /books.json/
- Displays the whole catalog with all books including creator name and email
Book Catalog By Category: /booksByCategories.json/
- Displays all available books under each category
Books for single Category: /books/category/<int:category_id>.json/
- Displays all books under specific category
Book By Category: /books/category/<int:category_id>/<int:bookId>.json/
- Display Book Information using category_id and book id
Categories : /catalog/categories.json/
- Displays Categories



