Moodify is a web application that uses the Spotify API to generate playlists based on a users Spotify listening history and current mood.
Once authorized, Moodify gathers and stores a users listening history in a PostgreSQL database along with information for three audio features: danceability, energy, and valence. In order to uniformly segment the data provided by Spotify, Moodify normalizes the audio feature data for each user and an algorithm is applied to the normalized values to create a playlist with tracks specific to the user and their current mood. Once the playlist is created, the users can then view and play their playlist through Spotify as well as Moodify itself.
Frontend: ReactJS, Javascript, Jinja, jQuery, Bootstrap
Backend: Python, Flask, SQLAlchemy, PostgreSQL
Libraries: Scipy, Numpy
APIs: Spotify
Get Client ID and Client Secret from Spotify and save them to a file secrets.sh
:
export SPOTIFY_CLIENT_SECRET=YOUR_KEY
export SPOTIFY_CLIENT_ID=YOUR_KEY
On local machine, go to directory where you want to work and clone Moodify repository:
$ git clone https://github.com/mahnoorshafi/Moodify.git
Create a virtual environment in the directory:
$ virtualenv env
Activate virtual environment:
$ source env/bin/activate
Install dependencies:
$ pip install -r requirements.txt
Create database:
$ createdb moodify
Create your database tables:
$ python3 model.py
Source secrets.sh:
$ source secrets.sh
Run the app:
$ python3 server.py
Open localhost:5000 on browser.
Log in through Spotify and create your playlist by selecting a mood:
Once created, play your playlist through Spotify Web Player or through Moodify:
View playlist and select song to play as well as skip through songs:
- Fine tune algorithm that selects songs
- Give user's the ability to view all their past mood playlists
- Option to preview playlist and then save it