John Jomi
All Projects
Completed/Case Study

Music Recommender — AI-Powered Spotify Recommendations

A full-stack application that authenticates users through Spotify OAuth, surfaces their top tracks and artists, and generates personalized song recommendations with Google Gemini.

The Problem

Spotify's own recommendations are a black box driven by collaborative filtering across millions of listeners. Passing a user's actual listening history to a language model produces suggestions that can be reasoned about and regenerated on demand, rather than waiting for a weekly refresh.

Features

  • Spotify OAuth 2.0 authentication
  • Top tracks and top artists drawn from the user's listening history
  • AI-generated track recommendations tailored to listening habits
  • Session-based caching for responsiveness
  • Persistent dark and light theming
  • Responsive layout across devices
  • Fresh recommendations generated on demand

Architecture

A Next.js 14 App Router frontend in TypeScript handles the interface and session state through React Context, while a FastAPI backend brokers Spotify OAuth and Gemini calls so that no client secret ever reaches the browser. PostgreSQL with SQLAlchemy holds persistent data, with Alembic managing migrations.

Caching strategy

Cache lifetimes are tuned to how quickly the underlying data actually changes, keeping the interface fast without serving stale results.

DataLifetime
Top tracks and artists5 minutes
Generated recommendations24 hours