Skip to content

ryanflach/fest_suggest

Repository files navigation

FestSuggest

Code Climate

About

A website for Spotify users to find upcoming music festivals based on their listening habits. Technologies used include Rails, JavaScript, jQuery, Redis, and Sidekiq.

Functionality

A user is able to:

  • View their top artists based on their listening habits from the last 4 weeks, the last 6 months, or all time.
  • View up to 5 recommended upcoming music festivals per above time frame of listening habits
    • View which top and recommended artists are appearing at the festival
    • View how many other artists are on the festival line-up
    • Follow a hyperlink to the full line-up and additional details on Songkick
    • Follow or unfollow a Spotify playlist that contains the top track of all available artists on the festival line-up

How it Works

After querying the Spotify API and pulling the user's top and recommended artists by all time, the past six months, or the past four weeks, the app ties in with the Songkick API to identify upcoming events for each top artist with dates scheduled. The app then filters down to only upcoming festivals and performs analysis to rank the upcoming festivals, based on the number of top and recommended artists at each festival, as well as the ranking of those top artists. When analysis is complete, the top festivals are returned and ranked in order, up to five.

Playlists are created on an as-needed basic through a Spotify account that belongs to the site. Once the first user interested in a playlist clicks on 'Follow', the playlist is created and it appears in the user's followed playlists on Spotify. A background worker is then triggered to fetch the top track for all available artists at the festival, eventually adding them to the playlist. This process is not required for subsequent users to follow, as the playlist has already been created and its tracks added.

Repo Usage

After cloning or forking the project, bundle:

bundle

initialize the database:

rake db:{create,migrate}

and initialize figaro (currently used for ENV var management):

bundle exec figaro install

Note: API keys are required for both Spotify and Songkick. You can find more information on the Spotify API here, and the Songkick API here. Both are well documented.

The following keys will need to be populated in the application.yml file generated by figaro:

FS_ACCESS_TOKEN
FS_REFRESH_TOKEN
FS_ADMIN_NAME
SONGKICK_KEY
SPOTIFY_CLIENT
SPOTIFY_REDIRECT
SPOTIFY_SECRET

The FS_ values are required to fulfill the Spotify playlist functionality and are designed to be "admin" tokens. FS_ADMIN_NAME is the username, and the other two values can be obtained by logging in with that user and then grabbing the (temporary) values from the database. Since gathering these values initially is a manual process, a rake task exists to ensure the admin remains authorized in at all times.

Finally, launch a server:

rails s

And explore.

Please note that, in the application's default state, redis is required to enable caching, and Sidekiq is required to enable the processing of background jobs via a worker.

Running Tests

rspec

About

Curated music festival recommendations for Spotify users.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published