Lunch-and-Learn

Welcome to Lunch and Learn

This project consumes 4 different api's and exposes information necessary for the front end of the team

Learning Goals

  • Consume APIs that require keys
  • Expose data based on those api's that the "Front End" would hypothetically need
  • Implement VCR to reduce API calls necessary

Tech requirements:

  • Ruby 2.7.4
  • Rails 5.2.8

Set Up

bundle install

Then to establish a database, run:

rails db:create

Because this is the back end repository, database migration is also necessary, run:

rails db:migrate

Next, create a application.yml file with

figaro install

APIs and keys necessary

place these ENV variables in your application.yml (NOTE: this file should have been automatically placed in your.gitignore. double check if it is! don't expose your keys to anyone.)

RSpec Suite

Once lunch-and-learn is correctly installed, run tests locally to ensure the repository works as intended.

To test the entire spec suite, run:

bundle exec rspec spec/

All tests should be passing if installation is successful.

Calling APIs

  • APIs can be called locally using a program like Postman.

Available Endpoints

Create a New User

Note: pass name & email in request body

POST '/api/v1/users'

Create a New Favorite for a User

Note: pass api_key (for whichever user is wanting the favorite), country, recipe_link & recipe_title in request body

POST '/api/v1/favorites'

Get Recipes by Country

Note: the {} is not needed in this endpoint

POST '/api/v1/recipes?country={insert country here}'

Get Recipes for a random country

POST '/api/v1/recipes'

Get Learning Resources by country

Note: the {} is not needed in this endpoint

POST '/api/v1/learning_resources?country={insert country here}'

Get a List of a User's Favorites

Note: the {} is not needed in this endpoint

POST '/api/v1/favorites?api_key={insert user's api_key here}'

Check Me Out!

👤 Anthony Blackwell Tallent

If you got this far then thank you! have a great day!