Personalized music recommendation engine. Uses RAG + LLMs to generate event-specific Spotify playlists from a user's music library.
cd apps/data-engine/app
uv venv
uv pip install -r requirements.txtCreate .env:
GEMINI_API_KEY=your_key_here
Run:
uv run uvicorn server:app --port 8000Startup takes ~1 min (generates embeddings for mock songs via Gemini). Ready when you see "Startup complete".
cd apps/orchestrator
npm install
npm run start:devRuns on http://localhost:3000.
curl -X POST http://localhost:3000/playlists/generate \
-H "Authorization: Bearer YOUR_SPOTIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"eventDescription": "Late night study session"}'Returns a Spotify playlist URL with 20 songs.
- Create an app at developer.spotify.com/dashboard
- Add yourself in User Management
- Authorize:
https://accounts.spotify.com/authorize?client_id=YOUR_CLIENT_ID&response_type=code&redirect_uri=https://google.com&scope=playlist-modify-public%20playlist-modify-private%20user-read-private&show_dialog=true
- Copy the
codefrom the redirect URL - Exchange for token (use Basic Auth with client_id:client_secret):
POST https://accounts.spotify.com/api/token
grant_type=authorization_code
code=THE_CODE
redirect_uri=https://google.com
| Scope | Why |
|---|---|
playlist-modify-public |
Create public playlists and add tracks |
playlist-modify-private |
Create private playlists and add tracks |
user-read-private |
Validate user token |
apps/
data-engine/ Python — RAG engine, LLM tagging, vector search
app/
server.py FastAPI server (POST /recommend)
llm_service.py Gemini API calls
rag_engine.py ChromaDB indexing & search
data/mock_data.py 20 mock songs for testing
orchestrator/ NestJS — Spotify integration, playlist creation
src/
modules/
spotify/ Spotify API wrapper (search, create, add tracks)
playlist/ Orchestration (data-engine -> Spotify -> playlist)
data-engine/ HTTP client for the Python service