Intelligent music discovery platform powered by custom graph-based recommendations
TasteExplorer analyzes your Spotify listening history to build a personalized taste profile and recommend artists and tracks that perfectly match your musical preferences. The system uses a modular architecture with clean interfaces for plugging in custom recommendation algorithms.
Existing music recommendation systems (Spotify, Apple Music) often recommend popular or generic songs. They struggle to understand niche taste clusters and nuanced user preferences.
TasteExplorer provides:
- Deep analysis of listening patterns and audio features
- Custom graph-based recommendation engine (interface provided, implementation TBD)
- Personalized explanations for every recommendation
- Visual taste graph exploration
tasteexplorer/
βββ apps/
β βββ api/ # FastAPI backend
β β βββ auth/ # Spotify OAuth
β β βββ spotify/ # Spotify API integration
β β βββ user/ # User management
β β βββ database/ # SQLAlchemy models
β β βββ recommender/ # Recommendation engine interface
β β βββ ingestion/ # Data ingestion pipelines
β β βββ analytics/ # Analytics module
β βββ web/ # Next.js frontend
β βββ src/
β β βββ app/ # App router pages
β β βββ components/ # React components
β β βββ lib/ # Utilities
β β βββ types/ # TypeScript types
βββ packages/ # Shared packages (future)
Frontend:
- Next.js 15 (App Router)
- React 19
- TypeScript
- Tailwind CSS
- shadcn/ui
- Framer Motion
- React Flow / D3.js (for graph viz)
Backend:
- Python 3.12
- FastAPI
- SQLAlchemy
- PostgreSQL 17
- Redis
- Spotipy (Spotify API client)
Infrastructure:
- Docker & Docker Compose
- GitHub Actions (CI/CD ready)
- Docker & Docker Compose
- Spotify Developer Account (create one here)
- Git
Complete guide: See SPOTIFY_SETUP.md for detailed instructions.
Quick version:
- Go to https://developer.spotify.com/dashboard
- Create app with redirect URI:
http://localhost:8000/auth/spotify/callback - Copy Client ID and Client Secret
cd /path/to/tasteexplorer- Go to Spotify Developer Dashboard
- Create a new app
- Add redirect URI:
http://localhost:8000/auth/spotify/callback - Copy Client ID and Client Secret
cp .env.example .envEdit .env and add your Spotify credentials:
SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secret
SPOTIFY_REDIRECT_URI=http://localhost:8000/auth/spotify/callback
FRONTEND_URL=http://localhost:3000docker-compose up -dThis will start:
- PostgreSQL (port 5432)
- Redis (port 6379)
- FastAPI backend (port 8000)
- Next.js frontend (port 3000)
The database tables will be created automatically on first run.
- Frontend: http://localhost:3000
- API: http://localhost:8000
- API Docs: http://localhost:8000/docs
cd apps/api
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Copy environment file
cp .env.example .env
# Run development server
python main.pyBackend runs on http://localhost:8000
cd apps/web
# Install dependencies
npm install
# Run development server
npm run devFrontend runs on http://localhost:3000
- users - Application users
- spotify_profiles - Spotify OAuth profiles
- artists - Artist metadata
- tracks - Track metadata
- albums - Album metadata
- audio_features - Spotify audio features
- user_tracks - User's top/saved tracks
- user_artists - User's top artists
- recommendations - Generated recommendations
- taste_clusters - User taste clusters
See apps/api/database/models.py for complete schema.
GET /auth/spotify/login- Initiate Spotify OAuthGET /auth/spotify/callback- OAuth callbackPOST /auth/spotify/refresh- Refresh access token
GET /users/{id}/profile- Get user profileGET /users/{id}/artists- Get top artistsGET /users/{id}/tracks- Get top tracksGET /users/{id}/recommendations- Get recommendationsGET /users/{id}/graph- Get taste graphGET /users/{id}/stats- Get user statistics
POST /spotify/sync- Sync Spotify dataGET /spotify/test- Test Spotify connection
Full API documentation: http://localhost:8000/docs
The recommendation engine is NOT implemented - only the interface is provided.
apps/api/recommender/engine.py
class RecommendationEngine:
def build_user_profile(user_id: UUID) -> UserProfile:
"""Build comprehensive taste profile"""
# TODO: Implement custom algorithm
def generate_artist_candidates(user_id: UUID, strategy: str, limit: int) -> List[Candidate]:
"""Generate artist recommendation candidates"""
# TODO: Implement custom algorithm
def generate_track_candidates(user_id: UUID, strategy: str, limit: int) -> List[Candidate]:
"""Generate track recommendation candidates"""
# TODO: Implement custom algorithm
def score_recommendations(user_id: UUID, candidates: List[Candidate]) -> List[ScoredRecommendation]:
"""Score and rank candidates"""
# TODO: Implement custom scoring
def explain_recommendations(user_id: UUID, recs: List[ScoredRecommendation]) -> List[ScoredRecommendation]:
"""Generate human-readable explanations"""
# TODO: Implement explanation generation
def get_recommendations(user_id: UUID, num_artists: int, num_tracks: int) -> Dict:
"""Full recommendation pipeline"""
# TODO: Orchestrate all stepsA MockRecommendationEngine is provided for frontend development. It returns placeholder data.
The engine should implement:
- Track similarity graphs (audio feature based)
- Artist relationship graphs
- Taste cluster detection
- Graph traversal algorithms
- Novelty scoring
- Feature embeddings
- Product pitch
- Call-to-action
- Animated hero section
- Feature highlights
- Top artists grid
- Top tracks list
- Statistics cards
- Sync button
- Artist recommendations with explanations
- Track recommendations with scores
- Spotify integration links
- Shell only - visualization not implemented
- Placeholder for React Flow / D3.js graph
- Cluster summaries
- Graph statistics
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down
# Rebuild after changes
docker-compose up -d --build
# Reset database
docker-compose down -v
docker-compose up -d# Access PostgreSQL
docker exec -it tasteexplorer_postgres psql -U tasteexplorer
# Run migrations (future)
cd apps/api
alembic upgrade headcd apps/web
# Type check
npm run type-check
# Lint
npm run lint
# Build for production
npm run buildcd apps/api
# Run tests (future)
pytest
# Format code
black .
# Lint
flake8DATABASE_URL=postgresql://user:pass@localhost:5432/tasteexplorer
REDIS_URL=redis://localhost:6379/0
SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secret
SPOTIFY_REDIRECT_URI=http://localhost:8000/auth/spotify/callback
FRONTEND_URL=http://localhost:3000
CORS_ORIGINS=http://localhost:3000
ENVIRONMENT=development
SQL_ECHO=false # Set to true for SQL loggingNEXT_PUBLIC_API_URL=http://localhost:8000The following components need manual implementation:
- Build track similarity graph using audio features
- Build artist relationship graph
- Implement k-NN graph with cosine similarity
- Add graph persistence layer
- Implement taste cluster detection algorithm
- Compute cluster centroids
- Label clusters with genre/mood tags
- Store cluster memberships
- Implement similarity-based candidate generation
- Add graph traversal strategies
- Build cluster expansion logic
- Add novelty scoring
- Composite scoring (similarity + novelty + quality)
- Diversity filtering
- Preference alignment scoring
- Context-aware explanation templates
- Similar items identification
- Cluster/dimension attribution
MIT License
For questions or issues:
- Check API documentation: http://localhost:8000/docs
- Review this README
- Inspect Docker logs:
docker-compose logs -f
Spotify OAuth integration Data ingestion pipelines Normalized database schema REST API with full documentation Modern, responsive UI Dark mode support 3-layer graph-based recommendation engine (Layers 1, 2, 3) Docker development environment Production-ready deployment configs
π§ To Be Implemented:
- Graph visualization
- Advanced analytics
- Testing suite
Ready to deploy to production?
Quick Deploy:
- Frontend β Vercel (free tier)
- Backend β Render or Railway (free tier)
- Database β Supabase or Railway (free tier)
Complete deployment guide: See DEPLOYMENT.md
Quick checklist: See DEPLOYMENT_CHECKLIST.md
What you need:
- GitHub account (for repo)
- Spotify Developer account (for API keys)
- Vercel account (for frontend)
- Render or Railway account (for backend + database)
Deployment time: ~20 minutes following the guide
Built with β€οΈ using Next.js, FastAPI, and custom graph algorithms