# theliantech/calradiaforge architecture

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

- Interactive diagram: https://gitdiagram.com/theliantech/calradiaforge
- Repository: https://github.com/theliantech/calradiaforge

## Overview

1. This repository snapshot contains documentation and release/process files only; the actual application code is not present in the tree. The architecture description below is therefore based on the README’s explicit design notes and runtime behavior.

2. CalradiaForge is a standalone WPF desktop launcher for Mount & Blade II: Bannerlord. Its primary purpose is to manage local game mods, persist modpacks, and launch the game with the selected loadout. The application is portable rather than installer-based, so its data lives alongside the executable.

3. The top-level system boundary is split into a WPF UI layer and a core logic layer. The UI handles navigation, styling, and user interaction across pages such as Mods, Modpacks, Settings, and FAQ. The core layer owns file-system access, mod detection, archive extraction, modpack persistence, launch orchestration, and logging.

4. Startup is gated by a first-run EULA flow. Before the main window opens, the app checks persisted configuration, shows a modal EULA window if needed, and either records acceptance or exits. This is an important early boundary because it controls whether the rest of the app is allowed to initialize.

5. Configuration is file-based and local. The app stores JSON config and related data in dedicated folders next to the executable: Config, Logs, Modpacks, Data, and Languages. The README describes a repository-style `AppConfig` for persistence and a bindable `AppConfigSettings` facade for UI access, separating storage concerns from view binding.

6. Mod management is centered on the game’s `Modules` directory. CalradiaForge scans installed modules, classifies them into active/inactive lists, validates basic mod structure such as `SubModule.xml`, and reacts to folder changes. The UI then manipulates this detected model by toggling active state, searching, and drag-reordering for load order.

7. Mod installation is a multi-stage pipeline owned by the service layer. Archives in `.zip`, `.rar`, or `.7z` are validated, extracted to a temp location, scanned to find the actual mod root, copied into the Bannerlord `Modules` folder, and then DLL-unblocked to remove Windows zone markings. The installer also supports version comparison, cancellation, and progress reporting.

8. Modpacks are a distinct persistence model layered on top of installed mods. A modpack captures the selected mods, their order, active/inactive state, and related metadata, then stores that definition in the Modpacks directory. The app can save, edit, restore last-used modpacks, and import external presets, including conversion from Novus Launcher formats.

9. Game launching is platform-aware but constrained to the supported platforms. Steam and GOG/Standalone are fully supported; Steam can be auto-started if needed. The launcher builds the final game invocation from the current modpack and can include BLSE-related launch behavior when applicable.

10. Logging and diagnostics are local and file-based. A singleton logger writes to the Logs folder with level gating and retention cleanup. This matters architecturally because the app is intended to be troubleshootable without network services or cloud synchronization.

11. The UI also includes a toast/notification subsystem for long-running operations. The README describes an application-wide toast overlay rendered in the main window and fed by a service that tracks visible toasts, severity, auto-dismiss behavior, and progress updates. This is the main feedback channel for install and launch workflows.

12. The services are instantiated centrally at application startup and then exposed to pages. The README emphasizes explicit dependency passing rather than global state inside helpers, so the key architectural boundary is service-owned behavior with UI-triggered actions. Long-running tasks such as mod installation remain owned by services even if the user navigates away from the current page.

13. Operationally, the app is Windows-only and depends on .NET 10 Desktop as a framework-dependent x64 runtime. It is designed for local desktop execution, local disk access, and direct interaction with an installed Bannerlord copy rather than any remote backend or web API.

14. For an architecture diagram, the main boxes should be: WPF UI shell; startup/EULA gate; configuration and data storage; mod discovery/installation pipeline; modpack persistence/import/export; game launch orchestration; logging/toast feedback; and the external Bannerlord installation plus the selected platform client when Steam is used.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["WPF UI"]
  node_app_shell["Main Window<br/>wpf shell"]
  node_nav_frame["Navigation<br/>ui routing"]
  node_mods_page["Mods<br/>page"]
  node_modpacks_page["Modpacks<br/>page"]
  node_settings_page["Settings<br/>page"]
  node_faq_page["FAQ<br/>page"]
  node_toast_overlay["Toast Overlay<br/>feedback ui"]
end

subgraph group_startup["Startup Gate"]
  node_startup_gate(("Startup Gate<br/>bootstrap"))
  node_eula_window["EULA Prompt<br/>consent dialog"]
end

subgraph group_core["Core Services"]
  node_app_config["App Config<br/>settings model"]
  node_mod_scanner["Mod Scanner<br/>module discovery"]
  node_mod_installer{{"Installer Pipeline<br/>archive install"}}
  node_modpack_manager["Modpack Manager<br/>preset persistence"]
  node_import_convert["Format Import<br/>conversion"]
  node_launch_orchestrator["Launch Orchestrator<br/>game launch"]
  node_logger["Logger<br/>diagnostics"]
end

subgraph group_data["Local Data"]
  node_config_store[("Config Store<br/>json persistence")]
  node_bannerlord_install[("Bannerlord<br/>game install")]
  node_platform_client[("Steam/GOG<br/>platform client")]
end

