Back to projects
Web

SongRadar - Music Discovery Platform

Music library and discovery platform with a personalized recommendation engine.

Next.jsJavaScriptTailwindCSSFastAPIPython

Music listeners need a unified place to catalog albums, songs, and performers, and get recommendations aligned with their taste. SongRadar splits that into two services: a Next.js frontend I built (catalog browsing, auth, data entry) talking to a FastAPI backend a teammate built (JWT auth plus a Jupyter-developed recommendation model), connected through Next.js API routes that proxy to NEXT_DB_URL.

Three ways to get music into the catalog

The MVP spec called for three distinct data-entry paths, all landing on the same createAlbum call: a manual form, a bulk file upload, and a local-database migration path. The file upload is the interesting one - it accepts loosely-formatted, single-quoted JSON-like text (the kind you'd paste out of a spreadsheet or another app's export) and repairs it before parsing:

const content = await file.text();
const json = JSON.parse(
  content.replace(/'/g, '"').replace(/(\w+):/g, '"$1":'),
);
 
for (let i = 0; i < json.length; i++) {
  await createAlbum(json[i]);
}

It's a deliberately forgiving parser rather than a strict schema validator - a small jsonFix helper elsewhere in the codebase does the same trick for smart-quote artifacts (\x93/\x94) that show up in copy-pasted metadata.

Auth and routing

Sign-in is next-auth-based, gated by a withAuth middleware that matches every route except the API, static assets, and the auth pages themselves - so an unauthenticated visit anywhere in the catalog redirects to /auth/signin. Album, song, and performer browsing, playlists, friend requests, and starred-song charts all sit behind that gate.

Recommendations

Once music is in the catalog, /api/recommend/song/[id], /api/recommend/album/[id], and /api/recommend/playlist/[id] proxy through to the FastAPI service, which returns ranked suggestions based on the Jupyter-trained model. The frontend renders those as a dedicated recommendations rail alongside the user's starred-song stats (decade breakdown, key distribution, loudness trend).

Result

A working music management interface backed by a recommendation engine, with token-based auth, full CRUD on the music catalog, and three independent ways to get data in - manual entry, file upload, and migration from a local database.