This project provides a mood-based music recommendation system. Users can select their current emotion, or draw a mood board and the system will suggest music accordingly.
- Python 3.10 or later
- Node.js
- Yarn or npm
-
Clone the repository:
git clone https://github.com/khushgx/music_emotion.git
-
Navigate to the backend directory:
cd music_emotion/backend -
Setup a virtual environment
python3 -m venv venv
-
Activate the virtual environments:
-
On macOS and Linux:
source venv/bin/activate -
On Windows:
.\venv\Scripts\activate
-
-
Install the necessary Python packages:
pip install flask flask_sqlalchemy flask_cors Pillow webcolors openai metaphor-python
-
Navigate to the frontend directory:
cd ../frontend -
Install the necessary JavaScript packages:
npm install # or if you are using Yarn: # yarn install
Setting up the environment Variables Make sure you do this inside the venv in the backend directory:
export OPENAI_API_KEY='your_api_key_here'
export METAPHOR_API_KEY='your_metaphor_api_key_here' While in the backend directory and with the virtual environment activated:
python app.pyWhile in the frontend directory:
npm run dev
# or if you are using Yarn:
# yarn startOnce both the frontend and backend servers are running, navigate to the frontend URL (usually http://localhost:3000 if using Next.js by default) in your browser. Choose your current mood and get a personalized music recommendation.