# elicoggins/keyboardwarrior architecture

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

- Interactive diagram: https://gitdiagram.com/elicoggins/keyboardwarrior
- Repository: https://github.com/elicoggins/keyboardwarrior

## Overview

Keyboard Warrior is a rhythm-typing game: players choose a chart, type its note letters in time with the music, and can calibrate timing or practice a selected section. Its library can use local songs or optional Chorus Encore downloads; settings and scores remain local. The supplied tree contains the browser demo and bundled song assets, but no Rust source excerpts, so most internal components and their links are documented at capability level rather than verified from implementation.

Main entry points: [`docs/index.html`](https://github.com/elicoggins/keyboardwarrior/blob/main/docs/index.html) (Game interface), [`docs/songs`](https://github.com/elicoggins/keyboardwarrior/tree/main/docs/songs) (Bundled charts), [`docs/keyboardwarrior.wasm`](https://github.com/elicoggins/keyboardwarrior/blob/main/docs/keyboardwarrior.wasm) (WASM game), [`docs/kw_audio.js`](https://github.com/elicoggins/keyboardwarrior/blob/main/docs/kw_audio.js) (Web audio)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Play and practice"]
  node_chart_load["Chart loading"]
  node_gameplay["Rhythm gameplay"]
  node_timing["Timing calibration"]
  node_practice["Practice mode"]
end

subgraph group_library["Song library"]
  node_song_menu["Song menu"]
  node_library_scan["Song library"]
  node_song_files["Bundled charts"]
  node_folders["Song folders"]
  node_chorus_search["Chorus search"]
end

subgraph group_runtime["App runtime"]
  node_app["Game interface<br/>[index.html]"]
  node_wasm["WASM game"]
  node_audio["Web audio<br/>[kw_audio.js]"]
  node_local_state[("Settings and scores")]
  node_version_check["Version check"]
end

node_player(("Player"))
node_chorus["Chorus Encore"]
node_update_service["Version service"]

node_player -->|"uses"| node_app
node_app -->|"runs demo"| node_wasm
node_player -->|"selects song"| node_song_menu
node_song_menu -->|"browses"| node_library_scan
node_library_scan -->|"reads charts"| node_song_files
node_library_scan -->|"reads folders"| node_folders
node_player -->|"searches charts"| node_chorus_search
node_chorus_search -->|"searches and downloads"| node_chorus
node_chorus_search -->|"refreshes library"| node_library_scan
node_player -->|"starts song"| node_chart_load
node_song_menu -->|"starts selected chart"| node_chart_load
node_chart_load -.->|"loads for play"| node_gameplay
node_player -->|"types notes"| node_gameplay
node_gameplay -->|"plays audio"| node_audio
node_player -->|"calibrates"| node_timing
node_player -->|"selects sections"| node_practice
node_player -->|"configures and scores"| node_local_state
node_app -->|"checks version"| node_version_check
node_version_check -->|"checks updates"| node_update_service

click node_app "https://github.com/elicoggins/keyboardwarrior/blob/main/docs/index.html"
click node_wasm "https://github.com/elicoggins/keyboardwarrior/blob/main/docs/keyboardwarrior.wasm"
click node_audio "https://github.com/elicoggins/keyboardwarrior/blob/main/docs/kw_audio.js"
click node_song_files "https://github.com/elicoggins/keyboardwarrior/tree/main/docs/songs"

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_chart_load,node_gameplay,node_timing,node_practice toneBlue
class node_song_menu,node_library_scan,node_song_files,node_folders,node_chorus_search toneAmber
class node_app,node_wasm,node_audio,node_local_state,node_version_check toneMint
class node_player,node_chorus,node_update_service toneIndigo
```

## Components

### Play and practice

- **Chart loading**
- **Rhythm gameplay**
- **Timing calibration**
- **Practice mode**

### Song library

- **Song menu**
- **Song library**
- [Bundled charts](https://github.com/elicoggins/keyboardwarrior/tree/main/docs/songs): `docs/songs`
- **Song folders**
- **Chorus search**

### App runtime

- [Game interface](https://github.com/elicoggins/keyboardwarrior/blob/main/docs/index.html): `docs/index.html`
- [WASM game](https://github.com/elicoggins/keyboardwarrior/blob/main/docs/keyboardwarrior.wasm): `docs/keyboardwarrior.wasm`
- [Web audio](https://github.com/elicoggins/keyboardwarrior/blob/main/docs/kw_audio.js): `docs/kw_audio.js`
- **Settings and scores**
- **Version check**

### Other components

- **Player**
- **Chorus Encore**
- **Version service**

## Connections

- Player → Game interface: uses (evidence: `README.md`)
- Game interface → WASM game: runs demo (evidence: `README.md`)
- Player → Song menu: selects song (evidence: `README.md`)
- Song menu → Song library: browses (evidence: `README.md`)
- Song library → Bundled charts: reads charts (evidence: `README.md`)
- Song library → Song folders: reads folders (evidence: `README.md`)
- Player → Chorus search: searches charts (evidence: `README.md`)
- Chorus search → Chorus Encore: searches and downloads (evidence: `README.md`)
- Chorus search → Song library: refreshes library (evidence: `README.md`)
- Player → Chart loading: starts song (evidence: `README.md`)
- Song menu → Chart loading: starts selected chart (evidence: `README.md`)
- Chart loading → Rhythm gameplay: loads for play
- Player → Rhythm gameplay: types notes (evidence: `README.md`)
- Rhythm gameplay → Web audio: plays audio (evidence: `README.md`)
- Player → Timing calibration: calibrates (evidence: `README.md`)
- Player → Practice mode: selects sections (evidence: `README.md`)
- Player → Settings and scores: configures and scores (evidence: `README.md`)
- Game interface → Version check: checks version (evidence: `README.md`)
- Version check → Version service: checks updates (evidence: `README.md`)
