A hybrid music recommendation system that combines content-based filtering with machine learning to provide personalized music recommendations. Built with FastAPI backend and React frontend.
- Genre-based Selection: Choose from 1-3 music genres to start your recommendation journey
- Sample Tracks: Preview genre samples to refine your taste profile
- Hybrid Recommendations: Combines content-based KNN with logistic regression for personalized suggestions
- Interactive Feedback: Like/dislike tracks to improve future recommendations
- Spotify Integration: Embedded Spotify player for seamless music listening
- Responsive Design: Works on desktop, tablet, and mobile devices
- Real-time Updates: Get new recommendations based on your feedback
- Hybrid Recommender: Content-based KNN + Logistic Regression model
- Data Processing: Handles music features, genres, and user feedback
- RESTful API: Clean endpoints for genres, samples, and recommendations
- Feedback System: Collects and stores user preferences for model improvement
- Modern UI: Clean, responsive interface with smooth transitions
- Spotify Integration: Embedded player for immediate music playback
- State Management: Efficient handling of user selections and feedback
- Progressive Enhancement: Step-by-step recommendation flow
-
Clone the repository
git clone git@github.com:Joumanasalahedin/nunvibe.git cd nunvibe -
Start the services
docker-compose up --build
-
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
-
Navigate to the backend directory
cd app -
Create a virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r ../requirements.txt
-
Start the backend server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
-
Navigate to the frontend directory
cd frontend -
Install dependencies
npm install # or yarn install -
Start the development server
npm run dev # or yarn dev -
Access the frontend
- Open http://localhost:3000 in your browser
nunvibe/
├── app/ # Backend FastAPI application
│ ├── api/ # API routes and dependencies
│ ├── core/ # Configuration and settings
│ ├── data/ # Data preprocessing and loading
│ ├── schemas/ # Pydantic models for API
│ ├── services/ # Business logic (recommender, updater)
│ └── main.py # FastAPI application entry point
├── frontend/ # React frontend application
│ ├── src/
│ │ ├── components/ # React components
│ │ └── App.tsx # Main application component
│ ├── public/ # Static assets
│ └── package.json # Frontend dependencies
├── scripts/ # Utility scripts
├── docker-compose.yml # Docker orchestration
├── Dockerfile # Backend container
└── requirements.txt # Python dependencies
The application uses the following configuration (see app/core/config.py):
API_PREFIX: API route prefix (default:/api)DEFAULT_K: Default number of recommendations (default: 10)MIN_FEEDBACK: Minimum feedback required for ML model (default: 50)CSV_PATH: Path to music datasetLR_MODEL_PATH: Path to trained logistic regression modelFEEDBACK_CSV_PATH: Path to user feedback storage
GET /api/genres- List available music genresGET /api/genres/samples- Get sample tracks for selected genresPOST /api/recommend- Get initial recommendationsPOST /api/recommend/feedback- Get refined recommendations based on feedback
- Genre Selection: Users select 1-3 music genres they enjoy
- Sample Preview: System shows sample tracks from selected genres
- Initial Recommendations: Content-based KNN provides first recommendations
- User Feedback: Users like/dislike tracks to improve the model
- Hybrid Recommendations: System combines user feedback with musical similarity
- Continuous Learning: Feedback is stored to improve future recommendations
- API Documentation: Available at http://localhost:8000/docs
- Hot Reload: Backend automatically restarts on code changes
- Type Checking: Uses Pydantic for request/response validation
- Hot Reload: Frontend automatically updates on code changes
- TypeScript: Full type safety for better development experience
- ESLint: Code linting and formatting
# Start development environment
docker-compose up --build
# View logs
docker-compose logs -f
# Stop services
docker-compose downThe system uses a dataset of top 10,000 songs from 1950 to present, including:
- Track metadata (name, artist, genre)
- Musical features (tempo, energy, danceability, etc.)
- Genre classifications
- User feedback data
Dataset Source: Top 10000 Spotify Songs 1960-Now on Kaggle
If you encounter any issues or have questions:
- Check the API documentation at http://localhost:8000/docs
- Review the logs:
docker-compose logs - Open an issue on GitHub
NunVibe - Discover your next favorite song! 🎶