# monochrome-music/desktop-app architecture

> Architecture diagram of the GitHub repository monochrome-music/desktop-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/monochrome-music/desktop-app
- Repository: https://github.com/monochrome-music/desktop-app

## Overview

Monochrome appears to be a desktop music player, built around a browser UI with Tauri support. Its main workflow is user interaction in the app, routed through UI and player/event modules; the app also invokes playlist import/export and track-download actions. The tree indicates additional playback, audio processing, library, account, and community features. Evidence is limited: README is only a Tauri/React template, and most source was not sampled, so uncertain wiring is omitted.

Main entry points: [`js/app.js`](https://github.com/monochrome-music/desktop-app/blob/main/js/app.js) (App bootstrap), [`js/accounts/pocketbase.js`](https://github.com/monochrome-music/desktop-app/blob/main/js/accounts/pocketbase.js) (Cloud library sync), [`js/player.js`](https://github.com/monochrome-music/desktop-app/blob/main/js/player.js) (Player), [`js/visualizers/butterchurn.js`](https://github.com/monochrome-music/desktop-app/blob/main/js/visualizers/butterchurn.js) (Butterchurn visualizer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["App and UI"]
  node_app["App bootstrap<br/>[app.js]"]
  node_router["Router<br/>[router.js]"]
  node_ui["UI renderer<br/>[ui.js]"]
  node_events["Player events<br/>[events.js]"]
  node_commands["Command palette<br/>[commandPalette.js]"]
  node_settings["Settings<br/>[settings.js]"]
  node_storage["Settings storage<br/>[storage.js]"]
end

subgraph group_playback["Playback and audio"]
  node_player["Player<br/>[player.js]"]
  node_audio["Audio context<br/>[audio-context.js]"]
  node_eq["AutoEQ engine<br/>[autoeq-engine.js]"]
  node_visualizer["Butterchurn visualizer<br/>[butterchurn.js]"]
  node_hifi["HiFi module<br/>[HiFi.ts]"]
end

subgraph group_library["Library and downloads"]
  node_db[("Local database<br/>[db.js]")]
  node_downloads["Download manager<br/>[downloads.js]"]
  node_downloadsvc["Download service"]
  node_tagworker["Tag metadata worker<br/>[taglib.worker.ts]"]
end

subgraph group_accounts["Accounts and sync"]
  node_auth["Authentication<br/>[auth.js]"]
  node_authapi["Account API<br/>[authApi.js]"]
  node_pocketbase["Cloud library sync<br/>[pocketbase.js]"]
end

subgraph group_social["Community and presence"]
  node_party["Listening party<br/>[listening-party.js]"]
  node_scrobble["Scrobbling<br/>[multi-scrobbler.js]"]
  node_tauri["Tauri native services<br/>[lib.rs]"]
end

node_user(("Listener"))

node_user -->|"uses"| node_app
node_app -->|"creates"| node_router
node_app -->|"initializes"| node_ui
node_app -->|"initializes"| node_events
node_app -->|"initializes"| node_player
node_app -->|"calls"| node_downloads
node_app -->|"uses"| node_db
node_app -->|"uses"| node_scrobble
node_app -->|"uses"| node_commands
node_settings -.->|"stores settings"| node_storage
node_player -.->|"uses audio"| node_audio
node_visualizer -->|"uses audio"| node_audio
node_visualizer -->|"reads settings"| node_storage
node_downloadsvc -->|"loads"| node_downloads
node_tagworker -.->|"edits metadata"| node_player
node_auth -->|"configures client"| node_authapi
node_pocketbase -->|"calls"| node_authapi
node_pocketbase -->|"reads identity"| node_auth
node_pocketbase -->|"syncs library"| node_db
node_app -.->|"uses"| node_party
node_tauri -.->|"updates Discord presence"| node_user

click node_app "https://github.com/monochrome-music/desktop-app/blob/main/js/app.js"
click node_router "https://github.com/monochrome-music/desktop-app/blob/main/js/router.js"
click node_ui "https://github.com/monochrome-music/desktop-app/blob/main/js/ui.js"
click node_events "https://github.com/monochrome-music/desktop-app/blob/main/js/events.js"
click node_commands "https://github.com/monochrome-music/desktop-app/blob/main/js/commandPalette.js"
click node_settings "https://github.com/monochrome-music/desktop-app/blob/main/js/settings.js"
click node_storage "https://github.com/monochrome-music/desktop-app/blob/main/js/storage.js"
click node_player "https://github.com/monochrome-music/desktop-app/blob/main/js/player.js"
click node_audio "https://github.com/monochrome-music/desktop-app/blob/main/js/audio-context.js"
click node_eq "https://github.com/monochrome-music/desktop-app/blob/main/js/autoeq-engine.js"
click node_visualizer "https://github.com/monochrome-music/desktop-app/blob/main/js/visualizers/butterchurn.js"
click node_hifi "https://github.com/monochrome-music/desktop-app/blob/main/js/HiFi.ts"
click node_db "https://github.com/monochrome-music/desktop-app/blob/main/js/db.js"
click node_downloads "https://github.com/monochrome-music/desktop-app/blob/main/js/downloads.js"
click node_downloadsvc "https://github.com/monochrome-music/desktop-app/blob/main/js/download-service.js"
click node_tagworker "https://github.com/monochrome-music/desktop-app/blob/main/js/taglib.worker.ts"
click node_auth "https://github.com/monochrome-music/desktop-app/blob/main/js/accounts/auth.js"
click node_authapi "https://github.com/monochrome-music/desktop-app/blob/main/js/accounts/authApi.js"
click node_pocketbase "https://github.com/monochrome-music/desktop-app/blob/main/js/accounts/pocketbase.js"
click node_party "https://github.com/monochrome-music/desktop-app/blob/main/js/listening-party.js"
click node_scrobble "https://github.com/monochrome-music/desktop-app/blob/main/js/multi-scrobbler.js"
click node_tauri "https://github.com/monochrome-music/desktop-app/blob/main/src-tauri/src/lib.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_router,node_ui,node_events,node_commands,node_settings,node_storage toneBlue
class node_player,node_audio,node_eq,node_visualizer,node_hifi toneAmber
class node_db,node_downloads,node_downloadsvc,node_tagworker toneMint
class node_auth,node_authapi,node_pocketbase toneRose
class node_party,node_scrobble,node_tauri,node_user toneIndigo
```

## Components

### App and UI

- [App bootstrap](https://github.com/monochrome-music/desktop-app/blob/main/js/app.js): `js/app.js`
- [Router](https://github.com/monochrome-music/desktop-app/blob/main/js/router.js): `js/router.js`
- [UI renderer](https://github.com/monochrome-music/desktop-app/blob/main/js/ui.js): `js/ui.js`
- [Player events](https://github.com/monochrome-music/desktop-app/blob/main/js/events.js): `js/events.js`
- [Command palette](https://github.com/monochrome-music/desktop-app/blob/main/js/commandPalette.js): `js/commandPalette.js`
- [Settings](https://github.com/monochrome-music/desktop-app/blob/main/js/settings.js): `js/settings.js`
- [Settings storage](https://github.com/monochrome-music/desktop-app/blob/main/js/storage.js): `js/storage.js`

### Playback and audio

- [Player](https://github.com/monochrome-music/desktop-app/blob/main/js/player.js): `js/player.js`
- [Audio context](https://github.com/monochrome-music/desktop-app/blob/main/js/audio-context.js): `js/audio-context.js`
- [AutoEQ engine](https://github.com/monochrome-music/desktop-app/blob/main/js/autoeq-engine.js): `js/autoeq-engine.js`
- [Butterchurn visualizer](https://github.com/monochrome-music/desktop-app/blob/main/js/visualizers/butterchurn.js): `js/visualizers/butterchurn.js`
- [HiFi module](https://github.com/monochrome-music/desktop-app/blob/main/js/HiFi.ts): `js/HiFi.ts`

### Library and downloads

- [Local database](https://github.com/monochrome-music/desktop-app/blob/main/js/db.js): `js/db.js`
- [Download manager](https://github.com/monochrome-music/desktop-app/blob/main/js/downloads.js): `js/downloads.js`
- [Download service](https://github.com/monochrome-music/desktop-app/blob/main/js/download-service.js): `js/download-service.js`
- [Tag metadata worker](https://github.com/monochrome-music/desktop-app/blob/main/js/taglib.worker.ts): `js/taglib.worker.ts`

### Accounts and sync

- [Authentication](https://github.com/monochrome-music/desktop-app/blob/main/js/accounts/auth.js): `js/accounts/auth.js`
- [Account API](https://github.com/monochrome-music/desktop-app/blob/main/js/accounts/authApi.js): `js/accounts/authApi.js`
- [Cloud library sync](https://github.com/monochrome-music/desktop-app/blob/main/js/accounts/pocketbase.js): `js/accounts/pocketbase.js`

### Community and presence

- [Listening party](https://github.com/monochrome-music/desktop-app/blob/main/js/listening-party.js): `js/listening-party.js`
- [Scrobbling](https://github.com/monochrome-music/desktop-app/blob/main/js/multi-scrobbler.js): `js/multi-scrobbler.js`
- [Tauri native services](https://github.com/monochrome-music/desktop-app/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`

### Other components

- **Listener**

## Connections

- Listener → App bootstrap: uses
- App bootstrap → Router: creates (evidence: `js/app.js`)
- App bootstrap → UI renderer: initializes (evidence: `js/app.js`)
- App bootstrap → Player events: initializes (evidence: `js/app.js`)
- App bootstrap → Player: initializes (evidence: `js/app.js`)
- App bootstrap → Download manager: calls (evidence: `js/app.js`)
- App bootstrap → Local database: uses (evidence: `js/app.js`)
- App bootstrap → Scrobbling: uses (evidence: `js/app.js`)
- App bootstrap → Command palette: uses (evidence: `js/app.js`)
- Settings → Settings storage: stores settings
- Player → Audio context: uses audio
- Butterchurn visualizer → Audio context: uses audio (evidence: `js/visualizers/butterchurn.js`)
- Butterchurn visualizer → Settings storage: reads settings (evidence: `js/visualizers/butterchurn.js`)
- Download service → Download manager: loads (evidence: `js/download-service.js`)
- Tag metadata worker → Player: edits metadata
- Authentication → Account API: configures client (evidence: `js/accounts/auth.js`)
- Cloud library sync → Account API: calls (evidence: `js/accounts/pocketbase.js`)
- Cloud library sync → Authentication: reads identity (evidence: `js/accounts/pocketbase.js`)
- Cloud library sync → Local database: syncs library (evidence: `js/accounts/pocketbase.js`)
- App bootstrap → Listening party: uses
- Tauri native services → Listener: updates Discord presence
