# pathofbuildingcommunity/pathofbuilding architecture

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

- Interactive diagram: https://gitdiagram.com/pathofbuildingcommunity/pathofbuilding
- Repository: https://github.com/pathofbuildingcommunity/pathofbuilding

## Overview

1. This repository is a standalone desktop application: an offline build planner for Path of Exile called Path of Building Community. The shipped product is not a browser app; it is a Lua application packaged with a bundled Windows runtime and launcher binaries in `runtime/` plus install/update support.

2. The core runtime is organized around a custom UI framework in `src/Classes`. These files define reusable controls, tab views, dialogs, lists, sliders, tooltips, and tree/item-specific widgets. The UI is stateful and event-driven, with the major screens implemented as tab classes such as `TreeTab`, `SkillsTab`, `ItemsTab`, `CalcsTab`, `ImportTab`, `ConfigTab`, and `NotesTab`.

3. Application behavior and domain logic live in `src/Modules`. This is the main orchestration layer: build state, calculation pipelines, import/export helpers, stat description formatting, configuration, mod parsing, item tools, and notifications. `src/Modules/Main.lua` is the top-level entry point for the app logic, while `Build.lua` and the `Calc*` modules are the main computational boundary.

4. The central data model is a “build” composed of passive tree choices, equipped items, skill gems, and configuration. The UI edits this model; the calculation modules read it to derive offense, defense, trigger behavior, resource reservation, and other derived stats. The calculations are split by concern into offense, defense, triggers, active skills, breakdowns, and setup.

5. Static game knowledge is stored in `src/Data`. This includes item bases, uniques, modifiers, gems, bosses, minions, pantheons, tattoos, cluster jewels, essences, stat description tables, and numerous game-version-specific lookup tables. These tables are the canonical source for parsing items and skills and for translating raw modifiers into meaningful stats.

6. The passive skill tree is versioned separately in `src/TreeData`. Each game version and variant has its own tree file, with special variants for Ruthless and Alternate. This boundary matters because tree layout, node ids, sprites, and ascendancy positions change by version, so tree rendering and node lookup are data-driven rather than hardcoded.

7. Tree import/export and external data generation are handled by the `src/Export` subsystem. It produces text/Lua assets for bases, skills, bosses, minions, passives, stat descriptions, and GGPK/tree-related data. This looks like a build-time content pipeline that converts raw game data into the normalized tables consumed by the app.

8. Item handling is a major subsystem. Item parsing, crafting templates, unique databases, rare item templates, socketed gem effects, and mod resolution are all coordinated through `ItemsTab`, `Item`/`ItemTools`, and the mod database classes. The app supports importing pasted item text and then feeds those parsed items into the same build model used by calculators.

9. Skill handling is parallel to item handling. Skills and supports are represented in data tables and UI controls, then merged into the build model so calculations can account for linked supports, auras, curses, buffs, minions, and socket-inherited modifiers. The app also models gem-granted supports from items.

10. The import surface includes passive tree links, character import, item paste import, and build share codes. These inputs enter through the import/UI layer, are normalized into build state, and then recomputed by the calculation engine. This creates a clear flow: external source data → parsed build state → recalculated stats → displayed breakdowns.

11. Trade integration is present as its own set of classes: `TradeQuery`, `TradeQueryGenerator`, `TradeQueryRateLimiter`, and `TradeQueryRequests`. This boundary suggests the app can generate and send queries to the Path of Exile trade ecosystem, then use returned results to suggest impactful upgrades inside the item planner.

12. The bundled runtime under `runtime/` includes the executable, update binary, font assets, Lua libraries, and a custom graphics layer (`SimpleGraphic`). That means rendering, text, and UI controls are part of the packaged desktop environment rather than relying on a system browser or standard game engine.

13. Update and release automation is first-class. `UpdateCheck`, `UpdateApply`, `LaunchInstall`, `Dockerfile`, `docker-compose.yml`, and GitHub Actions workflows support automatic updates, build packaging, and release generation. The application is designed to self-update and to be distributed as both installer and portable builds.

14. Verification is split between Lua specs and a small Python test. `spec/` uses Busted for system-level coverage of builds, skills, items, triggers, trade queries, and calculations, while `tests/test_fix_ascendancy_positions.py` covers a maintenance script. This makes the test boundary centered on deterministic game-data and calculation behavior rather than UI rendering.

15. For an architecture diagram, the most important high-level boundaries are: bundled runtime/UI, build state, calculation engine, static game-data tables, versioned passive-tree assets, import/trade/update integrations, and export/tooling pipelines. The app’s core loop is “load data → edit build in UI → recalculate derived stats → show breakdowns / import or export data.”

