Udacity - item catalog app
This app is meant to collect italian recipes. Each recipe belongs to one of the 20 italian regions. Considering this app as a catalog, recipes correspond to items and regions correspond to categories. A 3rd party authentication system (Google and Facebook) is implemented to let users add, update and delete recipes. Also, this app implements API endpoints, where the response format can be either JSON or XML. This app is based upon the Flask Python framework for the back end, and it leverages the Backbone JS framework for the front end. The UX should be fine on any device.
For an initial set up please follow these 2 steps:
-
Download or clone the fullstack-nanodegree-vm repository.
-
Find the catalog folder and replace it with the content of this current repository, by either downloading it or cloning it - Github Link.
Launch the Vagrant VM from inside the vagrant folder with:
vagrant up
vagrant ssh
Then move inside the catalog folder:
cd /vagrant/catalog
Then lift the application:
python app.py
After the last command you are able to browse the application at this URL:
http://localhost:8000/
It is important you use localhost instead of 0.0.0.0 inside the URL address. That will prevent OAuth from failing.
Standard response format is JSON. By adding the ?xml=true query parameter you will get the same data you requested, receiving it in an XML format.
Endpoints:
Request | What you get |
---|---|
/recipes | Get all recipes |
/recipes?region_id=REGION ID | Get all recipes that belongs to the given region |
/recipes?user_id=USER ID | Get all recipes that belongs to the given user. Can't be used together with region_id |
/recipes/RECIPE ID | Get single recipe |
/regions | Get all the regions |
/regions?catalog=true | Get all the regions with the recipes belonging to each region. It basically return the whole catalog. |
/regions?count=true | Get all the regions with the recipe counter for each region. Can't be used together with catalog |
/regions/REGION ID | Get single region |
/regions/REGION ID?catalog=true | Get the given region and all its recipes. |
/users | Get all registered users |
/users/USER ID | Get single user |