Skip to Content
ReferenceArchitecture

Architecture

Understand the services, data flow, and playback state behind Music Box.

Services

ComponentResponsibility
CaddyPublic HTTPS and reverse proxy.
Flask and WaitressCatalog and account endpoints, playback arbitration, Jam state, and web player.
YouTube.js workerResolves playable URLs using a persistent private Node process.
Browser sidecarRuns the protected Chromium sign-in flow for YouTube Music.
SQLitePersists account and application state, including Jam records.
Alexa skillIssues Alexa AudioPlayer directives and reports playback events to the backend.

Playback state

Outside a Jam the backend coordinates the selected renderer and queue. It tracks queue occurrences and revisions so a late command cannot silently replace newer playback state. Browser clients combine periodic reads with bounded presence waits. The Alexa skill uses the live queue for successor decisions.

Audio delivery

The resolver prepares signed upstream URLs. Flask relays audio bytes as they arrive. The current-track buffer can keep received bytes temporarily for retries and handoff. Metadata and URL caches serve different purposes and do not store an offline music library.

Jam state

Jam sessions maintain a separate shared queue and position. The server tracks the invite, membership, and selected browser outputs. The invite and guest session scope access to the room.

On this page