Welcome to Musical Bridges, a Spotify playlist generator that creates personalized playlists based on emotions and recommends top tracks!
music_recommendation_system/
├── app/
│ ├── __init__.py
│ ├── config.py
│ ├── models.py
│ ├── main.py
│ ├── utils.py
│ ├── extensions.py
├── webflow_exporter_base/
│ ├── index.html
│ ├── emotions.html
│ ├── recommendations.html
│ ├── anger-selection.html
│ ├── sadness-selection.html
│ ├── css/
│ │ ├── webflow-style.css
│ ├── js/
│ │ ├── jquery.js
│ │ ├── webflow-script.js
│ ├── images/
│ │ ├── (image files)
├── tests/
│ ├── test_app.py
├── migrations/
│ └── (migration files)
├── .env
├── .gitignore
├── README.md
├── requirements.txt
└── run.py
- Create Spotify Playlist: Generates a playlist of 10-20 songs based on emotion and song features.
- Top 5 Recommended Songs: Returns the top 5 most popular songs from the generated playlist as embedded track links.
- The system selects songs from the database that match the given emotion.
- It then randomly selects 10-20 tracks from this pool.
- The selection process considers various song features such as danceability, energy, loudness, speechiness, acousticness, instrumentalness, liveness, valence, tempo, and popularity.
- From the generated playlist, the system sorts the songs based on their popularity.
- It then selects the top 5 most popular songs.
- For each of these songs, it generates a Spotify embedded track link for easy listening.
-
Clone the repository:
git clone https://github.com/RichardJiang-collab/musical-bridges.git cd musical-bridges
-
Set up a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Set up your .env file with the following variables:
SECRET_KEY=your_secret_key SPOTIFY_CLIENT_ID=your_spotify_client_id SPOTIFY_CLIENT_SECRET=your_spotify_client_secret FLASK_DEBUG=True # Set to False in production
-
Initialize the database:
flask db init flask db migrate flask db upgrade
-
Run the application (it will go to the test page):
flask run
Contributions, issues, and feature requests are welcome! Feel free to check issues page.
This project is MIT licensed.
- Thanks to Spotify for providing the API that makes this project possible.
- Shoutout to all the music lovers who inspire projects like these!
Happy listening! 🎧