kami 60085c1d72 fix(playback): stop a moment without signal from pausing the phone
A phone changing cell or locking its screen drops the push stream for a
few seconds while its audio keeps playing. The server released session
ownership the instant that stream closed, and the phone read its own
reconnect snapshot as another device taking over: it paused, and rewound
to whatever position it had last reported. Ownership now survives a
closed stream. A device that is really gone still loses the session, via
pagehide and via the sweep that frees an owner whose heartbeat stopped.

The client no longer treats an unowned session as an instruction to
stop. With audio loaded it claims the session back instead.

Two ways a phone could go quiet until the page was reloaded are also
gone: registration is retried rather than attempted once, and the push
stream reopens after an error status, which EventSource treats as final.
It also checks itself when the network or the tab comes back.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KENqSChfyqWnor6ud2WWH6
2026-08-10 13:59:29 +04:00

muzick

A high-performance, distributed music orchestration and recommendation platform.

Overview

muzick is designed to manage a local music library while providing an "infinite vibe" listening experience. It bridges the gap between a local filesystem and advanced discovery engines through a tiered recommendation architecture.

Tech Stack

Frontend

  • Framework: React
  • Routing: TanStack Router
  • Data Fetching: TanStack Query (with Look-ahead Buffering)
  • State Management: Zustand (for Session/Vibe state)
  • Styling: CSS Variables (Customizable Themes)

Backend

  • Runtime: Node.js / TypeScript
  • Framework: Fastify
  • Task Queue: BullMQ (via Redis)
  • Search: Typesense

Infrastructure & Data

  • Database: PostgreSQL (Source of truth for metadata, relationships, and session state)
  • Cache/Queue: Redis
  • Audio Analysis: Essentia (via Worker processes)
  • External Metadata: MusicBrainz, Discogs, LRCLib, Cover Art Archive

Core Concepts

  • The Rolling Vibe: A continuous, evolving stream of music that uses a "Rolling Window" of tracks. It interleaves owned library tracks with high-probability "probation" tracks (external discoveries).
  • The Dislike Lifecycle: A multi-stage state machine that protects users from accidental deletions while ensuring the library stays clean.
  • Tiered Similarity: Instant metadata-based matches, followed by deep audio-feature similarity.

Getting Started

Prerequisites

  • Docker & Docker Compose

Running Locally

Vibe uses the same per-user identity convention as the rest of the API: x-user-id when supplied, otherwise the local default user. Each user's Vibe session and listening history are isolated from other users.

docker-compose up -d
S
Description
No description provided
Readme 2.7 MiB
Languages
TypeScript 95.5%
PLpgSQL 2.4%
CSS 1.4%
JavaScript 0.4%
Dockerfile 0.2%