This project consumes 4 different api's and exposes information necessary for the front end of the team
- 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
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
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.)
- Countries API No key is needed
- Edamam API Need to name Edamam id as EDAMAM_APP_ID and api_key as EDAMAM_API_KEY
- Youtube API name Youtube's api_key as YOUTUBE_API_KEY
- Upsplash API name Upsplash's key as UNSPLASH_ACCESS_KEY
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.
- APIs can be called locally using a program like Postman.
Note: pass name
& email
in request body
POST '/api/v1/users'
Note: pass api_key
(for whichever user is wanting the favorite), country
, recipe_link
& recipe_title
in request body
POST '/api/v1/favorites'
Note: the {} is not needed in this endpoint
POST '/api/v1/recipes?country={insert country here}'
POST '/api/v1/recipes'
Note: the {} is not needed in this endpoint
POST '/api/v1/learning_resources?country={insert country here}'
Note: the {} is not needed in this endpoint
POST '/api/v1/favorites?api_key={insert user's api_key here}'
👤 Anthony Blackwell Tallent