Skip to content

LavanyaChennampalli/Item-Catalogue

Repository files navigation

Item Catalog Web App

By Lavanya Chennampalli 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 movie categories and their movies. OAuth2 provides authentication for further CRUD functionality on the application. Currently OAuth2 is implemented for Google Accounts.

In This Project

This project has one main Python module project.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 lotsofitems.py. The Flask application uses stored HTML templates in the templates folder to build the front-end of the application.

Skills Required

  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. The app imports requests which is not on this vm. Run pip install requests

Or you can simply Install the dependency libraries (Flask, sqlalchemy, requests,psycopg2 and oauth2client) by running pip install -r requirements.txt

  1. Setup application database python /movie-catalogue-application/database_setup.py
  2. *Insert sample data python /movie-catalogue-application/lotsofitems.py
  3. Run application using python /movie-catalogue-application/project.py
  4. Access the application locally using http://localhost:5000

*Optional step(s)

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 'Movie-Catalogue-App'
  7. Authorized JavaScript origins = 'http://localhost:5000'
  8. Authorized redirect URIs = 'http://localhost:5000/login' && 'http://localhost:5000/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 project3 directory that you cloned from here
  14. Run application using python /Movie-catalogue-app/project.py

JSON Endpoints

The following are open to the public:

Movie Catalog JSON: /category/JSON - Displays the whole movie catalog.

Categoryitems JSON: '/category/items/JSON' - Displays the whole category items

Category items JSON: '/category/int:categories_id/items/JSON' - Displays Categoryitems for a specific category

Specific Category items JSON: '/category/int:categories_id/item/int:categoryitem_id/JSON' - Displays a specific category items in a specific category

Miscellaneous

This project is inspiration from Shaik Badulla.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published