# corentinleandre/soul architecture

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

- Interactive diagram: https://gitdiagram.com/corentinleandre/soul
- Repository: https://github.com/corentinleandre/soul

## Overview

Universal Tabletop System is a FoundryVTT system foundation for module developers. On initialization, it registers document classes, actor/item/combatant data models, and sheets; users then manage actors and items through data-driven sheets or use combat with player-assigned initiative. Its main domain stages are configuration, model-backed actor/item data, document behavior, sheet presentation, and combat tracking. The README also highlights expanded hooks. The graph reflects documented features and excerpted registration/call relationships; unsampled modules are included where their paths and roles are clear, without assuming their internal wiring.

Main entry points: [`soul.mjs`](https://github.com/corentinleandre/soul/blob/main/soul.mjs) (System Initialization), [`src/module/data/actor/base.mjs`](https://github.com/corentinleandre/soul/blob/main/src/module/data/actor/base.mjs) (Base Actor Model), [`src/module/apps/actor/actorSheet.mjs`](https://github.com/corentinleandre/soul/blob/main/src/module/apps/actor/actorSheet.mjs) (Actor Sheet), [`src/module/documents/SOULCombat.mjs`](https://github.com/corentinleandre/soul/blob/main/src/module/documents/SOULCombat.mjs) (Combat Document)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["System Runtime"]
  node_bootstrap["System Initialization<br/>[soul.mjs]"]
  node_configuration["System Configuration<br/>[_module.mjs]"]
  node_hooks["Extended Hooks<br/>[SOULCombat.mjs]"]
  node_actor_doc["Actor Document<br/>[SOULActor.mjs]"]
  node_item_doc["Item Document<br/>[SOULItem.mjs]"]
  node_other_docs["Other Documents"]
end

subgraph group_models["Data Models"]
  node_actor_model["Base Actor Model<br/>[base.mjs]"]
  node_stats["Actor Stats<br/>[stats.mjs]"]
  node_characteristics["Characteristics"]
  node_system_model["Model Mixins"]
  node_skill_model["Skill Model<br/>[skill.mjs]"]
  node_skill_values["Descending Values<br/>[descending.mjs]"]
  node_player_model["Player Combatant Model<br/>[player.mjs]"]
end

subgraph group_sheets["Sheets"]
  node_actor_sheet["Actor Sheet<br/>[actorSheet.mjs]"]
  node_item_sheet["Item Sheet<br/>[itemSheet.mjs]"]
  node_skill_sheet["Skill Sheet<br/>[skillSheet.mjs]"]
end

subgraph group_combat["Combat"]
  node_combat_doc["Combat Document<br/>[SOULCombat.mjs]"]
  node_combatant_doc["Combatant Document<br/>[SOULCombatant.mjs]"]
  node_combat_tracker["Combat Tracker"]
  node_combatant_hooks["Combatant Hooks<br/>[hooks.mjs]"]
end

node_foundry(("Foundry User"))

node_foundry -->|"initializes"| node_bootstrap
node_bootstrap -->|"loads"| node_configuration
node_bootstrap -->|"registers"| node_actor_doc
node_bootstrap -->|"registers"| node_item_doc
node_bootstrap -->|"registers"| node_other_docs
node_bootstrap -->|"registers"| node_actor_model
node_bootstrap -->|"registers"| node_skill_model
node_bootstrap -->|"registers"| node_player_model
node_bootstrap -->|"registers"| node_actor_sheet
node_bootstrap -->|"registers"| node_item_sheet
node_bootstrap -->|"registers"| node_skill_sheet
node_bootstrap -->|"registers"| node_combatant_hooks
node_actor_model -->|"mixes in"| node_stats
node_actor_model -->|"mixes in"| node_characteristics
node_stats -->|"extends"| node_system_model
node_characteristics -->|"extends"| node_system_model
node_skill_model -->|"mixes in"| node_skill_values
node_actor_sheet -->|"reads characteristics"| node_configuration
node_combat_doc -->|"uses schema"| node_player_model
node_combat_doc -->|"creates combatants"| node_combatant_doc
node_bootstrap -.->|"assigns tracker"| node_combat_tracker
node_foundry -.->|"manages actors"| node_actor_sheet
node_foundry -.->|"manages items"| node_item_sheet

click node_bootstrap "https://github.com/corentinleandre/soul/blob/main/soul.mjs"
click node_configuration "https://github.com/corentinleandre/soul/blob/main/src/module/config/_module.mjs"
click node_hooks "https://github.com/corentinleandre/soul/blob/main/src/module/documents/SOULCombat.mjs"
click node_actor_doc "https://github.com/corentinleandre/soul/blob/main/src/module/documents/SOULActor.mjs"
click node_item_doc "https://github.com/corentinleandre/soul/blob/main/src/module/documents/SOULItem.mjs"
click node_other_docs "https://github.com/corentinleandre/soul/tree/main/src/module/documents"
click node_actor_model "https://github.com/corentinleandre/soul/blob/main/src/module/data/actor/base.mjs"
click node_stats "https://github.com/corentinleandre/soul/blob/main/src/module/data/actor/components/stats.mjs"
click node_characteristics "https://github.com/corentinleandre/soul/blob/main/src/module/data/actor/components/characteristics.mjs"
click node_system_model "https://github.com/corentinleandre/soul/blob/main/src/module/data/abstract/system-data-model.mjs"
click node_skill_model "https://github.com/corentinleandre/soul/blob/main/src/module/data/item/skill.mjs"
click node_skill_values "https://github.com/corentinleandre/soul/blob/main/src/module/data/item/components/abstract/descending.mjs"
click node_player_model "https://github.com/corentinleandre/soul/blob/main/src/module/data/combatant/player.mjs"
click node_actor_sheet "https://github.com/corentinleandre/soul/blob/main/src/module/apps/actor/actorSheet.mjs"
click node_item_sheet "https://github.com/corentinleandre/soul/blob/main/src/module/apps/item/itemSheet.mjs"
click node_skill_sheet "https://github.com/corentinleandre/soul/blob/main/src/module/apps/item/skillSheet.mjs"
click node_combat_doc "https://github.com/corentinleandre/soul/blob/main/src/module/documents/SOULCombat.mjs"
click node_combatant_doc "https://github.com/corentinleandre/soul/blob/main/src/module/documents/SOULCombatant.mjs"
click node_combat_tracker "https://github.com/corentinleandre/soul/blob/main/src/module/apps/combat/SOULCombatTracker.mjs"
click node_combatant_hooks "https://github.com/corentinleandre/soul/blob/main/src/module/apps/combatant/hooks.mjs"

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_bootstrap,node_configuration,node_hooks,node_actor_doc,node_item_doc,node_other_docs,node_foundry toneBlue
class node_actor_model,node_stats,node_characteristics,node_system_model,node_skill_model,node_skill_values,node_player_model toneAmber
class node_actor_sheet,node_item_sheet,node_skill_sheet toneMint
class node_combat_doc,node_combatant_doc,node_combat_tracker,node_combatant_hooks toneRose
```

## Components

### System Runtime

- [System Initialization](https://github.com/corentinleandre/soul/blob/main/soul.mjs): `soul.mjs`
- [System Configuration](https://github.com/corentinleandre/soul/blob/main/src/module/config/_module.mjs): `src/module/config/_module.mjs`
- [Extended Hooks](https://github.com/corentinleandre/soul/blob/main/src/module/documents/SOULCombat.mjs): `src/module/documents/SOULCombat.mjs`
- [Actor Document](https://github.com/corentinleandre/soul/blob/main/src/module/documents/SOULActor.mjs): `src/module/documents/SOULActor.mjs`
- [Item Document](https://github.com/corentinleandre/soul/blob/main/src/module/documents/SOULItem.mjs): `src/module/documents/SOULItem.mjs`
- [Other Documents](https://github.com/corentinleandre/soul/tree/main/src/module/documents): `src/module/documents`

### Data Models

- [Base Actor Model](https://github.com/corentinleandre/soul/blob/main/src/module/data/actor/base.mjs): `src/module/data/actor/base.mjs`
- [Actor Stats](https://github.com/corentinleandre/soul/blob/main/src/module/data/actor/components/stats.mjs): `src/module/data/actor/components/stats.mjs`
- [Characteristics](https://github.com/corentinleandre/soul/blob/main/src/module/data/actor/components/characteristics.mjs): `src/module/data/actor/components/characteristics.mjs`
- [Model Mixins](https://github.com/corentinleandre/soul/blob/main/src/module/data/abstract/system-data-model.mjs): `src/module/data/abstract/system-data-model.mjs`
- [Skill Model](https://github.com/corentinleandre/soul/blob/main/src/module/data/item/skill.mjs): `src/module/data/item/skill.mjs`
- [Descending Values](https://github.com/corentinleandre/soul/blob/main/src/module/data/item/components/abstract/descending.mjs): `src/module/data/item/components/abstract/descending.mjs`
- [Player Combatant Model](https://github.com/corentinleandre/soul/blob/main/src/module/data/combatant/player.mjs): `src/module/data/combatant/player.mjs`

### Sheets

- [Actor Sheet](https://github.com/corentinleandre/soul/blob/main/src/module/apps/actor/actorSheet.mjs): `src/module/apps/actor/actorSheet.mjs`
- [Item Sheet](https://github.com/corentinleandre/soul/blob/main/src/module/apps/item/itemSheet.mjs): `src/module/apps/item/itemSheet.mjs`
- [Skill Sheet](https://github.com/corentinleandre/soul/blob/main/src/module/apps/item/skillSheet.mjs): `src/module/apps/item/skillSheet.mjs`

### Combat

- [Combat Document](https://github.com/corentinleandre/soul/blob/main/src/module/documents/SOULCombat.mjs): `src/module/documents/SOULCombat.mjs`
- [Combatant Document](https://github.com/corentinleandre/soul/blob/main/src/module/documents/SOULCombatant.mjs): `src/module/documents/SOULCombatant.mjs`
- [Combat Tracker](https://github.com/corentinleandre/soul/blob/main/src/module/apps/combat/SOULCombatTracker.mjs): `src/module/apps/combat/SOULCombatTracker.mjs`
- [Combatant Hooks](https://github.com/corentinleandre/soul/blob/main/src/module/apps/combatant/hooks.mjs): `src/module/apps/combatant/hooks.mjs`

### Other components

- **Foundry User**

## Connections

- Foundry User → System Initialization: initializes (evidence: `soul.mjs`)
- System Initialization → System Configuration: loads (evidence: `soul.mjs`)
- System Initialization → Actor Document: registers (evidence: `soul.mjs`)
- System Initialization → Item Document: registers (evidence: `soul.mjs`)
- System Initialization → Other Documents: registers (evidence: `soul.mjs`)
- System Initialization → Base Actor Model: registers (evidence: `soul.mjs`)
- System Initialization → Skill Model: registers (evidence: `soul.mjs`)
- System Initialization → Player Combatant Model: registers (evidence: `soul.mjs`)
- System Initialization → Actor Sheet: registers (evidence: `soul.mjs`)
- System Initialization → Item Sheet: registers (evidence: `soul.mjs`)
- System Initialization → Skill Sheet: registers (evidence: `soul.mjs`)
- System Initialization → Combatant Hooks: registers (evidence: `soul.mjs`)
- Base Actor Model → Actor Stats: mixes in (evidence: `src/module/data/actor/base.mjs`)
- Base Actor Model → Characteristics: mixes in (evidence: `src/module/data/actor/base.mjs`)
- Actor Stats → Model Mixins: extends (evidence: `src/module/data/actor/components/stats.mjs`)
- Characteristics → Model Mixins: extends (evidence: `src/module/data/actor/components/characteristics.mjs`)
- Skill Model → Descending Values: mixes in (evidence: `src/module/data/item/skill.mjs`)
- Actor Sheet → System Configuration: reads characteristics (evidence: `src/module/apps/actor/actorSheet.mjs`)
- Combat Document → Player Combatant Model: uses schema (evidence: `src/module/documents/SOULCombat.mjs`)
- Combat Document → Combatant Document: creates combatants (evidence: `src/module/documents/SOULCombat.mjs`)
- System Initialization → Combat Tracker: assigns tracker
- Foundry User → Actor Sheet: manages actors
- Foundry User → Item Sheet: manages items
