# wieku/danser-go architecture

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

- Interactive diagram: https://gitdiagram.com/wieku/danser-go
- Repository: https://github.com/wieku/danser-go

## Overview

danser-go is a GUI/CLI osu!standard map visualizer and replay player that can record output to video. Its main workflow selects or imports a map, parses it, drives either generated cursor dance or replay/player input through the osu! ruleset, renders gameplay and overlays, and optionally encodes frames. The graph combines README capabilities with the shown excerpts and SOURCE INDEX references; some subsystems, notably launcher and performance-calculation internals, are represented by their exact enclosing paths because their implementation was not sampled.

Main entry points: [`app/states/player.go`](https://github.com/wieku/danser-go/blob/master/app/states/player.go) (Gameplay state), [`app/app.go`](https://github.com/wieku/danser-go/blob/master/app/app.go) (App runtime), [`app/rulesets/osu/ruleset.go`](https://github.com/wieku/danser-go/blob/master/app/rulesets/osu/ruleset.go) (Osu ruleset), [`app/beatmap/beatmap.go`](https://github.com/wieku/danser-go/blob/master/app/beatmap/beatmap.go) (Beatmap model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and setup"]
  node_launcher["GUI launcher"]
  node_app["App runtime<br/>[app.go]"]
end

subgraph group_maps["Maps and settings"]
  node_settings["Settings manager<br/>[manager.go]"]
  node_database[("Map database<br/>[manager.go]")]
  node_parser["Beatmap parser<br/>[parser.go]"]
  node_beatmap["Beatmap model<br/>[beatmap.go]"]
  node_skin["Skin assets<br/>[skin.go]"]
end

subgraph group_gameplay["Gameplay simulation"]
  node_replay["Replay controller<br/>[rcontroller.go]"]
  node_playercontrol["Live play input<br/>[pcontroller.go]"]
  node_dance["Cursor dance<br/>[controller.go]"]
  node_ruleset["Osu ruleset<br/>[ruleset.go]"]
  node_performance["Performance calculation"]
end

subgraph group_presentation["Rendering and output"]
  node_player["Gameplay state<br/>[player.go]"]
  node_graphics["Cursor rendering<br/>[cursor.go]"]
  node_overlays["Gameplay overlays"]
  node_storyboard["Storyboard<br/>[parser.go]"]
  node_recorder["Video recorder<br/>[video.go]"]
end

subgraph group_integrations["External services"]
  node_osuapi["osu! API client<br/>[api.go]"]
  node_ffmpeg["FFmpeg process"]
  node_osuservice["osu! service"]
end

node_user(("User"))

node_user -->|"starts GUI"| node_launcher
node_user -->|"runs CLI"| node_app
node_launcher -.->|"starts runtime"| node_app
node_app -->|"loads config"| node_settings
node_app -->|"updates maps"| node_database
node_app -->|"runs gameplay"| node_player
node_app -->|"starts recording"| node_recorder
node_database -->|"parses maps"| node_parser
node_parser -->|"builds model"| node_beatmap
node_player -->|"uses map"| node_beatmap
node_player -->|"selects replay control"| node_replay
node_player -->|"selects live control"| node_playercontrol
node_player -->|"selects dance control"| node_dance
node_replay -->|"updates judgments"| node_ruleset
node_playercontrol -->|"creates ruleset"| node_ruleset
node_dance -->|"schedules objects"| node_beatmap
node_dance -->|"creates cursors"| node_graphics
node_ruleset -->|"evaluates objects"| node_beatmap
node_ruleset -->|"calculates performance"| node_performance
node_player -->|"draws gameplay"| node_graphics
node_player -->|"uses components"| node_overlays
node_player -.->|"renders storyboard"| node_storyboard
node_player -->|"requests API data"| node_osuapi
node_osuapi -.->|"calls service"| node_osuservice
node_skin -->|"reads skin settings"| node_settings
node_recorder -->|"encodes frames"| node_ffmpeg

click node_launcher "https://github.com/wieku/danser-go/tree/master/launcher"
click node_app "https://github.com/wieku/danser-go/blob/master/app/app.go"
click node_settings "https://github.com/wieku/danser-go/blob/master/app/settings/manager.go"
click node_database "https://github.com/wieku/danser-go/blob/master/app/database/manager.go"
click node_parser "https://github.com/wieku/danser-go/blob/master/app/beatmap/parser.go"
click node_beatmap "https://github.com/wieku/danser-go/blob/master/app/beatmap/beatmap.go"
click node_skin "https://github.com/wieku/danser-go/blob/master/app/skin/skin.go"
click node_replay "https://github.com/wieku/danser-go/blob/master/app/dance/rcontroller.go"
click node_playercontrol "https://github.com/wieku/danser-go/blob/master/app/dance/pcontroller.go"
click node_dance "https://github.com/wieku/danser-go/blob/master/app/dance/controller.go"
click node_ruleset "https://github.com/wieku/danser-go/blob/master/app/rulesets/osu/ruleset.go"
click node_performance "https://github.com/wieku/danser-go/tree/master/app/rulesets/osu/performance"
click node_player "https://github.com/wieku/danser-go/blob/master/app/states/player.go"
click node_graphics "https://github.com/wieku/danser-go/blob/master/app/graphics/cursor.go"
click node_overlays "https://github.com/wieku/danser-go/tree/master/app/states/components/overlays"
click node_storyboard "https://github.com/wieku/danser-go/blob/master/app/storyboard/parser.go"
click node_recorder "https://github.com/wieku/danser-go/blob/master/app/ffmpeg/video.go"
click node_osuapi "https://github.com/wieku/danser-go/blob/master/app/osuapi/api.go"

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_launcher,node_app,node_user toneBlue
class node_settings,node_database,node_parser,node_beatmap,node_skin toneAmber
class node_replay,node_playercontrol,node_dance,node_ruleset,node_performance toneMint
class node_player,node_graphics,node_overlays,node_storyboard,node_recorder toneRose
class node_osuapi,node_ffmpeg,node_osuservice toneIndigo
```

## Components

### Entry and setup

- [GUI launcher](https://github.com/wieku/danser-go/tree/master/launcher): `launcher`
- [App runtime](https://github.com/wieku/danser-go/blob/master/app/app.go): `app/app.go`

### Maps and settings

- [Settings manager](https://github.com/wieku/danser-go/blob/master/app/settings/manager.go): `app/settings/manager.go`
- [Map database](https://github.com/wieku/danser-go/blob/master/app/database/manager.go): `app/database/manager.go`
- [Beatmap parser](https://github.com/wieku/danser-go/blob/master/app/beatmap/parser.go): `app/beatmap/parser.go`
- [Beatmap model](https://github.com/wieku/danser-go/blob/master/app/beatmap/beatmap.go): `app/beatmap/beatmap.go`
- [Skin assets](https://github.com/wieku/danser-go/blob/master/app/skin/skin.go): `app/skin/skin.go`

### Gameplay simulation

- [Replay controller](https://github.com/wieku/danser-go/blob/master/app/dance/rcontroller.go): `app/dance/rcontroller.go`
- [Live play input](https://github.com/wieku/danser-go/blob/master/app/dance/pcontroller.go): `app/dance/pcontroller.go`
- [Cursor dance](https://github.com/wieku/danser-go/blob/master/app/dance/controller.go): `app/dance/controller.go`
- [Osu ruleset](https://github.com/wieku/danser-go/blob/master/app/rulesets/osu/ruleset.go): `app/rulesets/osu/ruleset.go`
- [Performance calculation](https://github.com/wieku/danser-go/tree/master/app/rulesets/osu/performance): `app/rulesets/osu/performance`

### Rendering and output

- [Gameplay state](https://github.com/wieku/danser-go/blob/master/app/states/player.go): `app/states/player.go`
- [Cursor rendering](https://github.com/wieku/danser-go/blob/master/app/graphics/cursor.go): `app/graphics/cursor.go`
- [Gameplay overlays](https://github.com/wieku/danser-go/tree/master/app/states/components/overlays): `app/states/components/overlays`
- [Storyboard](https://github.com/wieku/danser-go/blob/master/app/storyboard/parser.go): `app/storyboard/parser.go`
- [Video recorder](https://github.com/wieku/danser-go/blob/master/app/ffmpeg/video.go): `app/ffmpeg/video.go`

### External services

- [osu! API client](https://github.com/wieku/danser-go/blob/master/app/osuapi/api.go): `app/osuapi/api.go`
- **FFmpeg process**
- **osu! service**

### Other components

- **User**

## Connections

- User → GUI launcher: starts GUI
- User → App runtime: runs CLI
- GUI launcher → App runtime: starts runtime
- App runtime → Settings manager: loads config (evidence: `app/app.go`)
- App runtime → Map database: updates maps (evidence: `app/app.go`)
- App runtime → Gameplay state: runs gameplay (evidence: `app/app.go`)
- App runtime → Video recorder: starts recording (evidence: `app/app.go`)
- Map database → Beatmap parser: parses maps (evidence: `app/database/manager.go`)
- Beatmap parser → Beatmap model: builds model (evidence: `app/beatmap/parser.go`)
- Gameplay state → Beatmap model: uses map (evidence: `app/states/player.go`)
- Gameplay state → Replay controller: selects replay control (evidence: `app/states/player.go`)
- Gameplay state → Live play input: selects live control (evidence: `app/states/player.go`)
- Gameplay state → Cursor dance: selects dance control (evidence: `app/states/player.go`)
- Replay controller → Osu ruleset: updates judgments (evidence: `app/dance/rcontroller.go`)
- Live play input → Osu ruleset: creates ruleset (evidence: `app/dance/pcontroller.go`)
- Cursor dance → Beatmap model: schedules objects (evidence: `app/dance/controller.go`)
- Cursor dance → Cursor rendering: creates cursors (evidence: `app/dance/controller.go`)
- Osu ruleset → Beatmap model: evaluates objects (evidence: `app/rulesets/osu/ruleset.go`)
- Osu ruleset → Performance calculation: calculates performance (evidence: `app/rulesets/osu/ruleset.go`)
- Gameplay state → Cursor rendering: draws gameplay (evidence: `app/states/player.go`)
- Gameplay state → Gameplay overlays: uses components (evidence: `app/states/player.go`)
- Gameplay state → Storyboard: renders storyboard
- Gameplay state → osu! API client: requests API data (evidence: `app/states/player.go`)
- osu! API client → osu! service: calls service
- Skin assets → Settings manager: reads skin settings (evidence: `app/skin/skin.go`)
- Video recorder → FFmpeg process: encodes frames (evidence: `app/ffmpeg/video.go`)
