Udacity Full Stack Web Developer Nanodegree
You will 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.
- Vagrant
- VirtualBox
- Python3
- Flask
- Flask-WTF
- httplib2
- oauth2client
- requests
- SQLAlchemy
- Unix-style terminal
- Install Vagrant, VirtualBox, and Python3
- If you are using a Mac or Linux system, your regular terminal program will do just fine. On Windows, it is recommend to use the Git Bash terminal that comes with the Git software.
- Clone or download the Vagrant VM configuration file
- Clone Or download this repository. Then, Paste the files from this project into the vagrant/Item Catalog directory
This projects uses Third Party OAuth 2.0 authentication (Google and Facebook). The following steps explain how to set up a client ID and secret in Google and Facebook.
- First, login to your Google account. Then visit Google Developers Console.
- Choose credentials from the menu on the left.
- Click on the Create credentials drop down menu and choose OAuth client id.
- When presented with list of application types, choose web application.
- Next, type a name for the app and set the following:
- The authorized JavaScript origins: http://localhost:5000
- And the authorized redirect URIs: http://localhost:5000/gconnect
- After clicking Create, You should now be able to get the client ID and client secret.
- Download the OAuth 2.0 client ID and save it as "client_secrets.json" to the root project folder.
- First, login to your Facebook account. Then visit Facebook Developers page.
- Next, create a new application. And choose a name for the app and type a contact email.
- Click Add Platform at the bottom of the basic settings, select website.
- Configure the URL site as:
http://localhost:5000/
. - Click the plus icon in the left menu to add a new product.
- Choose Facebook Login.
- Finally, save the app ID and secret in a file called "fb_client_secret.json" to the root project folder. Use the following format in the file:
{ "web" : { "app_id": "YOUR_APP_ID", "app_secret" : "YOUR_APP_SECRET" } }
Run the command pip3 install –r requirements.txt
to install all the required packages.
- Open terminal and navigate to the FSND-Virtual-Machine directory, then run the command:
cd vagrant
. - Inside the vagrant subdirectory, run the command
vagrant up
. This will cause Vagrant to download the Linux operating system and install it. - Next, log into the virtual machine:
vagrant up
vagrant ssh
- Inside the VM, change directory to /vagrant/Item Catalog:
cd /vagrant/'Item Catalog'
- Run the command
python3 database_setup.py
to create the database. - Run the command
python3 lotsofitemswithusers.py
to populate the database with initial values. - Next, run the command
python3 project.py
to run the application. - Finally, access the application by visiting http://localhost:5000. Note: If you are using Windows you might need to change the line ending of the project.py and database_setup.py from CRLF to LF.
- JSON endpoint API route for all cuisines
/cuisines/JSON
- JSON endpoint API route for all recipes of a cuisine
/cuisine/cuisine_id/recipes/JSON
- JSON endpoint API route for a recipe
/cuisine/cuisine_id/recipe/recipe_id/JSON