# imxder/chordai architecture

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

- Interactive diagram: https://gitdiagram.com/imxder/chordai
- Repository: https://github.com/imxder/chordai

## Overview

ChordAI is a Flutter guitar-learning app whose documented headline feature is real-time chord recognition backed by a Python/TensorFlow/Librosa service. The tree also shows practice, tuner, chord-list, lyric-sheet, score, achievement, and settings areas, plus local score and lyric assets. Dart implementation details were not sampled, so internal screen-to-service relationships are shown only as unverified dashed links; no Python backend source is present in the tree. The Windows runner is included as the Flutter host, not as a product feature.

Main entry points: [`lib/main.dart`](https://github.com/imxder/chordai/blob/master/lib/main.dart) (App entry), [`windows/runner/flutter_window.cpp`](https://github.com/imxder/chordai/blob/master/windows/runner/flutter_window.cpp) (Flutter window), [`lib/services/lyric_sheet_library.dart`](https://github.com/imxder/chordai/blob/master/lib/services/lyric_sheet_library.dart) (Lyric library), [`lib/screens/chord_practice_screen.dart`](https://github.com/imxder/chordai/blob/master/lib/screens/chord_practice_screen.dart) (Chord practice)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Flutter app"]
  node_app_entry["App entry<br/>[main.dart]"]
  node_app_state["App state<br/>[app_state.dart]"]
  node_settings["Settings"]
  node_achievements["Achievements"]
end

subgraph group_learning["Learning content"]
  node_chord_list["Chord list"]
  node_chord_practice["Chord practice"]
  node_practice_session["Practice session"]
  node_score_library["Score library<br/>[score_library.dart]"]
  node_score_assets["Score assets"]
  node_lyric_library["Lyric library"]
  node_lyric_list["Lyric sheets"]
  node_lyric_view["Lyric view"]
  node_lyric_assets["Lyric assets"]
end

subgraph group_sensing["Audio tools"]
  node_chord_recognition["Chord recognition"]
  node_chord_prediction["Chord prediction"]
  node_tuner["Tuner screen<br/>[tuner_screen.dart]"]
  node_tuner_service["Tuner service<br/>[tuner_service.dart]"]
  node_pitch_detector["Pitch detector"]
  node_metronome["Metronome<br/>[metronome.dart]"]
  node_guitar_neck["Guitar neck<br/>[guitar_neck.dart]"]
end

subgraph group_host["Platform host"]
  node_windows_runner["Windows runner<br/>[main.cpp]"]
  node_flutter_window["Flutter window<br/>[flutter_window.cpp]"]
  node_win32_window["Win32 window<br/>[win32_window.cpp]"]
  node_plugin_registrar["Plugin registrar"]
end

node_learner(("Learner"))
node_recognition_backend["Recognition backend"]

node_learner -->|"uses"| node_app_entry
node_app_entry -.->|"opens"| node_chord_list
node_app_entry -.->|"opens"| node_chord_practice
node_app_entry -.->|"opens"| node_practice_session
node_app_entry -.->|"opens"| node_lyric_list
node_app_entry -.->|"opens"| node_tuner
node_app_entry -.->|"opens"| node_settings
node_app_entry -.->|"opens"| node_achievements
node_chord_practice -.->|"uses"| node_chord_recognition
node_chord_recognition -->|"sends audio"| node_recognition_backend
node_recognition_backend -.->|"returns prediction"| node_chord_prediction
node_tuner -.->|"uses"| node_tuner_service
node_tuner_service -.->|"uses"| node_pitch_detector
node_lyric_list -.->|"loads"| node_lyric_library
node_lyric_view -.->|"loads"| node_lyric_library
node_score_library -.->|"loads"| node_score_assets
node_lyric_library -.->|"loads"| node_lyric_assets
node_learner -.->|"launches"| node_windows_runner
node_windows_runner -->|"creates"| node_flutter_window
node_flutter_window -->|"inherits"| node_win32_window
node_flutter_window -->|"registers plugins"| node_plugin_registrar

click node_app_entry "https://github.com/imxder/chordai/blob/master/lib/main.dart"
click node_app_state "https://github.com/imxder/chordai/blob/master/lib/state/app_state.dart"
click node_settings "https://github.com/imxder/chordai/blob/master/lib/screens/settings_screen.dart"
click node_achievements "https://github.com/imxder/chordai/blob/master/lib/screens/achievements_screen.dart"
click node_chord_list "https://github.com/imxder/chordai/blob/master/lib/screens/chord_list_screen.dart"
click node_chord_practice "https://github.com/imxder/chordai/blob/master/lib/screens/chord_practice_screen.dart"
click node_practice_session "https://github.com/imxder/chordai/blob/master/lib/screens/practice_session_screen.dart"
click node_score_library "https://github.com/imxder/chordai/blob/master/lib/services/score_library.dart"
click node_score_assets "https://github.com/imxder/chordai/tree/master/assets/scores"
click node_lyric_library "https://github.com/imxder/chordai/blob/master/lib/services/lyric_sheet_library.dart"
click node_lyric_list "https://github.com/imxder/chordai/blob/master/lib/screens/lyric_sheet_list_screen.dart"
click node_lyric_view "https://github.com/imxder/chordai/blob/master/lib/screens/lyric_sheet_screen.dart"
click node_lyric_assets "https://github.com/imxder/chordai/tree/master/assets/lyrics"
click node_chord_recognition "https://github.com/imxder/chordai/blob/master/lib/services/chord_recognition_service.dart"
click node_chord_prediction "https://github.com/imxder/chordai/blob/master/lib/models/chord_prediction.dart"
click node_tuner "https://github.com/imxder/chordai/blob/master/lib/screens/tuner_screen.dart"
click node_tuner_service "https://github.com/imxder/chordai/blob/master/lib/services/tuner_service.dart"
click node_pitch_detector "https://github.com/imxder/chordai/blob/master/lib/services/pitch_detector.dart"
click node_metronome "https://github.com/imxder/chordai/blob/master/lib/widgets/metronome.dart"
click node_guitar_neck "https://github.com/imxder/chordai/blob/master/lib/widgets/guitar_neck.dart"
click node_windows_runner "https://github.com/imxder/chordai/blob/master/windows/runner/main.cpp"
click node_flutter_window "https://github.com/imxder/chordai/blob/master/windows/runner/flutter_window.cpp"
click node_win32_window "https://github.com/imxder/chordai/blob/master/windows/runner/win32_window.cpp"
click node_plugin_registrar "https://github.com/imxder/chordai/blob/master/windows/flutter/generated_plugin_registrant.cc"

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_app_entry,node_app_state,node_settings,node_achievements toneBlue
class node_chord_list,node_chord_practice,node_practice_session,node_score_library,node_score_assets,node_lyric_library,node_lyric_list,node_lyric_view,node_lyric_assets toneAmber
class node_chord_recognition,node_chord_prediction,node_tuner,node_tuner_service,node_pitch_detector,node_metronome,node_guitar_neck toneMint
class node_windows_runner,node_flutter_window,node_win32_window,node_plugin_registrar toneRose
class node_learner,node_recognition_backend toneIndigo
```

## Components

### Flutter app

- [App entry](https://github.com/imxder/chordai/blob/master/lib/main.dart): `lib/main.dart`
- [App state](https://github.com/imxder/chordai/blob/master/lib/state/app_state.dart): `lib/state/app_state.dart`
- [Settings](https://github.com/imxder/chordai/blob/master/lib/screens/settings_screen.dart): `lib/screens/settings_screen.dart`
- [Achievements](https://github.com/imxder/chordai/blob/master/lib/screens/achievements_screen.dart): `lib/screens/achievements_screen.dart`

### Learning content

- [Chord list](https://github.com/imxder/chordai/blob/master/lib/screens/chord_list_screen.dart): `lib/screens/chord_list_screen.dart`
- [Chord practice](https://github.com/imxder/chordai/blob/master/lib/screens/chord_practice_screen.dart): `lib/screens/chord_practice_screen.dart`
- [Practice session](https://github.com/imxder/chordai/blob/master/lib/screens/practice_session_screen.dart): `lib/screens/practice_session_screen.dart`
- [Score library](https://github.com/imxder/chordai/blob/master/lib/services/score_library.dart): `lib/services/score_library.dart`
- [Score assets](https://github.com/imxder/chordai/tree/master/assets/scores): `assets/scores`
- [Lyric library](https://github.com/imxder/chordai/blob/master/lib/services/lyric_sheet_library.dart): `lib/services/lyric_sheet_library.dart`
- [Lyric sheets](https://github.com/imxder/chordai/blob/master/lib/screens/lyric_sheet_list_screen.dart): `lib/screens/lyric_sheet_list_screen.dart`
- [Lyric view](https://github.com/imxder/chordai/blob/master/lib/screens/lyric_sheet_screen.dart): `lib/screens/lyric_sheet_screen.dart`
- [Lyric assets](https://github.com/imxder/chordai/tree/master/assets/lyrics): `assets/lyrics`

### Audio tools

- [Chord recognition](https://github.com/imxder/chordai/blob/master/lib/services/chord_recognition_service.dart): `lib/services/chord_recognition_service.dart`
- [Chord prediction](https://github.com/imxder/chordai/blob/master/lib/models/chord_prediction.dart): `lib/models/chord_prediction.dart`
- [Tuner screen](https://github.com/imxder/chordai/blob/master/lib/screens/tuner_screen.dart): `lib/screens/tuner_screen.dart`
- [Tuner service](https://github.com/imxder/chordai/blob/master/lib/services/tuner_service.dart): `lib/services/tuner_service.dart`
- [Pitch detector](https://github.com/imxder/chordai/blob/master/lib/services/pitch_detector.dart): `lib/services/pitch_detector.dart`
- [Metronome](https://github.com/imxder/chordai/blob/master/lib/widgets/metronome.dart): `lib/widgets/metronome.dart`
- [Guitar neck](https://github.com/imxder/chordai/blob/master/lib/widgets/guitar_neck.dart): `lib/widgets/guitar_neck.dart`

### Platform host

- [Windows runner](https://github.com/imxder/chordai/blob/master/windows/runner/main.cpp): `windows/runner/main.cpp`
- [Flutter window](https://github.com/imxder/chordai/blob/master/windows/runner/flutter_window.cpp): `windows/runner/flutter_window.cpp`
- [Win32 window](https://github.com/imxder/chordai/blob/master/windows/runner/win32_window.cpp): `windows/runner/win32_window.cpp`
- [Plugin registrar](https://github.com/imxder/chordai/blob/master/windows/flutter/generated_plugin_registrant.cc): `windows/flutter/generated_plugin_registrant.cc`

### Other components

- **Learner**
- **Recognition backend**

## Connections

- Learner → App entry: uses (evidence: `README.md`)
- App entry → Chord list: opens
- App entry → Chord practice: opens
- App entry → Practice session: opens
- App entry → Lyric sheets: opens
- App entry → Tuner screen: opens
- App entry → Settings: opens
- App entry → Achievements: opens
- Chord practice → Chord recognition: uses
- Chord recognition → Recognition backend: sends audio (evidence: `README.md`)
- Recognition backend → Chord prediction: returns prediction
- Tuner screen → Tuner service: uses
- Tuner service → Pitch detector: uses
- Lyric sheets → Lyric library: loads
- Lyric view → Lyric library: loads
- Score library → Score assets: loads
- Lyric library → Lyric assets: loads
- Learner → Windows runner: launches
- Windows runner → Flutter window: creates (evidence: `windows/runner/main.cpp`)
- Flutter window → Win32 window: inherits
- Flutter window → Plugin registrar: registers plugins (evidence: `windows/runner/flutter_window.cpp`)
