This Flask application provides a means to cataloging recipes, grouped by cuisine. It integrates third party user registration and authentication, provided by Google. Authenticated users have the ability to post, edit, and delete their own items.
- If using Vagrant:
- Install Vagrant and VirtualBox.
- Launch the Vagrant VM. A Vagrantfile and accompanying shell script are provided to setup all necessary software.
- If not using Vagrant, you can just run the provided
pg_config.sh
script to setup all necessary software.
- Optional: Run the
db_init_test_data.py
script to populate the database with some test data
- Obtain OAuth 2.0 client credentials from the Google Developers Console. Details here.
- Download the
client_secrets.json
file from the Google Developer Console and store it undercatalogapp/instance/
- Run
run.py
to start the local Flask development server. By default, the application is available on port 5000.
To make any changes (adding and removing recipes) you must first login. The application automatically creates your local user profile upon authorizing with Google the first time.
To sign-in, click on the link on the top-right corner of the page.
After you sign-in, two new buttons appear on the navigation bar: Add Recipe and Add Cuisine. At least one cuisine type must be added before adding a recipe.
To access the recipe data in JSON format, use the following URLs:
-
/recipe/JSON
- Returns all recipies in the catalog.
-
/recipe/<recipe_id>/JSON
- Returns the recipe with ID <recipe_id>.
-
/cuisine/JSON
- Returns all the cuisine types known to the catalog.
-
/cuisine/<cuisine_id>/JSON
- Returns all the recipes of corresponding to the cuisine with ID <cuisine_id>.
The RSS feed only lists the 15 recipes most recently added to the catalog.
- /recipe/recent.atom