Board with your recipe book? Want to step out of your comfort zone and taste something new? This is for you.
Lunch and Learn is an app that will let you find your new favorite recipe by country of origin. After you are done cooking Lunch and Learn will look up some edutainment to watch while you enjoy your new dish.
Sign up and get started!
This is a Ruby on Rails web application that was made for the chrome browser and for use with Google OAuth. You will need the following:
To get started, follow the link below and register with your Google account. Once you are registered you will be able to:
This application was made with the following:[^1]
To install and run on your personal computer you will need to do the following:
Get a free API Key for EDAMAM Recipe at https://developer.edamam.com/edamam-recipe-api.
Get a free API Key for YouTube at https://developers.google.com/youtube/v3/getting-started.
Get a free API Key for Pexels at https://www.pexels.com/api/.
Fork and clone the repo to your local machine.
Install gems and create database.
$ bundle install
$ rails db:{drop,create,migrate}
$ bundle exec figaro install
ActiveRecord::Schema.define(version: 2023_01_15_233149) do
enable_extension "plpgsql"
create_table "favorites", force: :cascade do |t|
t.string "country"
t.string "recipe_link"
t.string "recipe_title"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "users", force: :cascade do |t|
t.string "name"
t.string "email"
t.string "api_key"
t.string "password_digest"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "users_favorites", force: :cascade do |t|
t.bigint "user_id"
t.bigint "favorite_id"
t.index ["favorite_id"], name: "index_users_favorites_...
t.index ["user_id"], name: "index_users_favorites_on_us...
end
add_foreign_key "users_favorites", "favorites"
add_foreign_key "users_favorites", "users"
end
Enter your API in the config/application.yml
file.
edam_app_id: <YOUR APP ID HERE>
edam_app_key: <YOUR KEY HERE>
yt_key: <YOUR KEY HERE>
pexels_token: <YOUR TOKEN HERE>
Start your rails server in the root directory.
$ rails s
Now all you need to do is make a request to one of the endpoints.[^2] Documentation for all API Endpoints can be found below. OR if you prefer to run the simple front-end for this API service, follow this_link.
Get a list of recipes from a random country (if no params are passed) OR by selected country, through params.
Parameters
Name Required Type Description country
no string The country you want to get recipes from.
Response
{ "data": [ { "id": null, "type": "recipe", "attributes": { "title": "Andy Ricker's Naam Cheuam Naam Taan Piip (Palm Sugar Simple Syrup)", "url": "https://www.seriouseats.com/recipes/2013/11/andy-rickers-naam-cheuam-naam-taan-piip-palm-sugar-simple-syrup.html", "country": "Thailand", "image": "https://edamam-product-images.s3.amazonaws.com..." } }, { "id": null, "type": "recipe", "attributes": { "title": "Sriracha", "url": "http://www.jamieoliver.com/recipes/vegetables-recipes/sriracha/", "country": "Thailand", "image": "https://edamam-product-images.s3.amazonaws.com/." } }, {...}, {...}, {...}, {etc}, ] }
Get a list of learning resources from a random country (if no params are passed) OR by selected country, through params.
Parameters
Name Required Type Description country
no string The country you want to get learning resources from.
Response
{ "data": { "id": null, "type": "learning_resource", "attributes": { "country": "Laos", "video": { "title": "A Super Quick History of Laos", "youtube_video_id": "uw8hjVqxMXw" }, "images": [ { "alt_tag": "standing statue and temples landmark during daytime", "url": "https://images.unsplash.com/photo-1528181304800-259b08848526?ixid=MnwzNzg2NzV8MHwxfHNlYXJjaHwxfHx0aGFpbGFuZHxlbnwwfHx8fDE2Njc4Njk1NTA&ixlib=rb-4.0.3" }, { "alt_tag": "five brown wooden boats", "url": "https://images.unsplash.com/photo-1552465011-b4e21bf6e79a?ixid=MnwzNzg2NzV8MHwxfHNlYXJjaHwyfHx0aGFpbGFuZHxlbnwwfHx8fDE2Njc4Njk1NTA&ixlib=rb-4.0.3" }, { "alt_tag": "orange temples during daytime", "url": "https://images.unsplash.com/photo-1563492065599-3520f775eeed?ixid=MnwzNzg2NzV8MHwxfHNlYXJjaHwzfHx0aGFpbGFuZHxlbnwwfHx8fDE2Njc4Njk1NTA&ixlib=rb-4.0.3" }, {...}, {...}, {...}, {etc}, ] } } }
Get a list of your user's favorite recipes.
Parameters
Name Required Type Description api_key
yes string A unique key created after a successful POST /api/v1/users used to identify user requests
Response
{ "data": [ { "id": "1", "type": "favorite", "attributes": { "recipe_title": "Recipe: Egyptian Tomato Soup", "recipe_link": "http://www.thekitchn.com/recipe-egyptian-tomato-soup-weeknight....", "country": "Egypt", "created_at": "2022-11-02T02:17:54.111Z" } }, { "id": "2", "type": "favorite", "attributes": { "recipe_title": "Crab Fried Rice (Khaao Pad Bpu)", "recipe_link": "https://www.tastingtable.com/.....", "country": "Thailand", "created_at": "2022-11-07T03:44:08.917Z" } } ] }
Create a new user.
Parameters (JSON payload in request body)
{ "name": "Athena Dao", "email": "[email protected]", "password": "supersecretpassword", "password_confirmation": "supersecretpassword" }
Response
{ "data": { "type": "user", "id": "1", "attributes": { "name": "Athena Dao", "email": "[email protected]", "api_key": "jgn983hy48thw9begh98h4539h4" } } }
Get user info for authentication use on front-end app.
Parameters (JSON payload in request body)
{ "email": "[email protected]", "password": "supersecretpassword" }
Response
{ "data": { "type": "user", "id": "1", "attributes": { "name": "Athena Dao", "email": "[email protected]", "api_key": "jgn983hy48thw9begh98h4539h4" } } }
Create a new favorite recipe for the select user.
Parameters (JSON payload in request body)
{ "api_key": "jgn983hy48thw9begh98h4539h4", "country": "Thailand", "recipe_link": "https://www.tastingtable.com/.....", "recipe_title": "Crab Fried Rice (Khaao Pad Bpu)" }
Response
{ "success": "Favorite added successfully" }
Delete a selected favorite recipe for the select user.
Parameters (JSON payload in request body)
{ "api_key": "jgn983hy48thw9begh98h4539h4", "country": "Thailand", "recipe_link": "https://www.tastingtable.com/.....", "recipe_title": "Crab Fried Rice (Khaao Pad Bpu)" }
Response
{ "success": "Favorite removed successfully" }
[^1]: Note: Information on installing Ruby 2.7.4 and Rails 5.2.8 can be found here
[^2]: Note: The port is crrrently set to 5001. To change the port #, go to config/puma.rb
and enter your desired port #: port ENV.fetch("PORT") { <YOUR NUMBER HERE> }
. You can also elect to un-comment the Background Workers Job CleanDbJob (favorites_controller: line 40). Before you do this, you will need to set up a Redis server and Sidekiq adapter. Instructions to this can be found here. Troubleshooting Redis and Mac M1 issues can be found here.
[^3]: Note: The :country
section in the JSON Response refers to the search criteria. If no video is found on that country, a video on a related country (by culture or geographic area) will instead be returned.
Back-end Main Goal(s)
/recipes
Endpoint/learning_resources
Endpoint/users
Endpoint/sessions
Endpoint/favorites
Endpoint/favorites
Endpoint/favorites
EndpointBack-end Stretch Goals
Front and Back-end Super Stretch Goals
See the open issues for a full list of proposed features (and known issues).
Technical Presentation
Feature Delivery
Technical Quality
Testing
Lunch and Learn is a Ruby on Rails web application hosted on Heroku.
Do you have a better & cooler way of doing what we did? Your contribution would be greatly appreciated.
Please fork the repo, create your branch, and create a pull request. You can also simply open an issue with the tag "enhancement".
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Thanks again!
Distributed under the MIT License.