Coder Social home page Coder Social logo

catalog-project's Introduction

FSND Project (2) - Catalog

By Sameer Almutairi

Project overview

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.

How to Run the program

1. Software Installation

Once you get the above software installed, follow the following instructions :

  • Extract the FSND file (downloaded inside Downloads Folder):
YourMachineName:~ $ cd Downloads
YourMachineName:Downloads$ unzip -a fullstack-nanodegree-vm-master.zip
  • Then run the following instructions to lunch vagrant:
YourMachineName:Downloads$ cd fullstack-nanodegree-vm-master
YourMachineName:fullstack-nanodegree-vm-master$ cd vagrant
YourMachineName:vagrant$ vagrant up
YourMachineName:vagrant$ vagrant ssh

2. Downloading and Running The Project

  • Prerequisites
    • Python
    • HTML
    • CSS
    • Flask FrameWork use: pip install flask
    • SQLAlchemy use: pip3 install SQLAlchemy
    • oauth2client use: pip3 install oauth2client
  • Inside the vagrant create “catalog-project“ folder:
    vagrant@vagrant:~$ cd /vagrant
    vagrant@vagrant:/vagrant$ mkdir catalog-project
    vagrant@vagrant:/vagrant$ cd catalog-project
    vagrant@vagrant:/vagrant/catalog-project$ 
  • Download or clone this project inside “catalog-project“ folder using: console vagrant@vagrant:/vagrant/catalog-project$ git clone https://github.com/SameerAlmutairi/Catalog-Project.git

    need to install git in your machine to run the previous command

  • Setup application database using this command:
    vagrant@vagrant:/vagrant/catalog-project$ python catalog_DB.py
  • Insert default database data using this command: console vagrant@vagrant:/vagrant/catalog-project$ python catalog_DB_Data.py
  • Run the app using this command: console vagrant@vagrant:/vagrant/catalog-project$ python app.py
  • You can access the app locally using: https://localhost:5000
  • To login using google: https://localhost:5000/login

3. Using Google Login

  1. go to Google Dev Console
  2. Sign up or Login
  3. Go to Credentials
  4. Select Create Crendentials > OAuth Client ID
  5. Select Web application
  6. Enter name 'Item-Catalog' or any name
  7. Authorized JavaScript origins = 'http://localhost:5000'
  8. Authorized redirect URIs = 'http://localhost:5000/gconnect'
  9. Select Create
  10. Copy the Client ID and paste it into the data-clientid in header.html
  11. On the Dev Console Select Download JSON
  12. Rename JSON file to client_secrets.json
  13. Place JSON file in catalog directory
  14. Run application
  15. To login using google: https://localhost:5000/login

3. JSON Endpoints

  • Catalog JSON: /catalog/JSON - Displays the whole catalog with all Categories and all items.
  • Categories JSON: /catalog/int:catalog_id/int:item_id/JSON - Displays specific item and its photos

catalog-project's People

Contributors

sameeralmutairi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.