# lvyww/paindutch architecture

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

- Interactive diagram: https://gitdiagram.com/lvyww/paindutch
- Repository: https://github.com/lvyww/paindutch

## Overview

Pain is a Windows typing-practice application: users practice supplied text, while the repository also contains article reading, standalone single-character practice, and trainer workflows. The excerpts support article loading, section navigation, filtering, and the JBS network client; they do not establish all wiring from the main window to typing evaluation, recording, or other integrations, so those connections are omitted. The README provides no additional capability details.

Main entry points: [`Article/ArticleManager.cs`](https://github.com/lvyww/paindutch/blob/main/Article/ArticleManager.cs) (Article manager), [`net/JBS.cs`](https://github.com/lvyww/paindutch/blob/main/net/JBS.cs) (JBS integration), [`MainWindow.xaml.cs`](https://github.com/lvyww/paindutch/blob/main/MainWindow.xaml.cs) (Main window), [`Article/ArticleConfig.cs`](https://github.com/lvyww/paindutch/blob/main/Article/ArticleConfig.cs) (Article settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_practice["Typing practice"]
  node_main["Main window<br/>[MainWindow.xaml.cs]"]
  node_state["Session state<br/>[StateManager.cs]"]
  node_config["App configuration<br/>[Config.cs]"]
  node_score["Typing scores<br/>[Score.cs]"]
  node_records["Session records<br/>[Recorder.cs]"]
end

subgraph group_articles["Article reading"]
  node_articleui["Article window<br/>[WinArticle.xaml.cs]"]
  node_articlemgr["Article manager<br/>[ArticleManager.cs]"]
  node_articleconfig["Article settings<br/>[ArticleConfig.cs]"]
  node_filter["Text filter<br/>[Filter.cs]"]
  node_textfiles["Article text files"]
end

subgraph group_training["Practice modes"]
  node_single["Single practice<br/>[winSingle.xaml.cs]"]
  node_trainer["Trainer<br/>[WinTrainer.xaml.cs]"]
  node_trainerconfig["Trainer settings<br/>[TrainerConfig.cs]"]
end

subgraph group_services["Comparison and services"]
  node_filecompare["File comparison<br/>[FileComparer.cs]"]
  node_diff["Diff engine<br/>[DiffTool.cs]"]
  node_jbs["JBS integration<br/>[JBS.cs]"]
  node_netutil["HTTP utilities<br/>[Util.cs]"]
end

node_user(("User"))
node_service(("JBS service"))

node_user -->|"uses"| node_main
node_articlemgr -->|"loads"| node_textfiles
node_articlemgr -->|"reads settings"| node_articleconfig
node_articlemgr -->|"filters text"| node_filter
node_articlemgr -->|"updates display"| node_main
node_jbs -->|"sends requests"| node_netutil
node_jbs -->|"requests articles and submits scores"| node_service

click node_main "https://github.com/lvyww/paindutch/blob/main/MainWindow.xaml.cs"
click node_state "https://github.com/lvyww/paindutch/blob/main/StateManager.cs"
click node_config "https://github.com/lvyww/paindutch/blob/main/Config.cs"
click node_score "https://github.com/lvyww/paindutch/blob/main/Score.cs"
click node_records "https://github.com/lvyww/paindutch/blob/main/Recorder.cs"
click node_articleui "https://github.com/lvyww/paindutch/blob/main/Article/WinArticle.xaml.cs"
click node_articlemgr "https://github.com/lvyww/paindutch/blob/main/Article/ArticleManager.cs"
click node_articleconfig "https://github.com/lvyww/paindutch/blob/main/Article/ArticleConfig.cs"
click node_filter "https://github.com/lvyww/paindutch/blob/main/Article/Filter.cs"
click node_single "https://github.com/lvyww/paindutch/blob/main/Single/winSingle.xaml.cs"
click node_trainer "https://github.com/lvyww/paindutch/blob/main/WinTrainer/WinTrainer.xaml.cs"
click node_trainerconfig "https://github.com/lvyww/paindutch/blob/main/WinTrainer/TrainerConfig.cs"
click node_filecompare "https://github.com/lvyww/paindutch/blob/main/FileComparer.cs"
click node_diff "https://github.com/lvyww/paindutch/blob/main/Diff/DiffTool.cs"
click node_jbs "https://github.com/lvyww/paindutch/blob/main/net/JBS.cs"
click node_netutil "https://github.com/lvyww/paindutch/blob/main/net/Util.cs"

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_state,node_config,node_score,node_records,node_user toneBlue
class node_articleui,node_articlemgr,node_articleconfig,node_filter,node_textfiles toneAmber
class node_single,node_trainer,node_trainerconfig toneMint
class node_filecompare,node_diff,node_jbs,node_netutil toneRose
class node_service toneIndigo
```

## Components

### Typing practice

- [Main window](https://github.com/lvyww/paindutch/blob/main/MainWindow.xaml.cs): `MainWindow.xaml.cs`
- [Session state](https://github.com/lvyww/paindutch/blob/main/StateManager.cs): `StateManager.cs`
- [App configuration](https://github.com/lvyww/paindutch/blob/main/Config.cs): `Config.cs`
- [Typing scores](https://github.com/lvyww/paindutch/blob/main/Score.cs): `Score.cs`
- [Session records](https://github.com/lvyww/paindutch/blob/main/Recorder.cs): `Recorder.cs`

### Article reading

- [Article window](https://github.com/lvyww/paindutch/blob/main/Article/WinArticle.xaml.cs): `Article/WinArticle.xaml.cs`
- [Article manager](https://github.com/lvyww/paindutch/blob/main/Article/ArticleManager.cs): `Article/ArticleManager.cs`
- [Article settings](https://github.com/lvyww/paindutch/blob/main/Article/ArticleConfig.cs): `Article/ArticleConfig.cs`
- [Text filter](https://github.com/lvyww/paindutch/blob/main/Article/Filter.cs): `Article/Filter.cs`
- **Article text files**

### Practice modes

- [Single practice](https://github.com/lvyww/paindutch/blob/main/Single/winSingle.xaml.cs): `Single/winSingle.xaml.cs`
- [Trainer](https://github.com/lvyww/paindutch/blob/main/WinTrainer/WinTrainer.xaml.cs): `WinTrainer/WinTrainer.xaml.cs`
- [Trainer settings](https://github.com/lvyww/paindutch/blob/main/WinTrainer/TrainerConfig.cs): `WinTrainer/TrainerConfig.cs`

### Comparison and services

- [File comparison](https://github.com/lvyww/paindutch/blob/main/FileComparer.cs): `FileComparer.cs`
- [Diff engine](https://github.com/lvyww/paindutch/blob/main/Diff/DiffTool.cs): `Diff/DiffTool.cs`
- [JBS integration](https://github.com/lvyww/paindutch/blob/main/net/JBS.cs): `net/JBS.cs`
- [HTTP utilities](https://github.com/lvyww/paindutch/blob/main/net/Util.cs): `net/Util.cs`

### Other components

- **User**
- **JBS service**

## Connections

- User → Main window: uses
- Article manager → Article text files: loads
- Article manager → Article settings: reads settings
- Article manager → Text filter: filters text
- Article manager → Main window: updates display
- JBS integration → HTTP utilities: sends requests
- JBS integration → JBS service: requests articles and submits scores
