# chucapabra/dnd architecture

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

- Interactive diagram: https://gitdiagram.com/chucapabra/dnd
- Repository: https://github.com/chucapabra/dnd

## Overview

D&D Helper is a desktop character-management and rules-calculation program for a small group; the README explicitly says it is not for original D&D. The main workflow is using the WPF character screen to manage a character and obtain calculated stats, health, damage, inventory, and spell information, with character data persisted locally. The tree and source index also identify class/race configuration, skills, effects, a diary, and reference-book loading. Several connections below are dashed because the available excerpts do not show the relevant call sites; unsampled subsystems are represented at their exact directory paths.

Main entry points: [`Windows/Main.xaml.cs`](https://github.com/chucapabra/dnd/blob/main/Windows/Main.xaml.cs) (Character screen), [`Modules/Сharacteristics/GridCharacteristics.cs`](https://github.com/chucapabra/dnd/blob/main/Modules/%D0%A1haracteristics/GridCharacteristics.cs) (Stats grid), [`Modules/Config/PlayerClass.cs`](https://github.com/chucapabra/dnd/blob/main/Modules/Config/PlayerClass.cs) (Class and race), [`Modules/Inventory/InventoryLoot.cs`](https://github.com/chucapabra/dnd/blob/main/Modules/Inventory/InventoryLoot.cs) (Inventory and loot)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_main["Character screen<br/>[Main.xaml.cs]"]
  node_settings_ui["Settings window<br/>[Settings.xaml.cs]"]
  node_characteristics_ui["Stats grid"]
end

subgraph group_character["Character rules"]
  node_stats["Stat rules"]
  node_class_race["Class and race<br/>[PlayerClass.cs]"]
  node_skills["Skills and trees<br/>[Skills.cs]"]
  node_effects["Status effects<br/>[Effects.cs]"]
  node_health["Health and damage<br/>[Health.cs]"]
  node_damage_calc["Damage calculation"]
end

subgraph group_equipment["Items and spells"]
  node_inventory["Inventory and loot<br/>[InventoryLoot.cs]"]
  node_backpack["Backpack<br/>[Backpack.cs]"]
  node_spells["Spell management<br/>[MagicSpells.cs]"]
  node_spell_search["Spell search<br/>[MagicSearch.cs]"]
end

subgraph group_persistence["Data and configuration"]
  node_diary["Character diary<br/>[DiaryManager.cs]"]
  node_save_data[("Character saves<br/>[DataSave.cs]")]
  node_repositories["Rules repositories<br/>[SetRepository.cs]"]
  node_reference_books["Reference books"]
end

node_player(("Player"))

node_player -.->|"uses"| node_main
node_main -.->|"shows stats"| node_characteristics_ui
node_main -.->|"selects options"| node_class_race
node_main -.->|"manages skills"| node_skills
node_main -.->|"manages effects"| node_effects
node_main -.->|"shows health"| node_health
node_main -.->|"requests damage"| node_damage_calc
node_main -.->|"manages items"| node_inventory
node_main -.->|"manages spells"| node_spells
node_main -.->|"opens diary"| node_diary
node_main -.->|"loads references"| node_reference_books
node_characteristics_ui -.->|"uses stat rules"| node_stats
node_class_race -.->|"reloads skills"| node_skills
node_inventory -.->|"uses backpack"| node_backpack
node_spells -.->|"filters spells"| node_spell_search
node_main -.->|"loads and saves"| node_save_data
node_main -.->|"opens settings"| node_settings_ui
node_repositories -.->|"reads configuration"| node_save_data
node_reference_books -.->|"uses URLs"| node_repositories

click node_main "https://github.com/chucapabra/dnd/blob/main/Windows/Main.xaml.cs"
click node_settings_ui "https://github.com/chucapabra/dnd/blob/main/Windows/Settings.xaml.cs"
click node_characteristics_ui "https://github.com/chucapabra/dnd/blob/main/Modules/%D0%A1haracteristics/GridCharacteristics.cs"
click node_stats "https://github.com/chucapabra/dnd/blob/main/Modules/%D0%A1haracteristics/CharacteristicTable.cs"
click node_class_race "https://github.com/chucapabra/dnd/blob/main/Modules/Config/PlayerClass.cs"
click node_skills "https://github.com/chucapabra/dnd/blob/main/Modules/Character/Skills.cs"
click node_effects "https://github.com/chucapabra/dnd/blob/main/Modules/Character/Effects.cs"
click node_health "https://github.com/chucapabra/dnd/blob/main/Modules/Character/Health.cs"
click node_damage_calc "https://github.com/chucapabra/dnd/blob/main/Modules/Character/DamageCalculator.cs"
click node_inventory "https://github.com/chucapabra/dnd/blob/main/Modules/Inventory/InventoryLoot.cs"
click node_backpack "https://github.com/chucapabra/dnd/blob/main/Modules/Inventory/Backpack.cs"
click node_spells "https://github.com/chucapabra/dnd/blob/main/Modules/MagicSpells/MagicSpells.cs"
click node_spell_search "https://github.com/chucapabra/dnd/blob/main/Modules/MagicSpells/MagicSearch.cs"
click node_diary "https://github.com/chucapabra/dnd/blob/main/Modules/Diary/DiaryManager.cs"
click node_save_data "https://github.com/chucapabra/dnd/blob/main/Modules/Settings/DataSave.cs"
click node_repositories "https://github.com/chucapabra/dnd/blob/main/Modules/Settings/SetRepository.cs"
click node_reference_books "https://github.com/chucapabra/dnd/blob/main/Modules/ReferenceBooks/LoadingReferenceBook.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_settings_ui,node_characteristics_ui toneBlue
class node_stats,node_class_race,node_skills,node_effects,node_health,node_damage_calc toneAmber
class node_inventory,node_backpack,node_spells,node_spell_search toneMint
class node_diary,node_save_data,node_repositories,node_reference_books toneRose
class node_player toneIndigo
```

## Components

### Desktop interface

- [Character screen](https://github.com/chucapabra/dnd/blob/main/Windows/Main.xaml.cs): `Windows/Main.xaml.cs`
- [Settings window](https://github.com/chucapabra/dnd/blob/main/Windows/Settings.xaml.cs): `Windows/Settings.xaml.cs`
- [Stats grid](https://github.com/chucapabra/dnd/blob/main/Modules/%D0%A1haracteristics/GridCharacteristics.cs): `Modules/Сharacteristics/GridCharacteristics.cs`

### Character rules

- [Stat rules](https://github.com/chucapabra/dnd/blob/main/Modules/%D0%A1haracteristics/CharacteristicTable.cs): `Modules/Сharacteristics/CharacteristicTable.cs`
- [Class and race](https://github.com/chucapabra/dnd/blob/main/Modules/Config/PlayerClass.cs): `Modules/Config/PlayerClass.cs`
- [Skills and trees](https://github.com/chucapabra/dnd/blob/main/Modules/Character/Skills.cs): `Modules/Character/Skills.cs`
- [Status effects](https://github.com/chucapabra/dnd/blob/main/Modules/Character/Effects.cs): `Modules/Character/Effects.cs`
- [Health and damage](https://github.com/chucapabra/dnd/blob/main/Modules/Character/Health.cs): `Modules/Character/Health.cs`
- [Damage calculation](https://github.com/chucapabra/dnd/blob/main/Modules/Character/DamageCalculator.cs): `Modules/Character/DamageCalculator.cs`

### Items and spells

- [Inventory and loot](https://github.com/chucapabra/dnd/blob/main/Modules/Inventory/InventoryLoot.cs): `Modules/Inventory/InventoryLoot.cs`
- [Backpack](https://github.com/chucapabra/dnd/blob/main/Modules/Inventory/Backpack.cs): `Modules/Inventory/Backpack.cs`
- [Spell management](https://github.com/chucapabra/dnd/blob/main/Modules/MagicSpells/MagicSpells.cs): `Modules/MagicSpells/MagicSpells.cs`
- [Spell search](https://github.com/chucapabra/dnd/blob/main/Modules/MagicSpells/MagicSearch.cs): `Modules/MagicSpells/MagicSearch.cs`

### Data and configuration

- [Character diary](https://github.com/chucapabra/dnd/blob/main/Modules/Diary/DiaryManager.cs): `Modules/Diary/DiaryManager.cs`
- [Character saves](https://github.com/chucapabra/dnd/blob/main/Modules/Settings/DataSave.cs): `Modules/Settings/DataSave.cs`
- [Rules repositories](https://github.com/chucapabra/dnd/blob/main/Modules/Settings/SetRepository.cs): `Modules/Settings/SetRepository.cs`
- [Reference books](https://github.com/chucapabra/dnd/blob/main/Modules/ReferenceBooks/LoadingReferenceBook.cs): `Modules/ReferenceBooks/LoadingReferenceBook.cs`

### Other components

- **Player**

## Connections

- Player → Character screen: uses
- Character screen → Stats grid: shows stats (evidence: `Windows/Main.xaml.cs`)
- Character screen → Class and race: selects options (evidence: `Windows/Main.xaml.cs`)
- Character screen → Skills and trees: manages skills (evidence: `Windows/Main.xaml.cs`)
- Character screen → Status effects: manages effects (evidence: `Windows/Main.xaml.cs`)
- Character screen → Health and damage: shows health (evidence: `Windows/Main.xaml.cs`)
- Character screen → Damage calculation: requests damage (evidence: `Windows/Main.xaml.cs`)
- Character screen → Inventory and loot: manages items (evidence: `Windows/Main.xaml.cs`)
- Character screen → Spell management: manages spells (evidence: `Windows/Main.xaml.cs`)
- Character screen → Character diary: opens diary (evidence: `Windows/Main.xaml.cs`)
- Character screen → Reference books: loads references (evidence: `Windows/Main.xaml.cs`)
- Stats grid → Stat rules: uses stat rules (evidence: `Modules/Сharacteristics/GridCharacteristics.cs`)
- Class and race → Skills and trees: reloads skills (evidence: `Modules/Config/PlayerClass.cs`)
- Inventory and loot → Backpack: uses backpack
- Spell management → Spell search: filters spells (evidence: `Modules/MagicSpells/MagicSpells.cs`)
- Character screen → Character saves: loads and saves (evidence: `Windows/Main.xaml.cs`)
- Character screen → Settings window: opens settings
- Rules repositories → Character saves: reads configuration (evidence: `Modules/Settings/SetRepository.cs`)
- Reference books → Rules repositories: uses URLs (evidence: `Modules/ReferenceBooks/LoadingReferenceBook.cs`)
