This is a project for Udacity's Full Stack Web Developer Nanodegree
The task is 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.
- Proper authentication and authorisation check.
- Full CRUD support using SQLAlchemy and Flask.
- JSON endpoints.
- Implements oAuth using Google Sign-in API.
- Project Structure
This project is run in a virutal machine created using Vagrant so there are a few steps to get set up:
- Install Vagrant
- Install VirtualBox
- Download the vagrant setup files from Udacity's Github These files configure the virtual machine and install all the tools needed to run this project.
- Download this project: Item-Catalog
- Upzip as needed and copy all files into the vagrant directory into a folder called Item_Catalog
- Open Terminal and navigate to the project folders we setup above.
- cd into the vagrant directory
- Run
vagrant up
to build the VM for the first time. - Once it is built, run
vagrant ssh
to connect. - cd into the correct project directory:
cd /vagrant/Item_Catalog
- Install or upgrade Flask:
sudo python -m pip install --upgrade flask
- Run the following command to set up the database:
python database_setup.py
- Run the following command to insert dummy values. If you don't run this, the application will not run.
python stock_library.py
- Run this application:
python app.py
- Open http://localhost:5000 in your favourite Web browser.
- Access a list of all the books:
http://localhost:8000/api/v1/genre/JSON
- Access a list of all the genre:
http://localhost:8000/api/v1/books/JSON
- Access a list of all the books in a particular genre:
http://localhost:8000/api/v1/genre/<int:genre_id>/books/JSON
- Access data for an individual book bu book_id and genra_id:
http://localhost:8000/api/v1/genre/<int:genre_id>/book/<int:book_id>/JSON