# dax622006/yearning architecture

> Architecture diagram of the GitHub repository dax622006/yearning, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dax622006/yearning
- Repository: https://github.com/dax622006/yearning

## Overview

This is a browser-based ambient music player. Users select and control shuffled tracks, while the app coordinates playback, progress, and volume; they can also adjust ambient sound layers, choose visual scenes, and open track or app information. The sampled code shows the main orchestration, UI controls, track data, and audio-engine integrations. Some component wiring is established by the source index rather than complete render excerpts, so the graph avoids inferring additional runtime stages.

Main entry points: [`src/App.tsx`](https://github.com/dax622006/yearning/blob/main/src/App.tsx) (Player coordinator), [`src/services/soundEngine.ts`](https://github.com/dax622006/yearning/blob/main/src/services/soundEngine.ts) (Sound engine), [`src/types.ts`](https://github.com/dax622006/yearning/blob/main/src/types.ts) (Track and scene types), [`src/main.tsx`](https://github.com/dax622006/yearning/blob/main/src/main.tsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App orchestration"]
  node_entry["React entry<br/>[main.tsx]"]
  node_app["Player coordinator<br/>[App.tsx]"]
  node_types["Track and scene types<br/>[types.ts]"]
end

subgraph group_playback["Music playback"]
  node_tracks["Playlist and scenes<br/>[tracks.ts]"]
  node_engine["Sound engine<br/>[soundEngine.ts]"]
end

subgraph group_atmosphere["Atmosphere and interface"]
  node_player_bar["Player controls<br/>[PlayerBar.tsx]"]
  node_mixer["Ambient mixer"]
  node_now_playing["Track details"]
  node_info["About dialog<br/>[InfoModal.tsx]"]
end

node_listener(("Listener"))
node_youtube["YouTube player"]
node_web_audio["Browser audio APIs"]

node_listener -->|"opens player"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"loads playlist"| node_tracks
node_app -->|"controls playback"| node_engine
node_engine -->|"loads and plays"| node_youtube
node_engine -->|"generates audio"| node_web_audio
node_app -->|"renders controls"| node_player_bar
node_player_bar -->|"sends control actions"| node_app
node_app -->|"renders mixer"| node_mixer
node_mixer -->|"sends mixer actions"| node_app
node_app -->|"renders track details"| node_now_playing
node_app -->|"renders about dialog"| node_info
node_app -->|"uses shared types"| node_types
node_tracks -->|"defines typed data"| node_types
node_engine -->|"accepts tracks"| node_types

click node_entry "https://github.com/dax622006/yearning/blob/main/src/main.tsx"
click node_app "https://github.com/dax622006/yearning/blob/main/src/App.tsx"
click node_types "https://github.com/dax622006/yearning/blob/main/src/types.ts"
click node_tracks "https://github.com/dax622006/yearning/blob/main/src/data/tracks.ts"
click node_engine "https://github.com/dax622006/yearning/blob/main/src/services/soundEngine.ts"
click node_player_bar "https://github.com/dax622006/yearning/blob/main/src/components/PlayerBar.tsx"
click node_mixer "https://github.com/dax622006/yearning/blob/main/src/components/AmbientMixerDrawer.tsx"
click node_now_playing "https://github.com/dax622006/yearning/blob/main/src/components/NowPlayingModal.tsx"
click node_info "https://github.com/dax622006/yearning/blob/main/src/components/InfoModal.tsx"

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_entry,node_app,node_types,node_web_audio toneBlue
class node_tracks,node_engine toneAmber
class node_player_bar,node_mixer,node_now_playing,node_info toneMint
class node_listener,node_youtube toneIndigo
```

## Components

### App orchestration

- [React entry](https://github.com/dax622006/yearning/blob/main/src/main.tsx): `src/main.tsx`
- [Player coordinator](https://github.com/dax622006/yearning/blob/main/src/App.tsx): `src/App.tsx`
- [Track and scene types](https://github.com/dax622006/yearning/blob/main/src/types.ts): `src/types.ts`

### Music playback

- [Playlist and scenes](https://github.com/dax622006/yearning/blob/main/src/data/tracks.ts): `src/data/tracks.ts`
- [Sound engine](https://github.com/dax622006/yearning/blob/main/src/services/soundEngine.ts): `src/services/soundEngine.ts`

### Atmosphere and interface

- [Player controls](https://github.com/dax622006/yearning/blob/main/src/components/PlayerBar.tsx): `src/components/PlayerBar.tsx`
- [Ambient mixer](https://github.com/dax622006/yearning/blob/main/src/components/AmbientMixerDrawer.tsx): `src/components/AmbientMixerDrawer.tsx`
- [Track details](https://github.com/dax622006/yearning/blob/main/src/components/NowPlayingModal.tsx): `src/components/NowPlayingModal.tsx`
- [About dialog](https://github.com/dax622006/yearning/blob/main/src/components/InfoModal.tsx): `src/components/InfoModal.tsx`

### Other components

- **Listener**
- **YouTube player**
- **Browser audio APIs**

## Connections

- Listener → React entry: opens player (evidence: `src/main.tsx`)
- React entry → Player coordinator: renders (evidence: `src/main.tsx`)
- Player coordinator → Playlist and scenes: loads playlist (evidence: `src/App.tsx`)
- Player coordinator → Sound engine: controls playback (evidence: `src/App.tsx`)
- Sound engine → YouTube player: loads and plays (evidence: `src/services/soundEngine.ts`)
- Sound engine → Browser audio APIs: generates audio (evidence: `src/services/soundEngine.ts`)
- Player coordinator → Player controls: renders controls (evidence: `src/App.tsx`)
- Player controls → Player coordinator: sends control actions (evidence: `src/components/PlayerBar.tsx`)
- Player coordinator → Ambient mixer: renders mixer (evidence: `src/App.tsx`)
- Ambient mixer → Player coordinator: sends mixer actions (evidence: `src/components/AmbientMixerDrawer.tsx`)
- Player coordinator → Track details: renders track details (evidence: `src/App.tsx`)
- Player coordinator → About dialog: renders about dialog (evidence: `src/App.tsx`)
- Player coordinator → Track and scene types: uses shared types (evidence: `src/App.tsx`)
- Playlist and scenes → Track and scene types: defines typed data (evidence: `src/data/tracks.ts`)
- Sound engine → Track and scene types: accepts tracks (evidence: `src/services/soundEngine.ts`)
