# ybycom/lx-music-desktop architecture

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

- Interactive diagram: https://gitdiagram.com/ybycom/lx-music-desktop
- Repository: https://github.com/ybycom/lx-music-desktop

## Overview

LX Music Desktop is an Electron/Vue music player. Users find music through online music sources, manage lists and downloads, then play tracks with lyrics and audio controls. The desktop main process hosts the windows and coordinates renderer communication; separate capabilities include desktop lyrics, local Open API, scheme URLs, and client/server data synchronization. The README establishes these product capabilities, while the excerpts show application startup and window wiring. Many feature modules were not sampled, so uncertain internal calls and storage flows are not asserted.

Main entry points: [`src/renderer/App.vue`](https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer/App.vue) (Player interface), [`src/main/app.ts`](https://github.com/ybycom/lx-music-desktop/blob/master/src/main/app.ts) (Electron startup), [`src/renderer/main.ts`](https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer/main.ts) (Renderer bootstrap), [`src/renderer/utils/musicSdk/index.js`](https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer/utils/musicSdk/index.js) (Online sources)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop runtime"]
  node_main["Electron startup<br/>[app.ts]"]
  node_mainwin["Main window<br/>[main.ts]"]
  node_renderer_init["Renderer bootstrap<br/>[main.ts]"]
  node_lyric_window["Lyric window<br/>[main.ts]"]
end

subgraph group_music["Music experience"]
  node_renderer["Player interface<br/>[App.vue]"]
  node_player["Playback engine<br/>[index.ts]"]
  node_music_ops["Music operations<br/>[index.ts]"]
  node_online_sources["Online sources<br/>[index.js]"]
  node_lists["Music lists<br/>[action.ts]"]
  node_lyrics["Lyric display<br/>[App.vue]"]
end

subgraph group_data["Local data"]
  node_settings["Settings<br/>[setting.ts]"]
  node_database[("Local database<br/>[db.ts]")]
  node_downloads["Downloads<br/>[download.ts]"]
end

subgraph group_sync["Data synchronization"]
  node_sync_client["Sync client<br/>[client.ts]"]
  node_sync_server["Sync server<br/>[server.ts]"]
  node_sync_auth["Sync authentication<br/>[auth.ts]"]
end

subgraph group_extensions["Integrations"]
  node_open_api["Open API<br/>[index.ts]"]
  node_user_api["User API<br/>[main.ts]"]
end

node_user(("Listener"))
node_third_party(("External callers"))
node_music_services{{"Music services"}}
node_sync_service{{"Sync service"}}

node_user -->|"uses"| node_renderer
node_main -->|"initializes"| node_mainwin
node_renderer_init -->|"mounts"| node_renderer
node_renderer -->|"starts via"| node_renderer_init
node_user -->|"finds music"| node_online_sources
node_online_sources -->|"requests music"| node_music_services
node_user -->|"plays tracks"| node_player
node_user -->|"manages lists"| node_lists
node_user -->|"downloads music"| node_downloads
node_renderer -.->|"shows lyrics"| node_lyrics
node_main -.->|"opens window"| node_lyric_window
node_user -->|"configures"| node_settings
node_user -->|"syncs data"| node_sync_client
node_sync_client -->|"exchanges data"| node_sync_service
node_user -->|"hosts sync"| node_sync_server
node_sync_server -->|"authenticates"| node_sync_auth
node_third_party -->|"calls locally"| node_open_api
node_third_party -.->|"integrates"| node_user_api

click node_main "https://github.com/ybycom/lx-music-desktop/blob/master/src/main/app.ts"
click node_mainwin "https://github.com/ybycom/lx-music-desktop/blob/master/src/main/modules/winMain/main.ts"
click node_renderer "https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer/App.vue"
click node_renderer_init "https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer/main.ts"
click node_player "https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer/core/player/index.ts"
click node_music_ops "https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer/core/music/index.ts"
click node_online_sources "https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer/utils/musicSdk/index.js"
click node_lists "https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer/store/list/action.ts"
click node_lyrics "https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer-lyric/App.vue"
click node_lyric_window "https://github.com/ybycom/lx-music-desktop/blob/master/src/main/modules/winLyric/main.ts"
click node_settings "https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer/store/setting.ts"
click node_database "https://github.com/ybycom/lx-music-desktop/blob/master/src/main/worker/dbService/db.ts"
click node_downloads "https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer/core/music/download.ts"
click node_sync_client "https://github.com/ybycom/lx-music-desktop/blob/master/src/main/modules/sync/client/client.ts"
click node_sync_server "https://github.com/ybycom/lx-music-desktop/blob/master/src/main/modules/sync/server/server/server.ts"
click node_sync_auth "https://github.com/ybycom/lx-music-desktop/blob/master/src/main/modules/sync/server/server/auth.ts"
click node_open_api "https://github.com/ybycom/lx-music-desktop/blob/master/src/main/modules/openApi/index.ts"
click node_user_api "https://github.com/ybycom/lx-music-desktop/blob/master/src/main/modules/userApi/main.ts"

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_main,node_mainwin,node_renderer_init,node_lyric_window toneBlue
class node_renderer,node_player,node_music_ops,node_online_sources,node_lists,node_lyrics toneAmber
class node_settings,node_database,node_downloads toneMint
class node_sync_client,node_sync_server,node_sync_auth toneRose
class node_open_api,node_user_api,node_user,node_third_party,node_music_services,node_sync_service toneIndigo
```

## Components

### Desktop runtime

- [Electron startup](https://github.com/ybycom/lx-music-desktop/blob/master/src/main/app.ts): `src/main/app.ts`
- [Main window](https://github.com/ybycom/lx-music-desktop/blob/master/src/main/modules/winMain/main.ts): `src/main/modules/winMain/main.ts`
- [Renderer bootstrap](https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer/main.ts): `src/renderer/main.ts`
- [Lyric window](https://github.com/ybycom/lx-music-desktop/blob/master/src/main/modules/winLyric/main.ts): `src/main/modules/winLyric/main.ts`

### Music experience

- [Player interface](https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer/App.vue): `src/renderer/App.vue`
- [Playback engine](https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer/core/player/index.ts): `src/renderer/core/player/index.ts`
- [Music operations](https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer/core/music/index.ts): `src/renderer/core/music/index.ts`
- [Online sources](https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer/utils/musicSdk/index.js): `src/renderer/utils/musicSdk/index.js`
- [Music lists](https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer/store/list/action.ts): `src/renderer/store/list/action.ts`
- [Lyric display](https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer-lyric/App.vue): `src/renderer-lyric/App.vue`

### Local data

- [Settings](https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer/store/setting.ts): `src/renderer/store/setting.ts`
- [Local database](https://github.com/ybycom/lx-music-desktop/blob/master/src/main/worker/dbService/db.ts): `src/main/worker/dbService/db.ts`
- [Downloads](https://github.com/ybycom/lx-music-desktop/blob/master/src/renderer/core/music/download.ts): `src/renderer/core/music/download.ts`

### Data synchronization

- [Sync client](https://github.com/ybycom/lx-music-desktop/blob/master/src/main/modules/sync/client/client.ts): `src/main/modules/sync/client/client.ts`
- [Sync server](https://github.com/ybycom/lx-music-desktop/blob/master/src/main/modules/sync/server/server/server.ts): `src/main/modules/sync/server/server/server.ts`
- [Sync authentication](https://github.com/ybycom/lx-music-desktop/blob/master/src/main/modules/sync/server/server/auth.ts): `src/main/modules/sync/server/server/auth.ts`

### Integrations

- [Open API](https://github.com/ybycom/lx-music-desktop/blob/master/src/main/modules/openApi/index.ts): `src/main/modules/openApi/index.ts`
- [User API](https://github.com/ybycom/lx-music-desktop/blob/master/src/main/modules/userApi/main.ts): `src/main/modules/userApi/main.ts`

### Other components

- **Listener**
- **External callers**
- **Music services**
- **Sync service**

## Connections

- Listener → Player interface: uses (evidence: `README.md`)
- Electron startup → Main window: initializes (evidence: `src/main/app.ts`)
- Renderer bootstrap → Player interface: mounts (evidence: `src/renderer/main.ts`)
- Player interface → Renderer bootstrap: starts via (evidence: `src/renderer/App.vue`)
- Listener → Online sources: finds music (evidence: `README.md`)
- Online sources → Music services: requests music (evidence: `README.md`)
- Listener → Playback engine: plays tracks (evidence: `README.md`)
- Listener → Music lists: manages lists (evidence: `README.md`)
- Listener → Downloads: downloads music (evidence: `README.md`)
- Player interface → Lyric display: shows lyrics
- Electron startup → Lyric window: opens window
- Listener → Settings: configures (evidence: `README.md`)
- Listener → Sync client: syncs data (evidence: `README.md`)
- Sync client → Sync service: exchanges data (evidence: `README.md`)
- Listener → Sync server: hosts sync (evidence: `README.md`)
- Sync server → Sync authentication: authenticates (evidence: `src/main/modules/sync/server/server/server.ts`)
- External callers → Open API: calls locally (evidence: `README.md`)
- External callers → User API: integrates
