# umnik1/yaamp architecture

> Architecture diagram of the GitHub repository umnik1/yaamp, 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/umnik1/yaamp
- Repository: https://github.com/umnik1/yaamp

## Overview

Yaamp is an Electron desktop player that brings Yandex Music into a Webamp/Winamp interface. The main workflow is: the user chooses music in the player, Electron IPC handlers request tracks from Yandex Music, and the resulting track data is sent to the renderer for playback. The README also documents HTTP remote control, Discord presence, skins, equalizer, Milkdrop visualization, persistence, hotkeys, and platform controls. Some of these subsystems are represented from README documentation because their implementation was not sampled; those relationships are documented rather than inferred from imports.

Main entry points: [`src/webamp/webamp.bundle.js`](https://github.com/umnik1/yaamp/blob/main/src/webamp/webamp.bundle.js) (Webamp UI), [`src/node/ipc/music-handlers.js`](https://github.com/umnik1/yaamp/blob/main/src/node/ipc/music-handlers.js) (Music handlers), [`src/node/ipc/app-handlers.js`](https://github.com/umnik1/yaamp/blob/main/src/node/ipc/app-handlers.js) (App handlers), [`src/node/api-server.js`](https://github.com/umnik1/yaamp/blob/main/src/node/api-server.js) (HTTP API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop shell"]
  node_main["Electron lifecycle<br/>[main.js]"]
  node_window["Main window<br/>[main-window.js]"]
  node_ipc["IPC registration<br/>[index.js]"]
  node_apphandlers["App handlers<br/>[app-handlers.js]"]
  node_userdata[("Settings storage<br/>[user-data.js]")]
end

subgraph group_music["Music workflow"]
  node_state["Playback state<br/>[playback-state.js]"]
  node_musicipc["Music handlers<br/>[music-handlers.js]"]
  node_yandex["Yandex Music"]
end

subgraph group_player["Webamp player"]
  node_renderer["Renderer<br/>[renderer.ts]"]
  node_webamp["Webamp UI<br/>[webamp.bundle.js]"]
  node_media["Audio playback<br/>[index.ts]"]
  node_playlist["Playlist<br/>[TrackList.tsx]"]
  node_skins["Skins and windows<br/>[App.tsx]"]
  node_eq["Equalizer<br/>[index.tsx]"]
  node_milkdrop["Milkdrop visualizer<br/>[index.tsx]"]
  node_store["Player state<br/>[selectors.ts]"]
end

subgraph group_integrations["Control integrations"]
  node_api["HTTP API<br/>[api-server.js]"]
  node_discord["Discord presence<br/>[discord.js]"]
  node_client(("Remote controller"))
  node_hotkeys["Winamp hotkeys<br/>[hotkeys.ts]"]
  node_touchbar["Touch Bar<br/>[touch-bar.js]"]
end

node_user(("Listener"))

node_user -->|"controls"| node_webamp
node_main -->|"creates"| node_window
node_main -->|"starts"| node_api
node_main -->|"loads settings"| node_userdata
node_ipc -->|"registers"| node_musicipc
node_ipc -->|"registers"| node_apphandlers
node_musicipc -->|"requests tracks"| node_yandex
node_musicipc -->|"updates"| node_state
node_musicipc -->|"sends renderer events"| node_window
node_apphandlers -->|"configures"| node_api
node_apphandlers -->|"reads playback"| node_state
node_renderer -->|"loads"| node_webamp
node_webamp -.->|"uses playback"| node_media
node_webamp -->|"renders"| node_playlist
node_webamp -->|"renders"| node_skins
node_webamp -->|"renders"| node_eq
node_webamp -->|"renders"| node_milkdrop
node_webamp -->|"selects state"| node_store
node_webamp -->|"invokes music actions"| node_musicipc
node_api -->|"controls playback"| node_window
node_client -->|"sends requests"| node_api
node_webamp -->|"supports shortcuts"| node_hotkeys
node_webamp -.->|"persists settings"| node_userdata
node_musicipc -.->|"updates presence"| node_discord
node_apphandlers -->|"controls playback"| node_touchbar

click node_main "https://github.com/umnik1/yaamp/blob/main/main.js"
click node_window "https://github.com/umnik1/yaamp/blob/main/src/node/main-window.js"
click node_ipc "https://github.com/umnik1/yaamp/blob/main/src/node/ipc/index.js"
click node_apphandlers "https://github.com/umnik1/yaamp/blob/main/src/node/ipc/app-handlers.js"
click node_state "https://github.com/umnik1/yaamp/blob/main/src/node/playback-state.js"
click node_musicipc "https://github.com/umnik1/yaamp/blob/main/src/node/ipc/music-handlers.js"
click node_renderer "https://github.com/umnik1/yaamp/blob/main/src/renderer.ts"
click node_webamp "https://github.com/umnik1/yaamp/blob/main/src/webamp/webamp.bundle.js"
click node_media "https://github.com/umnik1/yaamp/blob/main/webamp/packages/webamp/js/media/index.ts"
click node_playlist "https://github.com/umnik1/yaamp/blob/main/webamp/packages/webamp/js/components/PlaylistWindow/TrackList.tsx"
click node_skins "https://github.com/umnik1/yaamp/blob/main/webamp/packages/webamp/js/components/App.tsx"
click node_eq "https://github.com/umnik1/yaamp/blob/main/webamp/packages/webamp/js/components/EqualizerWindow/index.tsx"
click node_milkdrop "https://github.com/umnik1/yaamp/blob/main/webamp/packages/webamp/js/components/MilkdropWindow/index.tsx"
click node_store "https://github.com/umnik1/yaamp/blob/main/webamp/packages/webamp/js/selectors.ts"
click node_userdata "https://github.com/umnik1/yaamp/blob/main/src/node/user-data.js"
click node_api "https://github.com/umnik1/yaamp/blob/main/src/node/api-server.js"
click node_discord "https://github.com/umnik1/yaamp/blob/main/src/node/discord.js"
click node_hotkeys "https://github.com/umnik1/yaamp/blob/main/webamp/packages/webamp/js/hotkeys.ts"
click node_touchbar "https://github.com/umnik1/yaamp/blob/main/src/node/touch-bar.js"

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_window,node_ipc,node_apphandlers,node_userdata toneBlue
class node_state,node_musicipc,node_yandex toneAmber
class node_renderer,node_webamp,node_media,node_playlist,node_skins,node_eq,node_milkdrop,node_store toneMint
class node_api,node_discord,node_client,node_hotkeys,node_touchbar toneRose
class node_user toneIndigo
```

## Components

### Desktop shell

- [Electron lifecycle](https://github.com/umnik1/yaamp/blob/main/main.js): `main.js`
- [Main window](https://github.com/umnik1/yaamp/blob/main/src/node/main-window.js): `src/node/main-window.js`
- [IPC registration](https://github.com/umnik1/yaamp/blob/main/src/node/ipc/index.js): `src/node/ipc/index.js`
- [App handlers](https://github.com/umnik1/yaamp/blob/main/src/node/ipc/app-handlers.js): `src/node/ipc/app-handlers.js`
- [Settings storage](https://github.com/umnik1/yaamp/blob/main/src/node/user-data.js): `src/node/user-data.js`

### Music workflow

- [Playback state](https://github.com/umnik1/yaamp/blob/main/src/node/playback-state.js): `src/node/playback-state.js`
- [Music handlers](https://github.com/umnik1/yaamp/blob/main/src/node/ipc/music-handlers.js): `src/node/ipc/music-handlers.js`
- **Yandex Music**

### Webamp player

- [Renderer](https://github.com/umnik1/yaamp/blob/main/src/renderer.ts): `src/renderer.ts`
- [Webamp UI](https://github.com/umnik1/yaamp/blob/main/src/webamp/webamp.bundle.js): `src/webamp/webamp.bundle.js`
- [Audio playback](https://github.com/umnik1/yaamp/blob/main/webamp/packages/webamp/js/media/index.ts): `webamp/packages/webamp/js/media/index.ts`
- [Playlist](https://github.com/umnik1/yaamp/blob/main/webamp/packages/webamp/js/components/PlaylistWindow/TrackList.tsx): `webamp/packages/webamp/js/components/PlaylistWindow/TrackList.tsx`
- [Skins and windows](https://github.com/umnik1/yaamp/blob/main/webamp/packages/webamp/js/components/App.tsx): `webamp/packages/webamp/js/components/App.tsx`
- [Equalizer](https://github.com/umnik1/yaamp/blob/main/webamp/packages/webamp/js/components/EqualizerWindow/index.tsx): `webamp/packages/webamp/js/components/EqualizerWindow/index.tsx`
- [Milkdrop visualizer](https://github.com/umnik1/yaamp/blob/main/webamp/packages/webamp/js/components/MilkdropWindow/index.tsx): `webamp/packages/webamp/js/components/MilkdropWindow/index.tsx`
- [Player state](https://github.com/umnik1/yaamp/blob/main/webamp/packages/webamp/js/selectors.ts): `webamp/packages/webamp/js/selectors.ts`

### Control integrations

- [HTTP API](https://github.com/umnik1/yaamp/blob/main/src/node/api-server.js): `src/node/api-server.js`
- [Discord presence](https://github.com/umnik1/yaamp/blob/main/src/node/discord.js): `src/node/discord.js`
- **Remote controller**
- [Winamp hotkeys](https://github.com/umnik1/yaamp/blob/main/webamp/packages/webamp/js/hotkeys.ts): `webamp/packages/webamp/js/hotkeys.ts`
- [Touch Bar](https://github.com/umnik1/yaamp/blob/main/src/node/touch-bar.js): `src/node/touch-bar.js`

### Other components

- **Listener**

## Connections

- Listener → Webamp UI: controls
- Electron lifecycle → Main window: creates (evidence: `main.js`)
- Electron lifecycle → HTTP API: starts (evidence: `main.js`)
- Electron lifecycle → Settings storage: loads settings (evidence: `main.js`)
- IPC registration → Music handlers: registers (evidence: `src/node/ipc/index.js`)
- IPC registration → App handlers: registers (evidence: `src/node/ipc/index.js`)
- Music handlers → Yandex Music: requests tracks (evidence: `src/node/ipc/music-handlers.js`)
- Music handlers → Playback state: updates (evidence: `src/node/ipc/music-handlers.js`)
- Music handlers → Main window: sends renderer events (evidence: `src/node/ipc/music-handlers.js`)
- App handlers → HTTP API: configures (evidence: `src/node/ipc/app-handlers.js`)
- App handlers → Playback state: reads playback (evidence: `src/node/ipc/app-handlers.js`)
- Renderer → Webamp UI: loads (evidence: `src/renderer.ts`)
- Webamp UI → Audio playback: uses playback
- Webamp UI → Playlist: renders
- Webamp UI → Skins and windows: renders (evidence: `webamp/packages/webamp/js/components/App.tsx`)
- Webamp UI → Equalizer: renders
- Webamp UI → Milkdrop visualizer: renders
- Webamp UI → Player state: selects state
- Webamp UI → Music handlers: invokes music actions
- HTTP API → Main window: controls playback
- Remote controller → HTTP API: sends requests
- Webamp UI → Winamp hotkeys: supports shortcuts
- Webamp UI → Settings storage: persists settings
- Music handlers → Discord presence: updates presence (evidence: `src/node/ipc/music-handlers.js`)
- App handlers → Touch Bar: controls playback (evidence: `src/node/ipc/app-handlers.js`)
