This is a Rails project designed for students to gain experience building websites that make use of 3rd-party *web services- through web APIs.
The major requirement for this project is to integrate the Yelp Search API and the Spotify API into a single application that suggests pairings of food and music.
- Unit tests for:
- Models
- API Wrappers
- Test code coverage (using SimpleCov)
- 95% for all tested classes
- Sign up / sign in with a Spotify account
- View the top favorited food+music pairing suggestions
- Click on links for specific items to visit the appropriate page on Yelp or Spotify
- See a relevant image for the venue or music
- Search for food+music pairing suggestions
- Favorite individual food+music pairing suggestions
- Do everything a guest user can do except for sign up / sign in
- Sign out
- See my Spotify account name and image on each page
- Click on either to visit my Spotify user profile
- Search for food+music pairing suggestions
- Favorite individual food+music pairing suggestions
- View my favorited food+music pairing suggestions
- Unfavorite suggestions
- Favorite food+music pairing suggestions for other users
- Unfavorite food+music pairing suggestions for other users
-
User
: A signed-in user account, created viaOmniAuth
and connected to a Spotify account.- Validations:
provider
must be a string, must be present, and must equalspotify
uid
must be a string, and must be presentname
, if present, must be a string
- Validations:
-
Food
: A plain Ruby object that receives and models data retrieved from the Yelp Search API. Wraps interactions with the Yelp Search API by leveraging the Yelp-Ruby gem. -
Music
: A plain Ruby object that receives and models data retrieved from the Spotify API. Wraps interactions with the Spotify API by leveraging the RSpotify gem. NOTE: Data retrieved from Spotify may describe an artist, album, track, or playlist.
TunesTakeoutWrapper
: Wraps interactions with the Tunes & Takeout API by leveraging the HTTParty gem. Should reside inlib/
.
- Actions
new
: shows a view with OAuth sign-in linkcreate
: accepts OAuth information from Spotify, finds or creates a User account, and setsuser_id
in sessiondestroy
: deletesuser_id
from session
- Actions
index
: shows top 20 suggestions, ranked by total number of favoritesfavorites
: shows all suggestions favorited by the signed-in Userfavorite
: adds a suggestion into the favorite list for the signed-in User. This requires interaction with the Tunes & Takeout API.unfavorite
: removes a suggestion from the favorite list for the signed-in User. This requires interaction with the Tunes & Takeout API.
- On all pages, if not signed in:
- Displays Guest and default Spotify artist logo
- Displays link to sign-in page
- On all pages, if signed in:
- Displays either my Spotify account name (
uid
), or real name (name
), and my Spotify user avatar - Displays link to sign-out
- Displays either my Spotify account name (
/sign_in
- Displays Spotify logo prominently (see the 3rd-party developer design resoruces)
- Displays a link to "Sign In With Spotify", which forwards to the Spotify OAuth API
_suggestion
(partial)- This is the HTML representation of a single suggestion
- Displays a food recommendation
- Includes name of the business, linking to appropriate Yelp page
- Includes address of the business (optional)
- Includes phone number of the business (optional)
- Includes photo/logo of the business
- Displays a music recommendation
- Includes name of the music item, linking to appropriate Spotify page
- Includes type of the music item (artist, album, track, or playlist)
- Includes photo/album cover of the music item
- Includes embedded Spotify player if appropriate (optional)
index
- Displays
_suggestion
partials for the top 20 suggestions ranked by number of favorites
- Displays
favorites
- Displays
_suggestion
partials for each suggestion favorited by the logged-in user - Each
_suggestion
partial also includes a button/link to unfavorite the suggestion
- Displays
Restaurants represent particular businesses retrieved from the Yelp Search API. They have the following attributes:
attribute | data type | description |
---|---|---|
business_id | string | Yelp-specific ID, which can be used to make calls to the Yelp Business API to retrieve complete details |
name | string | Name of the business |
url | string | Yelp URL for this business |
image_url | string | URL of the photo to display for this business |
phone | string | Phone number for the business |
rating | decimal number | Average rating for this business based on Yelp reviews |
Spotify Items are specific resources from the Spotify API including: artists, albums, tracks, and playlists. They have the following attributes:
attribute | data type | description |
---|---|---|
item_id | string | Spotify-specific ID, which can be used in conjunction with the type to make calls to the Spotify API |
type | string | Which type of resource this item is. Can be: artist, album, track, playlist |
name | string | Name of the item |
url | string | URL for opening this item in a browser-based Spotify player |
image_url | string | URL of the photo to display for this item |
Suggestions are pairs of one Restaurant and one SpotifyItem. They are what this website is all about, suggestions on how to combine music and food. Because the pairings are random, we rely upon crowdsourced ratings from our users to determine if a particular pairing is good.