Coder Social home page Coder Social logo

lunch_and_learn's Introduction

README

Lunch and Learn is a back end app that uses data from multiple API's to expose endpoints that can be utilized to deliver recipes, images, videos and even tourist locations related to a country that a user searches.

Author

System dependencies

  • ruby 3.2.2
  • rails 7.1.1
  • postresql 1.1
  • bcrypt 3.1.7
  • faraday
  • jsonapi-serializer

Configuration

  • fork and clone repo
  • run bundle install to install all dependencies from Gemfile
  • run rails s to run in a local environment to test the application

Database creation

  • rails db:create

How to run the test suite

  • run bundle exec rspec to run the full test suite

API's in use

Endpoints

get "/api/v1/recipes"

  • this endpoint requires a parameter {country}, and searches for recipe results related to the country passed as a parameter. passing a value of 'random' for country will select a random country to pull recipes from

Example:

Screenshot 2023-11-14 at 7 57 23 AM

Response:

Screenshot 2023-11-14 at 7 59 13 AM

get "/api/v1/learning_resources"

  • this endpoint requires the param {country}, and delivers a video as well as images related to the country passed as a parameter.

Example:

Screenshot 2023-11-14 at 8 59 21 AM

Response:

Screenshot 2023-11-14 at 9 00 29 AM

post "/api/v1/users"

  • this endpoint requires params {name, email, password, password_confirmation} passed in the body of the request. It will create a new user so long as email address is not already in use and passwords match. The password is salted and hashed into a password digest to avoid plain text password logging. This will also auto generate an API key for the user.

Example:

Screenshot 2023-11-14 at 9 06 06 AM

Response:

Screenshot 2023-11-14 at 9 07 07 AM

post "/api/v1/sessions"

  • this endpoint requires params {email, password}, and it will check the that the users credentials are valid and match the credentials after hashing the password.

Example:

Screenshot 2023-11-14 at 9 10 19 AM

Reponse:

Screenshot 2023-11-14 at 9 11 08 AM

post "/api/v1/favorites"

  • this endpoint requires params {api_key, country, recipe_link, recipe_title}, and it will save the recipe as a favorite for the user that matches the provided api_key

Example:

Screenshot 2023-11-14 at 9 14 27 AM

Response:

Screenshot 2023-11-14 at 9 15 09 AM

get "/api/v1/favorites"

  • this endpoint requires params {api_key}, and it will return a list of all recipes favorited by the user associated with the api_key

Example:

Screenshot 2023-11-14 at 9 17 30 AM

Response:

Screenshot 2023-11-14 at 9 18 16 AM

lunch_and_learn's People

Contributors

deadbert 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.