# chika3742/dqm_installer_flt architecture

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

- Interactive diagram: https://gitdiagram.com/chika3742/dqm_installer_flt
- Repository: https://github.com/chika3742/dqm_installer_flt

## Overview

##### Project Type and Purpose
- dqm_installer_flt is a cross-platform desktop application built with Flutter.
- It serves as an installer/launcher helper for Minecraft DQM, handling installation logic, compatibility checks, and user interface on Windows, macOS, and Linux.
- The presence of `lib/pages`, `lib/libs`, and platform folders (`windows/`, `macos/`, `linux/`) confirms a Flutter UI front end with core Dart business logic and native embedding code per platform.

##### High-Level Architectural Components
a. Flutter Application Layer
- UI Pages (`lib/pages/home.dart`, `installation_progress.dart`)
- Shared Widgets & Themes (from the local `packages/timelines` package)
- Message definitions (`lib/messages.dart`) if using Pigeon for method channels
b. Core Logic Layer (`lib/libs/`)
- compatibility_checker.dart – verifies OS and launcher version
- installer.dart – orchestrates download, extraction, and setup
- profiles.dart – reads/writes Minecraft profile data
- seven_zip.dart – handles archive extraction (likely invoking native 7-Zip or system unzip)
c. Utility Layer (`lib/utils/`)
- precondition.dart – validation routines
- ui.dart – UI helper functions
- utils.dart – general helpers (logging, file I/O wrappers)
d. Asset Layer (`assets/`)
- JSON data (`dqm4.json`, `legacy.json`)
- Font resources (`assets/fonts`)
e. Platform Embedding Layer
- macOS: `macos/Runner/…` and Flutter plugin registrant
- Windows: `windows/runner/…` and CMake setup
- Linux: `linux/…` and CMake/GLFW embedding
f. External Services & OS Interfaces
- File system (reading/writing Minecraft folders)
- Native processes (invoking Java launcher, 7-Zip CLI)
- Environment variables, shell commands (via Dart’s Process API)

##### Relationships and Data Flow
- UI Layer invokes Core Logic APIs (Installer, Checker, Profiles).
- Core Logic reads/writes Asset and File System, calls utilities.
- For archive tasks, Core Logic calls seven_zip module, which spawns a native process.
- Profiles module reads launcher data from user’s OS directories.
- Platform Embedding initializes Flutter engine, connects method channels (if any) to native code.

##### Architectural Patterns & Principles
- Clear separation of concerns: UI vs. business logic vs. utilities.
- Use of a local plugin/package (`packages/timelines`) for UI theming and custom widgets.
- Dependency injection by passing service classes into pages (implicit via Dart imports).
- Asset-driven configuration (JSON files decoupled from code).

## Diagram (Mermaid)

