Loops HouseNO
NO
Nostalgic Jukebox
Any theme, one station — everyone hears the same track in sync, even on flaky wifi

Event
The Nostalgic Jukebox Hack
Team
1 member- JAOwner
Jayesh Shete
Overview
Any station name spins up its own independent, isolated room — server-authoritative, keyed by that exact name (server.mjs's rooms Map). The name isn't just a label: it seeds a deterministic per-station track order (lib/tracks.mjs playlistFor), so different station names genuinely sound different, not just isolated.
- Real clock-offset correction: NTP round-trip midpoint estimate (lib/sync/clock.ts: estimateOffset, elapsedAt), unit-tested including a client joining mid-track.
- Playback is scheduled against AudioContext.currentTime via a lookahead Web Audio scheduler (lib/audio-scheduler.ts), not played on message receipt — tracks are synthesized locally from tiny note-pattern data, not streamed, so there's no audio file to buffer or lose on a bad connection.
- Late joins and reconnects resume at the correct elapsed position, verified live by killing the server mid-session and watching the client auto-rejoin without a page reload.
- Presence: join/leave logged distinctly server-side, live listener count in the UI, membership cleared from the room on socket close.
- Service Worker (public/sw.js, explicitly registered) caches the app shell so a dropped connection doesn't kill the page; audio itself needs no caching since it's synthesized, not fetched.
Custom Next.js server (server.mjs) + ws, chosen after confirming @vercel/functions' experimental_upgradeWebSocket doesn't work under plain next dev. Not done: playlist content is still 4 procedural tracks (no real audio licensing); single in-memory process (no horizontal scaling).