Mason Scott

Logo

View the Project on GitHub 04mscott/Recommendation-API

🎡 Music Recommender API

A high-performance, asynchronous music recommendation system that integrates Spotify and YouTube APIs to deliver personalized track suggestions using semantic similarity. Built with FastAPI, Celery, Redis, and Docker, this API is designed to work seamlessly with a custom React + Spring Boot frontend application as part of a full-stack music recommendation platform.


πŸš€ Overview

This project serves as the backend engine for a full-stack music recommender system. It takes in a Spotify track and returns similar songs by leveraging audio embeddings, cosine similarity, and external API lookups. The system is built for scalability, fast response time, and integration with modern client-side applications.


project diagram β€”

🧠 Core Features


πŸ“‚ Project Structure

Recommendation-API
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ utils.py           # Interacting with Spotify API and saving data to database
β”‚   β”œβ”€β”€ recommend.py       # Embedding, similarity, and helper logic
β”‚   β”œβ”€β”€ celery_config.py   # Celery environment setup
β”‚   β”œβ”€β”€ main.py            # FastAPI entrypoint
β”‚   └── celery_tasks.py    # Celery tasks for async computation
β”œβ”€β”€ .dockerignore          # Ignore files
β”œβ”€β”€ .gitignore             # 
β”œβ”€β”€ compose.yml            # Configuration specs for Docker
β”œβ”€β”€ Dockerfile             # Setup for Docker
β”œβ”€β”€ README.md              # What you're looking at right now!
└── requirements.txt       # All required libraries/packages

πŸ§ͺ Example Use Case

  1. A new user logs into the BeatMatch app.
  2. The Spring Boot backend sends a POST request to the /save-data endpoint.
  3. A Celery task is triggered to:
    • Fetch all songs associated with user’s Spotify acount
    • Search YouTube API for official song audios for preview playback and analysis
    • Store the full result set in MySQL
    • Trigers a new Celery task to analyze the songs saved for the given user
    • Songs are process in batches
    • Temporarily downloaded, analyzed using librosa, stored in MySQL, remove downloaded files
  4. Once ready, the frontend hits /recommend to retrieve the final list of tracks + YouTube links.
    • In case user data is not available/taking too long, general recommendations are given using the mean feature vector of the entire dataset
  5. The backend polls /status/{task_id} to check when processing is complete and notifies user when their recommendations are ready to be fully personalized.

πŸ“ˆ Future Improvements


πŸ§‘β€πŸ’» Author

Mason Scott
Third year CS major (Data Science track), Statistics minor
University of Maryland – College Park
🌐 Website: masonscott.net
πŸ™ GitHub: 04mscott
πŸ”— LinkedIn: Mason Scott


πŸ“Œ Notes

This API was built specifically to serve a React + Spring Boot app for a full-stack music recommendation system. It is designed to run in Docker containers with background task support and optimized external API interaction. While setup and deployment details are not included in this README, the system is fully containerized and production-ready.