Table of Contents
SentiMusic is a mood-based music recommendation system using OpenAI API to analyze user emotions, generate personalized music genres, and integrates the Spotify API to retrieve and display song recommendations based on the generated genres.
To get a local copy up and running follow these simple example steps.
- Get an OPENAI API KEY or GROQ API KEY.
- Have a Spotify Account. Spotify Premium Account recommended to access playback feature.
- Create a Spotify App from Spotify Web API and get client id, client secret, and callback url.
- Create a .env in client and server directory
-
Clone the repo
git clone https://github.com/BrandonTDiep/SentiMusic.git
-
Navigate to the client and server directory. Install NPM packages
npm install
-
Enter your API keys in client directory
.envREACT_APP_API_URL = 'http://localhost:4000' REACT_APP_SPOTIFY_CLIENT_ID='ENTER YOUR SPOTIFY CLIENT ID'
-
Enter your API keys in server directory
.envPORT=4000 MODEL='ENTER YOUR GPT MODEL' OPENAI_BASE_URL='ENTER THE OPENAI BASE URL' OPENAI_API_KEY='ENTER YOUR OPENAI KEY' OPENAI_PROMPT='ENTER YOUR OPENAI PROMPT THAT WILL GENERATE 5 GENRES FOR SPOTIFY API' SPOTIFY_CLIENT_ID='ENTER YOUR SPOTIFY CLIENT ID' SPOTIFY_CLIENT_SECRET="ENTER YOUR SPOTIFY CLIENT SECRET" SPOTIFY_REDIRECT_URL="ENTER YOUR SPOTIFY CALLBACK URL" CLIENT_REDIRECT='http://localhost:3000'
-
Run the client
cd client npm start -
Run the server
cd backend npm run dev
