Show guests the set live: plays, history, charts at /live #38
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/live-guest-view"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The app server can admit guests (#36), but it has nothing to show them. The console has no way to report plays, and there's no guest site.
Solution
App server
reportPlay(DJ only) records a play. It is idempotent on aclientIdthe console generates, and it still accepts plays for a closed session, so an outbox that replays late still lands.view(guest only) returns now playing, history (newest first) and the charts of played tracks only. Unrated plays show as gaps.onInvalidateis a WebSocket subscription that tells each guest's screen which data to refetch, scoped to that guest's own session.Guest site (
app/web)app/shared/SetCharts.bun run liveserves the site at/live.bun run build:livebuilds a static bundle for Caddy, used in Slice 8.This is Slice 3 of
projects/2026-09-27-dj-online-companion/plan.md.Testing
bun test: 151 pass. That includes the play/view router tests and a real WebSocket test in which a guest hears a play land and refetches.bun run check: clean.bun run livein test mode. A self-signed DJ opens a session and reports a play; a guest'sviewreturns it, and/liveserves the page.🤖 Generated with Claude Code