# urlordjames/green-updater architecture

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

- Interactive diagram: https://gitdiagram.com/urlordjames/green-updater
- Repository: https://github.com/urlordjames/green-updater

## Overview

##### Main Components

a) Core Application Components:
- GUI Frontend (main application interface)
- Update Manager (handles modpack update logic)
- File System Interface (manages local file operations)
- Notification System (represented in notify.rs)
- Logging System (represented in file_logging.rs)

b) External Dependencies:
- Minecraft Installation
- Remote Modpack Repository
- Cloud Logging Service (optional feature)

**┌─ User Interface Layer ─────────────────────┐**

- GUI Frontend                 │

- ┬───────────────────────┤
- Update Manager   │   Notification System  │
- ┴───────────────────────┤
- File System Interface           │
- ┤
- Logging System                 │
- ┘

##### Specific Implementation Details

Technical aspects:
- Rust-based architecture
- NSIS installer system (install.nsi)
- Cloud-logging feature as optional
- Platform-specific dependencies (VCRUNTIME140.dll for Windows)

##### External Interactions

Highlight:
- Minecraft installation directory interaction
- Remote modpack repository communication
- Cloud logging service connection (when enabled)

##### Build/Distribution

A separate section showing:
- Cargo build system
- Nix/Flake packaging
- NSIS Windows installer
- Flatpak distribution

##### Cross-platform distribution methods

- Component types and their visual representations
- Build/distribution paths

This will help other developers understand both the high-level architecture and the specific implementation details of the green-updater project.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Main Components
    GUI["GUI Frontend"]:::core
    click GUI "https://github.com/urlordjames/green-updater/blob/main/src/main.rs"
    UpdateMgr["Update Manager"]:::core
    FileSystem["File System Interface"]:::core
    Notify["Notification System"]:::core
    click Notify "https://github.com/urlordjames/green-updater/blob/main/src/notify.rs"
    Logging["Logging System"]:::core
    click Logging "https://github.com/urlordjames/green-updater/blob/main/src/file_logging.rs"

    %% External Systems
    Minecraft["Minecraft Installation"]:::external
    ModRepo["Remote Modpack Repository"]:::external
    CloudLog["Cloud Logging Service"]:::optional

    %% Build & Distribution
    subgraph Build ["Build & Distribution"]
        Cargo["Cargo Build System"]:::build
        click Cargo "https://github.com/urlordjames/green-updater/blob/main/Cargo.toml"
        NixFlake["Nix/Flake Packaging"]:::build
        click NixFlake "https://github.com/urlordjames/green-updater/blob/main/flake.nix"
        NSIS["NSIS Windows Installer"]:::build
        click NSIS "https://github.com/urlordjames/green-updater/blob/main/install.nsi"
        GHActions["GitHub Actions"]:::build
        click GHActions "https://github.com/urlordjames/green-updater/blob/main/.github/workflows/build.yml"
        Flatpak["Flatpak Distribution"]:::build
    end

    %% Relationships
    GUI --> UpdateMgr
    GUI --> Notify
    UpdateMgr --> FileSystem
    UpdateMgr --> ModRepo
    FileSystem --> Minecraft
    FileSystem --> Logging
    Logging -.-> CloudLog
    
    %% Build System Relationships
    Cargo --> GUI
    NixFlake --> Cargo
    NSIS --> Cargo
    Flatpak --> Cargo
    GHActions --> NixFlake
    GHActions --> NSIS
    GHActions --> Flatpak

    %% Styles
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef external fill:#2ecc71,stroke:#27ae60,color:white
    classDef optional fill:#f1c40f,stroke:#f39c12,color:black
    classDef build fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Legend
    subgraph Legend
        CoreComp["Core Component"]:::core
        ExtSys["External System"]:::external
        OptFeat["Optional Feature"]:::optional
        BuildSys["Build System"]:::build
    end
```