```mermaid
graph TB
    %% Platform Embedding Layer
    subgraph "Platform Embedding Layer"
        direction TB
        Mac["macOS Embedding"]:::embed
        Win["Windows Embedding"]:::embed
        Lin["Linux Embedding"]:::embed
    end
    FE["Flutter Engine"]:::embed
    Mac --> FE
    Win --> FE
    Lin --> FE

    %% UI Layer
    subgraph "UI Layer"
        direction TB
        Home["Home Page"]:::ui
        Progress["Installation Progress Page"]:::ui
        Timelines["Timelines Package"]:::ui
        Messages["Message Definitions"]:::ui
    end
    FE --> Home
    FE --> Progress
    Home --> Timelines
    Home --> Messages
    Progress --> Timelines
    Progress --> Messages

    %% Core Logic Layer
    subgraph "Core Logic Layer"
        direction TB
        Checker["CompatibilityChecker"]:::core
        Installer["Installer"]:::core
        Profiles["Profiles"]:::core
        SevenZip["SevenZip Extraction"]:::core
    end
    Home --> Checker
    Home --> Installer
    Progress --> Installer
    Progress --> Profiles
    Progress --> SevenZip
    Checker --> Installer
    Installer --> Profiles
    Profiles --> SevenZip

    %% Utility Layer
    subgraph "Utility Layer"
        direction TB
        Precond["Precondition Validation"]:::util
        UIUtil["UI Helpers"]:::util
        GenUtil["General Utilities"]:::util
    end
    Checker --> Precond
    Installer --> UIUtil
    Profiles --> GenUtil
    SevenZip --> GenUtil

    %% Asset Layer
    subgraph "Asset Layer"
        direction TB
        JSON["Config JSON Data"]:::asset
        Fonts["Font Resources"]:::asset
    end
    Checker --> JSON
    Installer --> JSON
    Profiles --> JSON
    SevenZip --> JSON

    %% OS Interfaces
    subgraph "OS Interfaces & External Services"
        direction TB
        FS["File System"]:::os
        Proc["Process / CLI"]:::os
        Env["Environment Variables"]:::os
    end
    SevenZip -.->|spawns 7-Zip process| Proc
    Profiles -->|reads/writes profiles| FS
    Installer -->|downloads/extracts| FS
    Installer --> Env
    Checker --> Env

    %% Click Events
    click Home "https://github.com/chika3742/dqm_installer_flt/blob/main/lib/pages/home.dart"
    click Progress "https://github.com/chika3742/dqm_installer_flt/blob/main/lib/pages/installation_progress.dart"
    click Timelines "https://github.com/chika3742/dqm_installer_flt/blob/main/packages/timelines/lib/timelines.dart"
    click Messages "https://github.com/chika3742/dqm_installer_flt/blob/main/lib/messages.dart"
    click Messages "https://github.com/chika3742/dqm_installer_flt/blob/main/pigeon.dart"
    click Checker "https://github.com/chika3742/dqm_installer_flt/blob/main/lib/libs/compatibility_checker.dart"
    click Installer "https://github.com/chika3742/dqm_installer_flt/blob/main/lib/libs/installer.dart"
    click Profiles "https://github.com/chika3742/dqm_installer_flt/blob/main/lib/libs/profiles.dart"
    click SevenZip "https://github.com/chika3742/dqm_installer_flt/blob/main/lib/libs/seven_zip.dart"
    click Precond "https://github.com/chika3742/dqm_installer_flt/blob/main/lib/utils/precondition.dart"
    click UIUtil "https://github.com/chika3742/dqm_installer_flt/blob/main/lib/utils/ui.dart"
    click GenUtil "https://github.com/chika3742/dqm_installer_flt/blob/main/lib/utils/utils.dart"
    click JSON "https://github.com/chika3742/dqm_installer_flt/blob/main/assets/dqm4.json"
    click JSON "https://github.com/chika3742/dqm_installer_flt/blob/main/assets/legacy.json"
    click Fonts "https://github.com/chika3742/dqm_installer_flt/tree/main/assets/fonts/"
    click Lin "https://github.com/chika3742/dqm_installer_flt/blob/main/linux/main.cc"
    click Lin "https://github.com/chika3742/dqm_installer_flt/blob/main/linux/my_application.cc"
    click Lin "https://github.com/chika3742/dqm_installer_flt/blob/main/linux/my_application.h"
    click Lin "https://github.com/chika3742/dqm_installer_flt/blob/main/linux/CMakeLists.txt"
    click Lin "https://github.com/chika3742/dqm_installer_flt/blob/main/linux/flutter/generated_plugin_registrant.cc"
    click Mac "https://github.com/chika3742/dqm_installer_flt/blob/main/macos/Runner/AppDelegate.swift"
    click Mac "https://github.com/chika3742/dqm_installer_flt/blob/main/macos/Runner/MainFlutterWindow.swift"
    click Mac "https://github.com/chika3742/dqm_installer_flt/blob/main/macos/Flutter/GeneratedPluginRegistrant.swift"
    click Mac "https://github.com/chika3742/dqm_installer_flt/tree/main/macos/Podfile"
    click Mac "https://github.com/chika3742/dqm_installer_flt/blob/main/macos/Runner.xcodeproj"
    click Win "https://github.com/chika3742/dqm_installer_flt/blob/main/windows/runner/main.cpp"
    click Win "https://github.com/chika3742/dqm_installer_flt/blob/main/windows/runner/flutter_window.cpp"
    click Win "https://github.com/chika3742/dqm_installer_flt/blob/main/windows/runner/flutter_window.h"
    click Win "https://github.com/chika3742/dqm_installer_flt/blob/main/windows/runner/messages.g.cpp"
    click Win "https://github.com/chika3742/dqm_installer_flt/blob/main/windows/runner/messages.g.h"
    click Win "https://github.com/chika3742/dqm_installer_flt/blob/main/windows/runner/utils.cpp"
    click Win "https://github.com/chika3742/dqm_installer_flt/blob/main/windows/runner/utils.h"
    click Win "https://github.com/chika3742/dqm_installer_flt/blob/main/windows/runner/CMakeLists.txt"

    %% Styles
    classDef ui fill:#cce5ff,stroke:#0066cc,color:#003366;
    classDef core fill:#d4edda,stroke:#28a745,color:#155724;
    classDef util fill:#e2e3e5,stroke:#6c757d,color:#343a40;
    classDef asset fill:#fff3cd,stroke:#ffc107,color:#856404;
    classDef embed fill:#f8f9fa,stroke:#adb5bd,color:#495057;
    classDef os fill:#ffe5e5,stroke:#dc3545,color:#721c24;
```
