# dfint/installer architecture

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

- Interactive diagram: https://gitdiagram.com/dfint/installer
- Repository: https://github.com/dfint/installer

## Overview

##### Core Application Components
- Following major modules (based on src/ directory):
- App Module (UI/Frontend)
- Logic Module (Core Business Logic)
- DF Binary Handler
- Dictionary & Hook Metadata Handlers
- Thread Pool (Concurrent Operations)
- Persistent Storage

##### External Integrations
- Dwarf Fortress Game (target application)
- Translation Resources
- Transifex Integration (indicated by .tx directory)
- Local Translation Files (locale/*.json)
- df-steam-hook-rs (external hook component)

##### Workflow Components
- GitHub Actions Pipeline (.github/workflows)
- Build System
- Localization Management System

- [Top Layer]
- User Interface (app.rs)

- [Middle Layer]
- Core Logic (logic.rs)

- Dictionary Manager (dict_metadata.rs)
- Hook Manager (hook_metadata.rs)
- Binary Handler (df_binary.rs)

- [Bottom Layer]
- Thread Pool
- Persistent Storage
- Utilities

##### Installation Flow
- Game Detection
- Language Selection
- Update Process
- Hook Installation

##### Update Mechanism
- Translation Updates
- Hook Updates
- Configuration Management

##### External Dependencies
- DFHack Compatibility
- Translation Sources
- Build Dependencies

Level of Detail:

- Installation Process
- Update Workflow
- Translation Management
- Build Pipeline

Additional Notes:
- Version information and compatibility notes
- Relationship with DFHack (version 50.13-r2+)
- Supported platforms (Windows/Linux)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph UI
        App["User Interface"]:::ui
    end

    subgraph Core
        Logic["Core Business Logic"]:::core
        DFBinary["DF Binary Handler"]:::core
        DictMeta["Dictionary Metadata"]:::core
        HookMeta["Hook Metadata"]:::core
    end

    subgraph Services
        ThreadPool["Thread Pool"]:::service
        Storage["Persistent Storage"]:::service
        LocalizationSys["Localization System"]:::service
    end

    subgraph External
        DwarfFortress["Dwarf Fortress Game"]:::external
        TransifexInt["Transifex Integration"]:::external
        LocaleTrans["Local Translations"]:::external
        DFHook["df-steam-hook-rs"]:::external
    end

    subgraph Build
        BuildSys["Build System"]:::build
        GHActions["GitHub Actions"]:::build
        StringExtract["Translation String Extraction"]:::build
    end

    subgraph Utils
        Constants["Constants"]:::util
        Utilities["Utilities"]:::util
    end

    App --> Logic
    Logic --> DFBinary
    Logic --> DictMeta
    Logic --> HookMeta
    Logic --> LocalizationSys
    Logic --> Storage

    DFBinary --> DwarfFortress
    DFBinary --> DFHook

    LocalizationSys --> TransifexInt
    LocalizationSys --> LocaleTrans

    ThreadPool -.-> Logic
    ThreadPool -.-> DFBinary
    ThreadPool -.-> LocalizationSys

    GHActions --> TransifexInt
    BuildSys --> App
    StringExtract --> LocalizationSys

    %% Click Events
    click App "https://github.com/dfint/installer/blob/main/src/app.rs"
    click Logic "https://github.com/dfint/installer/blob/main/src/logic.rs"
    click DFBinary "https://github.com/dfint/installer/blob/main/src/df_binary.rs"
    click DictMeta "https://github.com/dfint/installer/blob/main/src/dict_metadata.rs"
    click HookMeta "https://github.com/dfint/installer/blob/main/src/hook_metadata.rs"
    click ThreadPool "https://github.com/dfint/installer/blob/main/src/thread_pool.rs"
    click Storage "https://github.com/dfint/installer/blob/main/src/persistent.rs"
    click LocalizationSys "https://github.com/dfint/installer/blob/main/src/localization.rs"
    click TransifexInt "https://github.com/dfint/installer/tree/main/.tx/config"
    click LocaleTrans "https://github.com/dfint/installer/blob/main/locale/*.json"
    click BuildSys "https://github.com/dfint/installer/blob/main/build.rs"
    click GHActions "https://github.com/dfint/installer/tree/main/.github/workflows"
    click StringExtract "https://github.com/dfint/installer/blob/main/scripts/extract_locale_strings.py"
    click Constants "https://github.com/dfint/installer/blob/main/src/constants.rs"
    click Utilities "https://github.com/dfint/installer/blob/main/src/utils.rs"

    %% Styling
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef service fill:#9b59b6,stroke:#8e44ad,color:white
    classDef external fill:#e74c3c,stroke:#c0392b,color:white
    classDef build fill:#f1c40f,stroke:#f39c12,color:black
    classDef util fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Legend
    subgraph Legend
        UI_L["UI Components"]:::ui
        Core_L["Core Components"]:::core
        Service_L["Services"]:::service
        External_L["External Systems"]:::external
        Build_L["Build Components"]:::build
        Util_L["Utilities"]:::util
    end
```
