Skip to content

torston/item-catalog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Item Catalog Web App

This web app is a project for the Udacity FSND Course.

About

This project is a RESTful web application utilizing the Flask framework which accesses a SQL database that populates categories and their items. OAuth2 provides authentication for further CRUD functionality on the application. Currently OAuth2 is implemented for Google Accounts.

In This Repo

This project has one main Python module app.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 using database_init.py. The Flask application uses stored HTML templates in the tempaltes folder to build the front-end of the application. CSS/JS/Images are stored in the static directory.

Skills Honed

  1. Python
  2. HTML
  3. CSS
  4. OAuth
  5. Flask Framework

Installation

There are some dependancies and a few instructions on how to run the application. Seperate instructions are provided to get GConnect working also.

Dependencies

How to Install

  1. Install Vagrant & VirtualBox
  2. Clone the Udacity Vagrantfile
  3. Go to Vagrant directory and either clone this repo or download and place zip here
  4. Launch the Vagrant VM (vagrant up)
  5. Log into Vagrant VM (vagrant ssh)
  6. Navigate to cd/vagrant as instructed in terminal
  7. Intall python 3.6 on VM (instruction)
  8. sudo pip3 install flask
  9. sudo pip3 install sqlalchemy
  10. sudo pip3 install flask-bootstrap
  11. sudo pip3 install httplib2
  12. sudo pip3 install oauth2client
  13. Setup application database python3 /catalog/database_setup.py
  14. Insert sample data python3 /catalog/database_fill.py
  15. Run application using python3 /catalog/application.py
  16. Access the application locally using http://localhost:8000

Using Google Login

To get the Google login working there are a few additional steps:

  1. Go to Google Dev Console
  2. Sign up or Login if prompted
  3. Go to Credentials
  4. Select Create Crendentials > OAuth Client ID
  5. Select Web application
  6. Enter name 'Item-Catalog'
  7. Authorized JavaScript origins = 'http://localhost:8000'
  8. Authorized redirect URIs = 'http://localhost:8000/login' && 'http://localhost:8000/gconnect'
  9. Select Create
  10. Copy the Client ID and paste it into the data-clientid in login.html
  11. On the Dev Console Select Download JSON
  12. Rename JSON file to client_secrets.json
  13. Place JSON file in item-catalog directory that you cloned from here
  14. Run application using python3 /catalog/application.py

JSON Endpoints

The following are open to the public:

Catalog JSON: /catalog/JSON - Displays the whole catalog. Categories and all items.

Categories JSON: /catalog/categories/JSON - Displays all categories

Category Items JSON: /catalog/<path:category_name>/items/JSON - Displays items for a specific category

Category Item JSON: /catalog/<path:category_name>/<path:item_name>/JSON - Displays a specific category item.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published