Code Monkey home page Code Monkey logo

lunch_and_learn's Introduction

Lunch and Learn

There is currently no live deployment of this application.

About

Lunch and Learn is a pure backend RoR API designed to provide information about cuisines and popular tourist sites for a particular country. This API is to be paired with a frontend application where a user can create an account, log in to their account, search for recipes, favorite recipes, as well as find videos and photos for a country.

Setup

[Fork and clone this repository]
cd lunch_and_learn

bundle install
rails db:{drop,create,migrate,seed}
rails s

[Open Postman]
[Test end points below with localhost:3000]

Ex. GET http://localhost:3000/api/v1/recipes?country=germany

Versions

  • Ruby 3.2.2
  • Rails 7.1.2

Utilized APIs

  • Edamam's Recipe Search API
  • Google's YouTube Video Search API
  • Rest Countries' All Countries API
  • Unsplash's Image Search API
  • Geoapify's Places API and Geocoding API

Exposed End Points

End Point 1 - Get Recipes For A Particular Country

GET /api/v1/recipes?country=[query]

End Point 2 - Get Learning Resources for a Particular Country

GET /api/v1/learning_resources?country=[query]

End Point 3 - User Registration

POST /api/v1/users
Content-Type: application/json
Accept: application/json

{
  "name": "Odell",
  "email": "[email protected]",
  "password": "treats4lyf",
  "password_confirmation": "treats4lyf"
}

End Point 4 - Log In User

POST /api/v1/sessions
Content-Type: application/json
Accept: application/json

{
  "email": "[email protected]",
  "password": "treats4lyf"
}

End Point 5 - Add Favorites

POST /api/v1/favorites
Content-Type: application/json
Accept: application/json

{
    "api_key": "jgn983hy48thw9begh98h4539h4",
    "country": "thailand",
    "recipe_link": "https://www.tastingtable.com/.....",
    "recipe_title": "Crab Fried Rice (Khaao Pad Bpu)"
}

End Point 6 - Get a User’s Favorites

GET /api/v1/favorites?api_key=[valid api key]
Content-Type: application/json
Accept: application/json

End Point 7 (Bonus) - Get Tourist Sites For A Particular Country

GET /api/v1/tourist_sites?country=[query]
Content-Type: application/json
Accept: application/json

Progress

7 / 7 Tickets Completed

  • Initial Setup
  • End Point 1 - Get Recipes For A Particular Country
  • End Point 2 - Get Learning Resources for a Particular Country
  • End Point 3 - User Registration
  • End Point 4 - Log In User
  • End Point 5 - Add Favorites
  • End Point 6 - Get a User’s Favorites

Goals

Overall Goal

  • A user should be able search for cuisines by country and should also be able to learn more about that country's culture.

The user should be able to:

  • Search for recipes by country
  • Mark specific recipes as 'favorite'
  • Learn more about a particular country

Learning Goals

  • Expose an API that aggregates data from multiple external APIs
  • Expose an API that requires an authentication token
  • Implement basic authentication
  • Expose an API for CRUD functionality
  • Determine completion criteria based on the needs of other developers
  • Test both API consumption and exposure, and use one mocking tool (VCR, Webmock)

Technical Presentation

  • Student presents their code and is able to talk about all of the presentation points below.

Presentation Points

  • Demonstration of understanding for project’s learning goals
  • Demonstration of functional completeness using Postman and live demo
  • Discussion of technical quality & code organization
  • Discussion of test coverage (happy and sad path and edge case testing)

Feature Delivery

  • API satisfies the exact needs of the frontend developers. No unnecessary information is sent in a response.

Technical Quality

  • Project demonstrates abstraction and encapsulation in ways that make it easy to change (example: if an API changes, for example, FLickr to Unsplashed, we make changes in as few places as possible.).
  • Project shows a solid understanding of MVC principles (this may include but is not limited to: no logic in serializers, clean controllers, serializers and presenters to handle formatting rather than models etc.) and includes all expectations of numbers 1 and 2 above.

Testing

  • Project achieves 90% or greater test coverage.
  • In addition to “happy path”, project also includes “sad path”/edge case testing.
  • At least one of the tests that require an external API call make use of VCR and/or Webmock for mocking.
  • Tests check payload content a little deeper such as inspecting data type of an attribute.
  • Testing also checks that unnecessary information is NOT present in response data.

Tests

  • 66 Total Tests (901 / 901 LOC (100.0%) covered)

  • 18 Request Tests (503 / 503 LOC (100.0%) covered)

  • 13 Facade Tests (229 / 229 LOC (100.0%) covered)

  • 21 Service Tests (238 / 238 LOC (100.0%) covered)

  • 3 PORO Tests (87 / 87 LOC (100.0%) covered)

  • 11 Model Tests (70 / 70 LOC (100.0%) covered)

Resources

No resources used for this project.

Contributors

lunch_and_learn's People

Contributors

grantdavis303 avatar

Watchers

 avatar

lunch_and_learn's Issues

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.