# mmvanheusden/steamdepotdownloadergui architecture

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

- Interactive diagram: https://gitdiagram.com/mmvanheusden/steamdepotdownloadergui
- Repository: https://github.com/mmvanheusden/steamdepotdownloadergui

## Overview

##### Project type + purpose (what you’re diagramming)
This is a **cross-platform desktop GUI** built with **Tauri**:
- **Frontend**: **Preact + Vite + TypeScript** (`src/`)
- **Backend (native side)**: **Rust Tauri runtime** (`src-tauri/src/`)
- Purpose: a **graphical wrapper around DepotDownloader** to download specific/older Steam depots (i.e., older game versions). Practically, it orchestrates:
- collecting user inputs (appId/depotId/manifestId, output dir, credentials/options),
- executing a download workflow via a Rust layer (likely spawning/controlling DepotDownloader and/or implementing some Steam interactions),
- streaming progress/log output back to the UI,
- optional clipboard parsing + settings persistence.

So your “system” is not a client/server web app; it’s a **desktop app with an embedded web UI** plus a **native orchestrator** that interacts with **Steam/DepotDownloader** and the **local filesystem/terminal**.

##### Frontend boundary (WebView UI)
Key files:
- `src/main.tsx`, `src/App.tsx`: app bootstrap + root composition
- `src/components/*`:
- `DownloaderForm.tsx`: user inputs / form submission (core command parameters)
- `DownloaderOutput.tsx`: log/progress display (streaming output)
- `ClipboardParser.tsx`: interprets clipboard text into structured inputs
- `Settings.tsx`: configuration UX (paths, defaults, maybe auth mode)
- `FormInput.tsx`: shared input component
- `src/context.ts`: global state (settings, download job state, logs, etc.)
- `src/css/App.css`, `src/assets/*`

This strongly suggests a UI that:

##### Backend boundary (Rust / Tauri commands)
Key files:
- `src-tauri/src/main.rs`: Tauri entrypoint; registers commands, sets up app lifecycle
- `src-tauri/src/depotdownloader.rs`: likely “run DepotDownloader” orchestration (spawn process, parse output)
- `src-tauri/src/steam.rs`: Steam-specific logic (auth/session, app/depot metadata, guard/2FA, etc.—whatever the tool needs)
- `src-tauri/src/terminal.rs`: process spawning, stdout/stderr streaming, kill/cancel, platform-specific shell handling
- `src-tauri/tauri.conf.json`: Tauri config (windows, permissions/capabilities, bundling)
- `src-tauri/capabilities/default.json`: permission model (what APIs the UI can invoke)

This indicates the Rust side is the “application service layer” and “system integration layer”.

##### External dependencies / systems
From README + likely runtime behavior:
- **DepotDownloader** (external tool / binary or packaged dependency)
- **Steam network** (Steam services for depot content/auth)
- **Local OS**: filesystem writes, process management, keychain/credential storage (if implemented), clipboard access (via frontend or Tauri plugin), network.

##### Build + release pipeline boundary
- `package.json`, `pnpm-lock.yaml`, `vite.config.ts`: frontend build
- `src-tauri/Cargo.toml`, `Cargo.lock`, `build.rs`: Rust build
- `.github/workflows/build_debug.yml`, `build_release.yml`: CI packaging/signing across OSes

##### Tauri Desktop App
- **Preact UI (WebView)**
- **Rust Core (Tauri commands)**
##### Local Filesystem (Download directory + config)

- User → Preact UI (inputs, start/cancel)
- Preact UI ↔ Rust Core (Tauri IPC invoke/events)
- Rust Core → DepotDownloader (spawn process, args)
- DepotDownloader ↔ Steam Services (auth, manifests, download content)
- DepotDownloader → Local Filesystem (writes game files)
- Rust Core → Preact UI (stream logs/progress events)

Split into two big columns: **Frontend** and **Rust backend**.

**Frontend (Preact)**
- `DownloaderForm` → invokes command `startDownload(...)`
- `Settings` → reads/writes settings (via Tauri store/fs command)
- `ClipboardParser` → transforms clipboard text → form state
- `DownloaderOutput` → subscribes to progress/log events (Tauri event listener)
- `context.ts` → shared state/store

**Rust (Tauri)**
- `main.rs` → command registration + event emitter
- `depotdownloader.rs` → constructs command line, manages job state, parses output
- `terminal.rs` → spawn/kill process, stream stdout/stderr
- `steam.rs` → any Steam-specific helpers (credentials, manifest retrieval, etc.)

- `DownloaderForm` → Rust `depotdownloader` (start)
- `DownloaderOutput` ← Rust events from `terminal` output parser
- `Settings` ↔ Rust persistence (if exists; otherwise show as “Local config”)
- `ClipboardParser` → `DownloaderForm` (state update)
- Rust `depotdownloader` → `terminal` (process execution)
- Rust `depotdownloader/steam` → network/steam (if direct calls exist; otherwise show Steam only under DepotDownloader)

##### Process completes → Rust emits completion (success/failure) → UI updates state

