nickspeal / musicThisWeek

A Web Service that generates a Spotify playlist of bands that are playing in your area in the near future
3 stars 2 forks source link

Music This Week

Music This Week is a music discovery service that generates a Spotify playlist of bands that are playing near you in the near future.

Constituent parts

Django web app: Site is called music_this_week, and the app is called music_this_week_app.

eventFinder.py: Crawls the internet to return a list of upcoming events in the specified city.

playlistCreator.py: Creates a spotify playlist based on a list of artists.

Development Status

In early development. Basic working prototype exists. Does not work for generic users.

Disclaimer

This is a personal hobby project, not intended for public use.

Nick Speal 2016. All rights reserved.

Setup Instructions

  1. Create a virtual environment for your project.

    To keep your pip installation clean, we recommend using virtualenvwrapper.

    $ mkvirtualenv mtw

    Anytime you want to run this project, run:

    $ workon mtw
  2. Install dependencies in your virtualenv from the root of the repo.

    $ pip install -r requirements.txt
  3. Also install Redis:

    $ brew install redis
  4. Create a config file called spotipyCreds.sh under a (gitignored) directory under the root called '_private':

    $ echo "
    export SPOTIPY_CLIENT_ID='Create a new app at developer.spotify.com to get this'
    export SPOTIPY_CLIENT_SECRET='Create a new app at developer.spotify.com to get this'
    export SPOTIPY_REDIRECT_URI='http://localhost:8888/callback'
    export DJANGO_SECRET_KEY='make one up'
    export EVENTFUL_KEY='Request an application key from https://api.eventful.com/keys'
    " > _private/spotipyCreds.sh

Running Instructions

  1. cd into the root of the repo

  2. Start the redis server: redis-server

  3. In a new terminal window, open the project's virtualenv: workon mtw

  4. Load the private environment variables: source _private/spotipyCreds.sh

  5. Run the appropriate workers: python manage.py runworker search song events

  6. In a new terminal window, open the project's virtualenv: workon mtw

  7. Run the backend: sh run.sh (Prereq: Make sure you already ran the setup instructions at some previous point.)

  8. In a new terminal window, cd into the musicthisweek-client directory with the frontend application and then run it, (probably npm start);

  9. Open the frontend application in the browser and follow the instructions

Documentation

How Spotify Authentication works

For CLI Login:

User Flows

  1. New user goes to the website, logs in for the first time, specifies search parameters, creates a playlist.
  2. Returning: User returns to the website, is automatically logged in and search params are loaded, creates a playlist (Not done yet)
  3. AutoRun: For each user, saved searches are repeated and playlists are updated periodically (Not done yet)