Item Catalog web application that uses the full stack development skills. Project would cover Python code to perform backend CRUD operations with the ProgreSQL database and using Google Authentication for user login. Front end coding involves understanding the use of Bootstrap stylesheet and user web interface.
- sqlalchemy
- ProgreSQL
- google_auto_oauthlib
- Sign in at
https://console.developers.google.com/apis/
- Create a new Web application
- Go to Credential under
APIs & Services
- Add the following to the field
Authorized JavaScript origins
http://localhost:8000
- Add the following the field
Authorized redirect URIs
http://localhost:8000/login
http://localhost:8000/catalog
http://localhost:8000/oauth2callback
- Step 1: Installing the Virtual Machine Instruction tools called Vagrant and VirtualBox to manage the VM needed to run this project python code against the database for log analysis.
- Step 2: Install VirtualBox. VirtualBox is the software that actually runs the virtual machine. Install the platform package for your operatuing system. Vagrant will use VirtualBox to launch VM.
- Step 3: Install Vagrant. Vagrant is the software that configures the VM and lets you share files between host computer and VM filesystem via folder '/vagrant/'
- Step 4: Download the VM configuration for Vagrant. This will contain the directory
vagrant
which contains theVagrantFile
. Alternatively, it is possible to use Github to fork or clone the repository https://github.com/udacity/fullstatck-nanodegree-vm - Step 5: Start the Virtual Machine, change directory using
cd
into the/vagrant
directory and use the commandvagrant up
, then log into it withvagrant ssh
- Step 6: In order to use the Google Authentication API, run command:
sudo pip install google_auth_oauthlib
- Step 7: In the Vagrant ssh enter the following: Create the database using ProgreSQL
psql -c "CREATE DATABASE catalogdb"
- Step 8: Setup the database tables for the operations with command below:
python init_database.py
- Step 9: Run the project by running 'app.py'
python app.py
- Possible API are the followings:
http://localhost:8000/catalog/JSON
http://localhost:8000/catalog/categories/JSON
http://localhost:8000/catalog/PUT_CATEGORY_NAME_HERE/items/JSON
http://localhost:8000/catalog/PUT_CATEGORY_NAME_HERE/PUT_ITEM_NAME/JSON
- Run command to drop the table from ProgreSQL
psql -c "DROP DATABASE catalogdb"