Main entry points: [`src/Modules/Build.lua`](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Modules/Build.lua) (Build model), [`src/Modules/Calcs.lua`](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Modules/Calcs.lua) (Calc engine), [`src/Modules/Main.lua`](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Modules/Main.lua) (Main), [`src/Classes/TreeTab.lua`](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Classes/TreeTab.lua) (Build tabs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime_ui["Bundled runtime & UI"]
  node_launch["Launch<br/>desktop bootstrap<br/>[Launch.lua]"]
  node_runtime[("Runtime<br/>bundled binaries")]
  node_ui_core["UI core<br/>Lua controls<br/>[Control.lua]"]
  node_build_tabs["Build tabs<br/>screen widgets<br/>[TreeTab.lua]"]
  node_trade_ui["Trade UI<br/>query widgets<br/>[TradeQuery.lua]"]
end

subgraph group_core_logic["Build logic & calculations"]
  node_main_mod["Main<br/>app orchestrator<br/>[Main.lua]"]
  node_build_model[("Build model<br/>state model<br/>[Build.lua]")]
  node_calc_engine["Calc engine<br/>derived stats<br/>[Calcs.lua]"]
  node_calc_offence["Offence<br/>damage calc<br/>[CalcOffence.lua]"]
  node_calc_defence["Defence<br/>mitigation calc<br/>[CalcDefence.lua]"]
  node_calc_triggers["Triggers<br/>proc calc<br/>[CalcTriggers.lua]"]
  node_item_tools["Items<br/>item parsing<br/>[ItemTools.lua]"]
  node_mod_tools["Mods<br/>mod parser<br/>[ModParser.lua]"]
end

subgraph group_game_data["Static game data"]
  node_data_tables[("Game data<br/>canonical tables<br/>[Global.lua]")]
  node_tree_data[("Tree data<br/>versioned assets<br/>[tree.lua]")]
end

subgraph group_pipelines["Import, export & updates"]
  node_export_pipeline["Export<br/>content pipeline<br/>[Main.lua]"]
  node_import_surface["Import<br/>ingest flow<br/>[ImportTab.lua]"]
  node_update_flow["Updates<br/>release tooling<br/>[UpdateCheck.lua]"]
end

subgraph group_verification["Verification"]
  node_specs["Specs<br/>busted tests"]
  node_py_maint["Maintenance test<br/>python test"]
end

node_runtime -->|"executes"| node_launch
node_launch -->|"boots"| node_main_mod
node_main_mod -->|"builds"| node_ui_core
node_main_mod -->|"opens"| node_build_tabs
node_main_mod -->|"owns"| node_build_model
node_build_tabs -->|"edits"| node_build_model
node_ui_core -->|"renders"| node_build_tabs
node_build_model -->|"feeds"| node_calc_engine
node_calc_engine -->|"delegates"| node_calc_offence
node_calc_engine -->|"delegates"| node_calc_defence
node_calc_engine -->|"delegates"| node_calc_triggers
node_build_model -->|"contains"| node_item_tools
node_item_tools -->|"resolves"| node_mod_tools
node_mod_tools -->|"reads"| node_data_tables
node_build_model -->|"uses"| node_tree_data
node_import_surface -->|"imports"| node_build_model
node_trade_ui -->|"suggests"| node_item_tools
node_export_pipeline -->|"generates from"| node_data_tables
node_export_pipeline -->|"generates from"| node_tree_data
node_update_flow -->|"updates"| node_runtime
node_specs -.->|"verifies"| node_calc_engine
node_py_maint -.->|"checks"| node_tree_data

click node_launch "https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Launch.lua"
click node_runtime "https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/runtime/Path{space}of{space}Building.exe"
click node_ui_core "https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Classes/Control.lua"
click node_build_tabs "https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Classes/TreeTab.lua"
click node_trade_ui "https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Classes/TradeQuery.lua"
click node_main_mod "https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Modules/Main.lua"
click node_build_model "https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Modules/Build.lua"
click node_calc_engine "https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Modules/Calcs.lua"
click node_calc_offence "https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Modules/CalcOffence.lua"
click node_calc_defence "https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Modules/CalcDefence.lua"
click node_calc_triggers "https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Modules/CalcTriggers.lua"
click node_item_tools "https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Modules/ItemTools.lua"
click node_mod_tools "https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Modules/ModParser.lua"
click node_data_tables "https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Data/Global.lua"
click node_tree_data "https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/TreeData/3_28/tree.lua"
click node_export_pipeline "https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Export/Main.lua"
click node_import_surface "https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Classes/ImportTab.lua"
click node_update_flow "https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/UpdateCheck.lua"
click node_specs "https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/spec/System/TestBuilds_spec.lua"
click node_py_maint "https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/tests/test_fix_ascendancy_positions.py"

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_launch,node_runtime,node_ui_core,node_build_tabs,node_trade_ui toneBlue
class node_main_mod,node_build_model,node_calc_engine,node_calc_offence,node_calc_defence,node_calc_triggers,node_item_tools,node_mod_tools toneAmber
class node_data_tables,node_tree_data toneMint
class node_export_pipeline,node_import_surface,node_update_flow toneRose
class node_specs,node_py_maint toneIndigo
```

## Components

### Bundled runtime & UI

Packaged desktop runtime plus the stateful Lua UI layer.

- [Launch](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Launch.lua): desktop bootstrap · Starts the packaged app and hands off into the Lua application. · `src/Launch.lua`
- [Runtime](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/runtime/Path{space}of{space}Building.exe): bundled binaries · Windows executable, update binary, Lua libraries, fonts, and SimpleGraphic runtime. · `runtime/Path{space}of{space}Building.exe`
- [UI core](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Classes/Control.lua): Lua controls · Reusable controls, dialogs, layout, and event-hosting primitives. · `src/Classes/Control.lua`
- [Build tabs](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Classes/TreeTab.lua): screen widgets · Main stateful screens for tree, skills, items, calcs, import, config, and notes. · `src/Classes/TreeTab.lua`
- [Trade UI](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Classes/TradeQuery.lua): query widgets · Trade query generation, throttling, requests, and results integration. · `src/Classes/TradeQuery.lua`

### Build logic & calculations

Build state, orchestration, and derived-stat pipelines.

- [Main](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Modules/Main.lua): app orchestrator · Top-level application logic and coordination entry point. · `src/Modules/Main.lua`
- [Build model](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Modules/Build.lua): state model · Central build state for passive tree, items, skills, and config. · `src/Modules/Build.lua`
- [Calc engine](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Modules/Calcs.lua): derived stats · Orchestrates offense, defence, triggers, setup, sections, and breakdowns. · `src/Modules/Calcs.lua`
- [Offence](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Modules/CalcOffence.lua): damage calc · Offence and active-skill damage calculations. · `src/Modules/CalcOffence.lua`
- [Defence](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Modules/CalcDefence.lua): mitigation calc · Defence, resource, and survivability calculations. · `src/Modules/CalcDefence.lua`
- [Triggers](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Modules/CalcTriggers.lua): proc calc · Trigger behavior, mirages, and proc-driven skill interactions. · `src/Modules/CalcTriggers.lua`
- [Items](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Modules/ItemTools.lua): item parsing · Item parsing, templates, mod resolution, and item-specific tools. · `src/Modules/ItemTools.lua`
- [Mods](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Modules/ModParser.lua): mod parser · Modifier parsing, stat tools, and representation helpers. · `src/Modules/ModParser.lua`

### Static game data

Canonical tables and versioned tree assets.

- [Game data](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Data/Global.lua): canonical tables · Bases, uniques, gems, bosses, mods, stat descriptions, and other lookup tables. · `src/Data/Global.lua`
- [Tree data](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/TreeData/3_28/tree.lua): versioned assets · Versioned passive tree layouts, sprites, and ascendancy positions. · `src/TreeData/3_28/tree.lua`

### Import, export & updates

External integrations, generation pipelines, and self-update flow.

- [Export](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Export/Main.lua): content pipeline · Generates normalized text/Lua assets and tree/data exports. · `src/Export/Main.lua`
- [Import](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/Classes/ImportTab.lua): ingest flow · Build import, item paste import, character import, and share-code ingestion. · `src/Classes/ImportTab.lua`
- [Updates](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/src/UpdateCheck.lua): release tooling · Update checks, applying updates, and install/launch support. · `src/UpdateCheck.lua`

### Verification

Automated specs and maintenance tests.

- [Specs](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/spec/System/TestBuilds_spec.lua): busted tests · System-level Lua coverage for builds, skills, items, triggers, and trade queries. · `spec/System/TestBuilds_spec.lua`
- [Maintenance test](https://github.com/pathofbuildingcommunity/pathofbuilding/blob/dev/tests/test_fix_ascendancy_positions.py): python test · Python maintenance check for ascendancy position fixing. · `tests/test_fix_ascendancy_positions.py`

## Connections

- Runtime → Launch: executes · Bundled binaries launch the desktop application.
- Launch → Main: boots · Startup hands control to the main application module.
- Main → UI core: builds · Main wires the UI framework and event host.
- Main → Build tabs: opens · Main instantiates the primary build-editing screens.
- Main → Build model: owns · Main coordinates the central build state.
- Build tabs → Build model: edits · Tabs mutate the shared build model.
- UI core → Build tabs: renders · Reusable controls compose the major screens.
- Build model → Calc engine: feeds · The current build state is recalculated into derived stats.
- Calc engine → Offence: delegates · Offence is one major calculation boundary.
- Calc engine → Defence: delegates · Defence is one major calculation boundary.
- Calc engine → Triggers: delegates · Trigger and proc behavior are calculated separately.
- Build model → Items: contains · Items are parsed into and stored on the build.
- Items → Mods: resolves · Item logic depends on modifier parsing and stat interpretation.
- Mods → Game data: reads · Mod parsing is grounded in static game tables.
- Build model → Tree data: uses · Passive-tree choices are versioned by game tree assets.
- Import → Build model: imports · External build data is normalized into build state.
- Trade UI → Items: suggests · Trade queries support item upgrade evaluation.
- Export → Game data: generates from · Exports are produced from normalized game data.
- Export → Tree data: generates from · Tree export assets are derived from tree data.
- Updates → Runtime: updates · Updater and installer manage the packaged runtime.
- Specs → Calc engine: verifies · Specs focus on deterministic calculation behavior.
- Maintenance test → Tree data: checks · Maintenance test validates tree-related position data.
