Giter Site home page Giter Site logo

lunch_and_learn's Introduction

README

Set up

  • Api Keys

    • REST Countries API - no key needed
    • Edamam Recipe API - no key needed
    • Follow directions at Google Youtube API to set up your developers page and get an api key, this project used Serch:list end points with part = snippet and type = video in the query params of the endpoint
    • Unsplash was used to get images, you will need to set up an account with them as well to get an api key. Follow the directions on their website.
    • Places API was used as well. Follow directions on their website to get an api key
  • Getting started

    • Versions
      • Ruby 2.7.4
      • Rails 5.2.8
    • Clone this repo
    • bundle install
    • bundle exec figaro install
      • put all keys in config/application.yml
        • Rest countries no key needed
        • Edamam keys you will need both the id and key given named recipe_id and recipe_key
        • Google keys will need to be named google_key
        • Unsplash key will need to be named access_key
        • Places key will need to be name places_key
    • rails db:{create,migrate,seed}
    • rails s

Learning Goals

  • Expose an API that aggregates data from multiple external APIs

    • exposed "https://restcountries.com/v3.1/all?fields=name" endpoint
    • exposed "https://api.unsplash.com/search/photos" endpoint
    • exposed "https://youtube.googleapis.com/youtube/v3/search?" endpoint
      • combined all of these endpoints to then build a response for the FE to get a single response from the "http:localhost:3000/api/v1/learning_resources?country=" endpoint
        • response included the country either searched for or a random country if there was not a query
        • a video related to country queried / random
        • 10 images related to the country queried / random
  • Expose an API that requires an authentication token

    • exposed "https://api.unsplash.com/search/photos" endpoint using the access_key
  • Expose an API for CRUD functionality

    • exposed "http:localhost:3000/api/v1/favorites" to be able to delete favorites if needed
  • Determine completion criteria based on the needs of other developers

    • update functionality seems overkill on the favorites as the recipes are either favorited or not, so update was not utilized for an endpoint
  • Test both API consumption and exposure, making use of at least one mocking tool (VCR, Webmock, etc).

    • webmock was used via vcr, stubbing was used in tests that required random countries

Happy path endpoints

  • Example happy paths to get recipes for a country
    • GET /api/v1/recipes?country=thailand
    • GET /api/v1/recipes?country=
      • will return a random country's recipes
    • GET /api/v1/recipes?country=" "
      • will return an empty array
  • Example happy paths to get learning resources for a certain country
    • GET /api/v1/learning_resources?country=laos
    • GET /api/v1/learning_resources?country=
      • will return resources for a random country
    • GET /api/v1/learning_resources?country=" "
      • will return an empty array
  • Examples of CRUD functionality around users and favorite recipes
    • POST /api/v1/users
      • passing {"name": "Athena Dao", "email": "[email protected]", "password": "password", "password_confirmation": "password"} in the body will register a user
    • POST /api/v1/sessions
      • passing {"email": "[email protected]", "password": "password"} in the body will sign an existing user in
    • POST /api/v1/favorites
      • passing {"api_key": <API_KEY_OF_EXISTING_USER>,"country":"thailand","recipe_link": "https://www.tastingtable.com/.....","recipe_title": "Crab Fried Rice (Khaao Pad Bpu)"} will create a new favorite for the user
    • GET /api/v1/favorites
      • passing {"api_key": <API_KEY_OF_EXISTING_USER>} will get a list of all of the favorites of that user.
      • If the user does not have favorites, it will return an empty array

lunch_and_learn's People

Contributors

llamaback avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.