MCPcopy Index your code
hub / github.com/MoosicBox/MoosicBox

github.com/MoosicBox/MoosicBox @v0.16.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.16.1 ↗ · + Follow
5,737 symbols 16,606 edges 535 files 531 documented · 9%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

MoosicBox Server

A music server for cows

MoosicBox

Features

Implemented:

  • Audio playback controls
  • Next/previous track, seek track, queue tracks, adjust volume, etc
  • Control playback across applications (web and desktop)
  • Supports multi simultaneous audio outputs
  • Audio encoding on the fly
  • AAC (m4a, mp4), mp3, Opus
  • Hi-Fi audio player
  • Automatic image optimization for requested size on demand
  • Tunnel server reverse proxy - allows access to local server from internet without any firewall configuration
  • Tidal and Qobuz integration
  • No internet connection required, ever.
  • Global search functionality
  • Postgres, MySQL, and SQLite database support
  • Android app
  • Audio file visualization on seek bar

To-do:

See the prioritized backlog

Local Server

Dependencies

  • pkg-config (optional for OPUS)
  • libtool (optional for OPUS)
  • vips (optional for libvips image optimization)

Run

cargo server 8001

Debug

RUST_BACKTRACE=1 RUST_LOG="moosicbox=debug" cargo server:debug 8001

Deploy

WS_HOST="wss://tunnel2.moosicbox.com/ws" TUNNEL_ACCESS_TOKEN='your access token here' STATIC_TOKEN='your static token here' ./do-deploy.sh moosicbox-tunnel-server

Tunnel Server

Run

TUNNEL_ACCESS_TOKEN='your access token here' cargo tunnel-server 8005

Development

TUNNEL_ACCESS_TOKEN='your access token here' RUST_BACKTRACE=1 RUST_LOG="moosicbox=debug" cargo tunnel-server:debug 8005

Deploy

TUNNEL_ACCESS_TOKEN='your access token here' AWS_ACCESS_KEY_ID='token here' AWS_SECRET_ACCESS_KEY='key here' ./do-deploy.sh moosicbox-tunnel-server

Database

Server

The SQLite database stores the music library data:

  • Artist metadata
  • Album metadata
  • Track metadata
  • Local WebSocket connection metadata
  • Audio Player configurations
  • Playback Sessions

Migrations

SQLite
Run

diesel migration run --migration-dir migrations/server/sqlite --database-url library.db

Revert

diesel migration revert --migration-dir migrations/server/sqlite --database-url library.db

New Migration

diesel migration generate --migration-dir migrations/server/sqlite migration_name

Postgres
Run

diesel migration run --migration-dir migrations/server/postgres --database-url postgres://username:password@host/dbname

Revert

diesel migration revert --migration-dir migrations/server/postgres --database-url postgres://username:password@host/dbname

New Migration

diesel migration generate --migration-dir migrations/server/postgres migration_name

Tunnel

Postgres

The Postgres database stores the tunnel server configurations:

  • WebSocket connection mappings
  • Enables the tunnel server to know which WebSocket connection to tunnel data from
Migrations
Run

diesel migration run --migration-dir migrations/tunnel/postgres --database-url postgres://username:password@host/dbname

Revert

diesel migration revert --migration-dir migrations/tunnel/postgres --database-url postgres://username:password@host/dbname

New Migration

diesel migration generate --migration-dir migrations/tunnel/postgres migration_name

MySQL

The MySQL database stores the tunnel server configurations:

  • WebSocket connection mappings
  • Enables the tunnel server to know which WebSocket connection to tunnel data from
Migrations
Run

diesel migration run --migration-dir migrations/tunnel/mysql --database-url mysql://username:password@host/dbname

Revert

diesel migration revert --migration-dir migrations/tunnel/mysql --database-url mysql://username:password@host/dbname

New Migration

diesel migration generate --migration-dir migrations/tunnel/mysql migration_name

Extension points exported contracts — how you extend this code

MusicApi (Interface)
(no doc) [7 implementers]
packages/music_api/src/lib.rs
AsId (Interface)
(no doc) [17 implementers]
packages/database/src/lib.rs
ToRenderRunner (Interface)
(no doc) [6 implementers]
packages/hyperchad/renderer/src/lib.rs
ToValueType (Interface)
(no doc) [224 implementers]
packages/json_utils/src/lib.rs
FromRequest (Interface)
(no doc) [13 implementers]
packages/web_server/src/lib.rs
AudioWrite (Interface)
(no doc) [11 implementers]
packages/audio_output/src/lib.rs
AudioDecode (Interface)
(no doc) [7 implementers]
packages/audio_decoder/src/lib.rs
Actor (Interface)
(no doc) [4 implementers]
packages/simvar/harness/src/lib.rs

Core symbols most depended-on inside this repo

clone
called by 1700
packages/random/src/lib.rs
map
called by 1116
packages/paging/src/lib.rs
into
called by 920
packages/paging/src/lib.rs
to_value
called by 674
packages/json_utils/src/tantivy.rs
map_err
called by 442
packages/paging/src/lib.rs
as_ref
called by 349
packages/web_server/src/lib.rs
into_iter
called by 263
packages/openport/src/lib.rs
try_into
called by 239
packages/paging/src/lib.rs

Shape

Function 2,337
Method 2,031
Class 739
Enum 473
Interface 157

Languages

Rust87%
TypeScript11%
Kotlin3%
C++1%

Modules by API surface

packages/hyperchad/transformer/src/layout/calc.rs228 symbols
app-website/src/services/api.ts163 symbols
packages/hyperchad/transformer/src/lib.rs110 symbols
packages/yt/src/lib.rs96 symbols
packages/music_api/src/lib.rs96 symbols
packages/qobuz/src/lib.rs95 symbols
packages/tidal/src/lib.rs93 symbols
packages/library/src/lib.rs93 symbols
packages/app/tauri/src-tauri/gen/android/app/src/main/java/com/moosicbox/MoosicBoxPlayer.kt87 symbols
packages/database/src/query.rs84 symbols
packages/hyperchad/renderer/egui/src/lib.rs77 symbols
packages/database/src/postgres/postgres.rs64 symbols

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add MoosicBox \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact