nicole-esquer / lunch_and_learn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lunch and Learn

Lunch and Learn is an app that allow users to search for recipes by country, favorite recipes, and the ability to learn more about a particular country.

Table of Contents

Table of Contents
  1. Technical Requirements
  2. Gems and Tools
  3. Installation
  4. Schema
  5. Server API Endpoint

Technical Requirements

  • Ruby 2.7.4
  • Rails 5.2.8

Gems and Tools

Installation

To get started, clone the repo in your terminal by entering the following:

  • git clone git@github.com:nicole-esquer/lunch_and_learn.git

Once cloned, run the following commands:

  • bundle install
  • rails db:create
  • rails db:migrate
  • Run the Figaro command: bundle exec figaro install

  • Sign up for the following API keys and update the application.yml file with ENV variables to store the API keys:

  • Sign up for the YouTube API key here. Enter it to the file like so: youtube_api_key: '< your api key >'.

  • Sign up for the Unsplash Image API key here. Enter it to the file like so: unsplash_access_key: '< your api key >' and edamam_api_key: '< your api key >'.

  • Sign up for the Edamam Recipe API key here. Enter it to the file like so: edamam_application_id: '< your api key >' and edamam_application_id: '< your api key >'.

Schema

Screenshot 2022-11-16 at 4 27 21 AM

Endpoints

Get Recipes For A Particular Country


GET /api/v1/recipes?country=thailand
    {
    "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/."
            }
    ]
}

Get Learning Resources for a Particular Country


GET /api/v1/learning_resources?country=laos
{
"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"
            }
          ]
    }
}

}

User Registration


POST /api/v1/users
{
  "data": {
    "type": "user",
    "id": "1",
  "attributes": {
    "name": "Athena Dao",
    "email": "athenadao@bestgirlever.com",
    "api_key": "jgn983hy48thw9begh98h4539h4"
  }
}

}

Add Favorites


POST /api/v1/favorites
{
"success": "Favorite added successfully"
}

Get a User’s Favorites


GET /api/v1/favorites

{ "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" } }

About


Languages

Language:HTML 69.4%Language:Ruby 30.6%