node_startup_gate -->|"first run"| node_eula_window
node_eula_window -->|"persist accept"| node_config_store
node_startup_gate -->|"open app"| node_app_shell
node_app_shell -->|"host"| node_nav_frame
node_nav_frame -->|"shows"| node_mods_page
node_nav_frame -->|"shows"| node_modpacks_page
node_nav_frame -->|"shows"| node_settings_page
node_nav_frame -->|"shows"| node_faq_page
node_app_shell -->|"overlay"| node_toast_overlay
node_settings_page -->|"binds"| node_app_config
node_app_config -->|"reads/writes"| node_config_store
node_mods_page -->|"uses"| node_mod_scanner
node_mods_page -->|"installs"| node_mod_installer
node_mod_scanner -->|"scans"| node_bannerlord_install
node_mod_installer -->|"copies to"| node_bannerlord_install
node_modpacks_page -->|"uses"| node_modpack_manager
node_modpack_manager -->|"persists"| node_config_store
node_modpack_manager -->|"imports"| node_import_convert
node_import_convert -->|"produces"| node_modpack_manager
node_launch_orchestrator -->|"launches"| node_bannerlord_install
node_launch_orchestrator -->|"uses"| node_platform_client
node_launch_orchestrator -->|"reads loadout"| node_modpack_manager
node_mod_installer -->|"progress"| node_toast_overlay
node_launch_orchestrator -->|"status"| node_toast_overlay
node_logger -->|"logs to disk"| node_config_store
node_app_shell -->|"diagnostics"| node_logger

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_shell,node_nav_frame,node_mods_page,node_modpacks_page,node_settings_page,node_faq_page,node_toast_overlay toneBlue
class node_startup_gate,node_eula_window toneAmber
class node_app_config,node_mod_scanner,node_mod_installer,node_modpack_manager,node_import_convert,node_launch_orchestrator,node_logger toneMint
class node_config_store,node_bannerlord_install,node_platform_client toneRose
```

## Components

### WPF UI

Shell, pages, and in-app feedback

- **Main Window**: wpf shell · Hosts navigation and application-wide overlays
- **Navigation**: ui routing · Switches between main pages
- **Mods**: page · Shows detected modules and load order controls
- **Modpacks**: page · Manages saved and imported modpack presets
- **Settings**: page · Binds app configuration for user editing
- **FAQ**: page · Provides help and usage guidance
- **Toast Overlay**: feedback ui · Application-wide notifications and progress updates

### Startup Gate

First-run consent and app bootstrap

- **Startup Gate**: bootstrap · Checks persisted state before the main window opens
- **EULA Prompt**: consent dialog · Blocks launch until first-run acceptance is recorded

### Core Services

Domain services for mods, packs, launch, and diagnostics

- **App Config**: settings model · Bindable configuration facade used by the UI
- **Mod Scanner**: module discovery · Detects Bannerlord modules and validates basic structure
- **Installer Pipeline**: archive install · Validates, extracts, copies, and unblocks mod archives
- **Modpack Manager**: preset persistence · Saves, edits, restores, and imports modpack definitions
- **Format Import**: conversion · Converts external preset formats into local modpacks
- **Launch Orchestrator**: game launch · Builds and executes the final game invocation
- **Logger**: diagnostics · Writes rotated local logs with level gating

### Local Data

Portable filesystem state and external game/client dependencies

- **Config Store**: json persistence · Reads and writes local configuration and related state
- **Bannerlord**: game install · Installed game copy with Modules directory and executable
- **Steam/GOG**: platform client · Client used for supported platform launch behavior

## Connections

- Startup Gate → EULA Prompt: first run · Shows consent dialog when acceptance is missing
- EULA Prompt → Config Store: persist accept · Stores EULA acceptance locally
- Startup Gate → Main Window: open app · Allows the main window to initialize after gating
- Main Window → Navigation: host · Provides navigation and shared overlays
- Navigation → Mods: shows · Routes to module management
- Navigation → Modpacks: shows · Routes to modpack management
- Navigation → Settings: shows · Routes to settings and configuration
- Navigation → FAQ: shows · Routes to help content
- Main Window → Toast Overlay: overlay · Renders global toast notifications
- Settings → App Config: binds · Edits persisted settings through a view-friendly facade
- App Config → Config Store: reads/writes · Loads and saves local configuration state
- Mods → Mod Scanner: uses · Displays detected modules and refresh state
- Mods → Installer Pipeline: installs · Triggers archive-based mod installation
- Mod Scanner → Bannerlord: scans · Reads the game Modules directory
- Installer Pipeline → Bannerlord: copies to · Extracts and installs into the game Modules folder
- Modpacks → Modpack Manager: uses · Saves, restores, and edits modpack definitions
- Modpack Manager → Config Store: persists · Stores modpack data in local folders
- Modpack Manager → Format Import: imports · Transforms external preset formats into local modpacks
- Format Import → Modpack Manager: produces · Feeds converted presets back into the manager
- Launch Orchestrator → Bannerlord: launches · Builds the final invocation from the installed game
- Launch Orchestrator → Steam/GOG: uses · Starts or coordinates Steam when required
- Launch Orchestrator → Modpack Manager: reads loadout · Uses current modpack state to build launch arguments
- Installer Pipeline → Toast Overlay: progress · Reports install status and cancellation feedback
- Launch Orchestrator → Toast Overlay: status · Reports launch progress and outcomes
- Logger → Config Store: logs to disk · Writes diagnostics into the local Logs folder
- Main Window → Logger: diagnostics · Shares startup and runtime errors locally
