Building a Music Archive with Next.js, Prisma, and D3
How a 20-year-old Microsoft Access database became a full-stack web application with real-time enrichment from 6 external APIs.
The Origin
It started as a simple Access .mdb file — 3,706 recordings tracked since the early 2000s. Artist, album, year, format, rating. Functional but isolated. The question was: what happens when you connect this data to the broader music knowledge graph?
The Stack
- Next.js 16 — App Router with server components, API routes, and static generation where possible.
- PostgreSQL on AWS RDS — The production database, accessed via Prisma ORM.
- Prisma — Type-safe database client with migrations. The schema preserves all original Access fields while adding enrichment columns.
- Tailwind CSS 4 — Utility-first styling with custom components for the newspaper layout, mixing console, and network graph.
- D3.js — Force-directed graph visualization for the musician network.
- Recharts — Radar charts, bar charts, and pie charts for analytics dashboards.
- OpenAI — Powers the conversational adviser: a tool-calling model for grounded answers, text-to-speech for spoken replies, and the Realtime API for live voice.
The Enrichment Pipeline
The real transformation came from connecting each recording to external data sources:
- MusicBrainz — Track listings, release IDs, band member credits. 2,300+ albums enriched.
- Wikipedia — Album summaries and context. 1,600+ articles linked.
- YouTube — Per-track video matching using 10 API keys with quota rotation. Album-level video discovery with normalized artist name handling.
- Discogs — Marketplace pricing for both CD and vinyl pressings. Collection value analytics.
- Last.fm — Listener counts, genre tags, similar artists. Powers the recommendation engine.
- RSS Feeds — Aggregated from 8 prog/metal sources for the daily news page.
The Recommendation Engine
Rather than simple "you might like" suggestions, the engine performs gap analysis across multiple dimensions: adjacent artists (via Last.fm similarity data), catalog completeness, genre underrepresentation, format upgrades, and audiophile pressing opportunities. Each recommendation carries a composite score with a curator-style explanation.
Ask the Atlas — a Curator That Answers From the Archive
The newest layer is conversational. Ask the Atlas is a curator-styled adviser that answers questions about the collection and the writing — but the design constraint was the opposite of a chatbot that will say anything. It is grounded: the model runs a tool-calling loop over a small set of read-only archive tools — collection search, owned-pressing lookup, format comparison, recording detail, and article search — and writes its answer only from what those tools return. Every substantive claim traces back to a real recording or a real Reverberations piece, and it declines rather than invents when the archive has nothing to say.
The tools are deliberately plain, framework-agnostic functions, so the same layer maps cleanly onto emerging tool-calling standards later. Two details mattered most. First, the collection is stored with quirks a naive query trips over — artist names are inverted ("The Cars" lives as "Cars, The"), and a single row can hold two owned formats (CD and LP), which is a genuine pressing comparison rather than one copy. The tool layer normalizes both so the Curator never wrongly claims a record is unowned or that there is nothing to compare. Second, the archive gate is enforced at the tool boundary itself: anonymous visitors reach only the public article search, so the private collection can never leak through the conversation, in text or in voice.
It speaks, too. Replies can be read aloud via text-to-speech, and a live mode opens a full duplex voice conversation over WebRTC using the Realtime API — the listener can interrupt mid-sentence, and the model calls the same archive tools while talking. The permanent API key never touches the browser; the client mints a short-lived ephemeral token server-side and negotiates the media connection directly. When an answer surfaces specific recordings, signed-in readers can send that exact set straight to the main archive panel with one tap.
The Musician Network Graph
By parsing MusicBrainz credits across 2,300 albums, we built a graph of musicians and their band connections. D3's force simulation arranges 120+ nodes into a navigable constellation. Click a musician to see their full history; hover to highlight connections. It reveals relationships invisible in a flat database.
Infrastructure
Hosted on AWS: EC2 t3.small running the Next.js app behind nginx with Let's Encrypt SSL, RDS PostgreSQL for the database, and PM2 for process management. Enrichment scripts run as cron jobs. The entire deployment fits on a single instance with room to spare.
What's Next
The archive continues to grow. Daily YouTube enrichment adds album videos, the recommendation engine evolves with each new data point, and the collection itself expands as new acquisitions are cataloged. The goal was never just to list albums — it was to make a collection that thinks about itself.
Keep Reading
25 Best-Sounding Vinyl Records We Own: An Audiophile's Real-World Ranking
Every album on this list is actually owned, played, and evaluated through the same analog playback system. Not a list assembled from other audiophile lists — a sonic ranking from real-world listening.
What Have We Been Listening to in July?
Two heavy metal stalwarts command our attention alongside an unexpected detour into the smooth waters of Yacht Rock — from Armored Saint and Metal Church to Ned Doheny and early Doobie Brothers.
Sonic Atlas Rating Scale — An Epistemology of Recorded Music
The five-star scale is a curatorial taxonomy — expressing the degree to which a recording achieves coherence among composition, performance, production, emotional consequence, and enduring relevance.
What's a 3,600-Album Collection Worth?
We queried Discogs marketplace data for every album in the archive — both CD and vinyl pressings — to determine the real-world value of a lifelong music collection.