learn-co-students / sinatra-project-denver-web-111819

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sinatra Mini-Project

Time for another mini-project. Using the Yelp API, build a Sinatra web-app that allows you to add users and restaurants to your database and then choose which users want to visit which restaurant.

Functionality

Watch the below clip to see basic functionality of app.

  • A user should be able to add a new user
  • A user should be able to see all other users
  • A user should be able to add a restaurant
  • A user should be able to select a user and add it to a restaurant's list of users

Domain Modeling

  • What's the relationship between a user and a restaurant?
  • What models and controllers will you need?
  • Break up the controllers based on their responsibility

Requests

  • What type of requests will you use to create a new user and restaurant?
  • What about seeing all users/restaurants and seeing individual users/restaurants?
  • In notes.md, write each type of request, the controller it hits, and action that deals with the request

When you've successfully built out an app that allows you to add a restaurant manually, add the Yelp API feature. We've included the Yelp gem. You'll need to login to get unique tokens at https://www.yelp.com/developers/documentation/v3

Using the adapter pattern, allow your users to hit the API and get restaurant objects returned. Once your adapter pattern is working effectively, feel free to tool around with the API.

To use the API, you'll need an api key from Yelp. Follow the instructions provided by Yelp and place your api key in a file named config/api_key.rb as the variable API_KEY. Do not commit this file!

To make requests with the api, follow the instructions provided by the gem project here

About


Languages

Language:Ruby 100.0%