Skip to content

Architecture

ecamacho edited this page Jul 10, 2026 · 2 revisions

Architecture

Jellyx is a Cargo workspace. Rust is the source of truth; the Svelte UI is a thin client. Audio is owned by the Rust side and survives UI reloads.

Workspace layout

Crate / dir Role
jellyx-core Pure domain logic. No Tauri dependency.
jellyx-desktop Tauri app: audio, IPC, persistence, sources, updater
jellyx-cli CLI skeleton
jellyx-ffi FFI skeleton
ui/ Svelte frontend (dumb client)

Design principles

  • Rust is the source of truth. State, audio, persistence live in Rust.
  • Svelte is a dumb client. It renders state and sends commands; it does not own audio.
  • Audio survives UI reload. Reloading the frontend does not stop playback, because the audio pipeline runs in the Rust process.

Audio pipeline

Source (YouTube / SoundCloud / local)
  -> Symphonia decoder
  -> PCM bus
  -> cpal output        (audio to speakers)
  -> rustfft FFT        (frequency data)
  -> binary IPC event   (FFT to Svelte visualizer)
  • Symphonia decodes audio to PCM.
  • PCM bus feeds both output and analysis.
  • cpal sends audio to the device.
  • rustfft computes frequency bins for visualizers.
  • FFT events are sent as binary (not JSON) for throughput.

IPC

Two channels between Rust and Svelte:

Channel Payload Use
Commands (UI → Rust) JSON Play, pause, enqueue, manage library, settings
Events (Rust → UI) JSON State changes, track info, errors
FFT events (Rust → UI) Binary Live visualizer data

Because IPC is JSON for control and binary for FFT, the UI stays simple while visualizers stay performant.

Persistence

  • SQLite via rusqlite.
  • Stores queue, playlists, favorites, history, settings.
  • Lives in the desktop app's data directory.

Sources

Implemented in jellyx-desktop. Each source is a module that produces PCM into the bus. Sources can be toggled in Settings.

Updater

jellyx-desktop includes an updater module (Tauri-managed). See Release Process for how releases are produced and Platform Support for per-platform packaging.

Next step

Clone this wiki locally