This is the fourth Back-end developer Udacity nanodegree project.
The project is a catalog app, with some json end points.
Authentication is provided by Facebook using OAuth
Items are classified by categories.
You can create, edit and delete your own Items when you is logged.
Install VirtualBox and Vagrant:
-
Download Virtualbox Here
-
Download Vagrant Here
-
If you is a back-end developer nanodegree student, you can Download the Vagrant File with the configurations in This Link
If not Download or Clone this repository
-
Launch the Vagrant VM inside Vagrant sub-directory in the downloaded fullstack-nanodegree-vm repository using command:
$ vagrant up -
Then Log into this using command:
$ vagrant ssh -
Change directory to /vagrant and look around with ls.
-
Download the content of this current repository, by either downloading or cloning it from Here
-
If you cloned the content skip next step, jump to Setting up the database.
-
If Download the content manualy from github you need to move the folder to vm vagrant folder.
-
If You want you can check/install the requiriments using the command:
`$ pip install -r requirements.txt
To authentication the app use facebook api with OAUTH. You need to configure it with you app_id and app_secret More infomation about it here
- Configure the app_id and app_secret on file fb_create_secrets.json and on
/templates/login.html,
this is provide ou your developer facebook when you configure the facebook api Here.
You can make your changes on file fb_client_secrets.json.example and save as fb_client_secrest.json
file: fb_create_secrets.json
{
"web": {
"app_id": "YOUR_APP_ID_HERE",
"app_secret": "YOUR_APP_SECRET_HERE"
}
}-
Access the repository folder inside the vagrant folder.
-
run the database_setup.py using command:
$ python database_setup.py
The categorias are created on createCategories.py, we used shoes categories to make this project, but
if you want, you can edit this file and change de categories editing the file!
on Line 21.
# createCategories.py
categories = ("Women's Shoes", "Men's Shoes", "Casual Shoes",
"Dress Shoes", "Boots", "Canvas Shoes")Caution
don't run createCategories.py, if you want to populate with fake item to test app.
-
If you want populate only the categories run the file createCategories.py, if you want populate categories and fake items for test don't run createCategories.py, jump to step 2.
$ python createCategories.py -
If you want create some cateogories and items for test the app, run the file lotofthingdb.py
$ python lotofthingsdb.py
- From the vagrant directory inside the virtual machine, go the repository directory and run the program using:
$ python application.py
- Open your Web Navigator and open the url http://localhost:5000
- Information about routes and data returns on api JSON endpoits are disponible on http://localhost:5000/api/