Also include:
- **Cancel**: UI → Rust → kill process
- **Settings**: UI ↔ local persistence (file/tauri store)

##### Architectural patterns/design principles visible here
- **Hybrid desktop architecture**: Web UI + native orchestrator (Tauri)
- **Thin UI, thick integration layer**: UI collects/visualizes; Rust performs privileged OS operations
- **Event-driven progress reporting**: streaming logs from a subprocess to UI via Tauri events
- **External-tool wrapper**: DepotDownloader is not a library here (most likely); it’s an external executable/process boundary. Treat it as its own component.

- UI: “Preact + TS + Vite (WebView)”
- Bridge: “Tauri IPC (invoke/emit)”
- Core: “Rust (Tauri commands)”
- Process execution: “Spawn subprocess / stdout-stderr streaming”
- External: “DepotDownloader (SteamRE)”
- Network: “Steam CDN / Steam APIs”
- Storage: “Local filesystem (download dir), local app config”

## Diagram (Mermaid)

```mermaid
flowchart TD
  %% =========================
  %% Level 1: Runtime Context
  %% =========================
  subgraph "User Machine (Desktop)"
    direction TB

    User(("User")):::external

    subgraph "Tauri Desktop App"
      direction TB

      subgraph "WebView UI (Preact + TS + Vite)"
        direction TB
        FE_Root["UI Shell (App + Main)"]:::frontend
        FE_Context["Global State / Context Store"]:::frontend
        FE_Form["DownloaderForm"]:::frontend
        FE_Clipboard["ClipboardParser"]:::frontend
        FE_Settings["Settings"]:::frontend
        FE_Output["DownloaderOutput"]:::frontend
        FE_Input["FormInput (shared)"]:::frontend
        FE_Style["CSS + Assets"]:::frontend
      end

      IPC["Tauri IPC Bridge\n(invoke / event emit)"]:::bridge

      subgraph "Rust Core (Tauri Commands)"
        direction TB
        BE_Main["Command Registration\n(main.rs)"]:::backend
        BE_Depot["Download Orchestration\n(depotdownloader.rs)"]:::backend
        BE_Terminal["Terminal/Subprocess Adapter\n(terminal.rs)"]:::backend
        BE_Steam["Steam Helpers\n(steam.rs)"]:::backend
      end
    end

    DD["DepotDownloader\n(external executable)"]:::tool

    DLFS[(Local Filesystem\ndownload directory)]:::storage
    CFG[(Local App Config\nsettings/state)]:::storage
  end

  SteamCloud{{"Steam Services\n(Steam CDN / APIs)"}}:::cloud

  %% Runtime flows (vertical, primary workflow)
  User -->|"inputs,start/cancel"| FE_Form
  User -->|"configure"| FE_Settings
  User -->|"paste/parse"| FE_Clipboard

  FE_Clipboard -->|"populate_form_state"| FE_Form
  FE_Form -->|"update_state"| FE_Context
  FE_Settings -->|"update_state"| FE_Context

  FE_Form -->|"invoke start_download(args)"| IPC
  FE_Settings -->|"invoke load/save_settings"| IPC

  IPC -->|"dispatch_command"| BE_Main
  BE_Main -->|"start_download"| BE_Depot
  BE_Main -->|"load/save_settings"| CFG

  BE_Depot -->|"build_args,manage_job"| BE_Terminal
  BE_Depot -->|"optional_helpers"| BE_Steam

  BE_Terminal -->|"spawn_subprocess"| DD
  FE_Form -->|"invoke cancel"| IPC
  BE_Main -->|"cancel_download"| BE_Terminal
  BE_Terminal -->|"kill_process"| DD

  %% Progress/log streaming back to UI
  DD -->|"stdout/stderr"| BE_Terminal
  BE_Terminal -->|"parse_output"| BE_Depot
  BE_Depot -.->|"emit progress/log events"| IPC
  IPC -.->|"event_stream"| FE_Output
  FE_Output -->|"render_logs/progress"| FE_Root
  FE_Root -->|"consume_state"| FE_Context

  %% External interactions
  DD <-->|"auth,manifests,download_depots"| SteamCloud
  DD ==>|"write_game_files"| DLFS
  FE_Settings <-->|"read/write defaults"| CFG

  %% =========================
  %% Optional: Build/Release Lane (CI/CD)
  %% =========================
  subgraph "CI/CD (GitHub Actions)"
    direction TB
    CI["Workflows\n(build_debug / build_release)"]:::cicd
    FE_Build["Frontend Tooling\n(Vite/TS/PNPM)"]:::cicd
    BE_Build["Rust Build\n(Cargo + build.rs)"]:::cicd
    Bundle["Tauri Bundle/Package\n(Windows/Linux/macOS)"]:::cicd
  end

  FE_Build -->|"build_web_assets"| Bundle
  BE_Build -->|"compile_rust"| Bundle
  CI -->|"orchestrates"| FE_Build
  CI -->|"orchestrates"| BE_Build
  Bundle -->|"produces_installer"| User

  %% =========================
  %% Click Events (component_mapping)
  %% =========================
  click FE_Root "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/src/App.tsx"
  click FE_Context "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/src/context.ts"
  click FE_Form "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/src/components/DownloaderForm.tsx"
  click FE_Output "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/src/components/DownloaderOutput.tsx"
  click FE_Clipboard "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/src/components/ClipboardParser.tsx"
  click FE_Settings "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/src/components/Settings.tsx"
  click FE_Input "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/src/components/FormInput.tsx"
  click FE_Style "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/src/css/App.css"
  click FE_Build "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/vite.config.ts"
  click BE_Main "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/src-tauri/src/main.rs"
  click BE_Depot "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/src-tauri/src/depotdownloader.rs"
  click BE_Steam "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/src-tauri/src/steam.rs"
  click BE_Terminal "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/src-tauri/src/terminal.rs"
  click IPC "https://github.com/mmvanheusden/steamdepotdownloadergui/tree/main/src-tauri/src/"
  click BE_Build "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/src-tauri/Cargo.toml"
  click Bundle "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/src-tauri/tauri.conf.json"
  click CI "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/.github/workflows/build_release.yml"

  %% =========================
  %% Additional click mappings (as link nodes to preserve all paths)
  %% =========================
  subgraph "Repository Links (additional paths)"
    direction TB
    L_User_src["User: src/"]:::link
    L_FE_Root_main["FE_Root: src/main.tsx"]:::link
    L_FE_Style_assets["FE_Style: src/assets/"]:::link
    L_Bundle_caps["Bundle: src-tauri/capabilities/default.json"]:::link
    L_BE_Build_lock["BE_Build: src-tauri/Cargo.lock"]:::link
    L_BE_Build_buildrs["BE_Build: src-tauri/build.rs"]:::link
    L_FE_Build_pkg["FE_Build: package.json"]:::link
    L_FE_Build_lock["FE_Build: pnpm-lock.yaml"]:::link
    L_FE_Build_ts["FE_Build: tsconfig.json"]:::link
    L_FE_Build_tsnode["FE_Build: tsconfig.node.json"]:::link
    L_CI_debug["CI: .github/workflows/build_debug.yml"]:::link
    L_IPC_conf["IPC: src-tauri/tauri.conf.json"]:::link
  end

  User -.-> L_User_src
  FE_Root -.-> L_FE_Root_main
  FE_Style -.-> L_FE_Style_assets
  Bundle -.-> L_Bundle_caps
  BE_Build -.-> L_BE_Build_lock
  BE_Build -.-> L_BE_Build_buildrs
  FE_Build -.-> L_FE_Build_pkg
  FE_Build -.-> L_FE_Build_lock
  FE_Build -.-> L_FE_Build_ts
  FE_Build -.-> L_FE_Build_tsnode
  CI -.-> L_CI_debug
  IPC -.-> L_IPC_conf

  click L_User_src "https://github.com/mmvanheusden/steamdepotdownloadergui/tree/main/src/"
  click L_FE_Root_main "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/src/main.tsx"
  click L_FE_Style_assets "https://github.com/mmvanheusden/steamdepotdownloadergui/tree/main/src/assets/"
  click L_Bundle_caps "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/src-tauri/capabilities/default.json"
  click L_BE_Build_lock "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/src-tauri/Cargo.lock"
  click L_BE_Build_buildrs "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/src-tauri/build.rs"
  click L_FE_Build_pkg "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/package.json"
  click L_FE_Build_lock "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/pnpm-lock.yaml"
  click L_FE_Build_ts "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/tsconfig.json"
  click L_FE_Build_tsnode "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/tsconfig.node.json"
  click L_CI_debug "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/.github/workflows/build_debug.yml"
  click L_IPC_conf "https://github.com/mmvanheusden/steamdepotdownloadergui/blob/main/src-tauri/tauri.conf.json"

  %% =========================
  %% Styles
  %% =========================
  classDef frontend fill:#D6F5FF,stroke:#0B7285,stroke-width:1.5px,color:#053B44
  classDef backend fill:#E9D5FF,stroke:#6D28D9,stroke-width:1.5px,color:#2E1065
  classDef bridge fill:#FFF3BF,stroke:#F08C00,stroke-width:1.5px,color:#7A3E00
  classDef tool fill:#E6FCF5,stroke:#099268,stroke-width:1.5px,color:#064635
  classDef storage fill:#F1F3F5,stroke:#495057,stroke-width:1.5px,color:#212529
  classDef cloud fill:#E7F5FF,stroke:#1C7ED6,stroke-width:1.5px,color:#0B3861
  classDef external fill:#FFE3E3,stroke:#C92A2A,stroke-width:1.5px,color:#5C1A1A
  classDef cicd fill:#E3FAFC,stroke:#1098AD,stroke-width:1.5px,color:#0B4B5A
  classDef link fill:#FFFFFF,stroke:#CED4DA,stroke-width:1px,color:#343A40

  %% Emphasize key boundaries
  style SteamCloud stroke-dasharray: 6 3,stroke-width:2px
  style DD stroke-dasharray: 6 3,stroke-width:2px
```
