# pvzcxw/cai-install-reborn-opensrc architecture

> Architecture diagram of the GitHub repository pvzcxw/cai-install-reborn-opensrc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pvzcxw/cai-install-reborn-opensrc
- Repository: https://github.com/pvzcxw/cai-install-reborn-opensrc

## Overview

Cai Install Reborn is a Windows desktop manager for Steam game-library files and related launch workflows. The user works through a WebView UI; its JavaScript calls the Python desktop API, which delegates game, configuration, update, and file-management work to the backend. The principal path is game search → AppID selection → manifest/depot processing → managed-file installation and task logs. Other documented branches cover library launch, multiplayer assistance, SteamTools management, announcements, and appearance settings. Relationships for unsampled features are based on README statements, not inspected implementations.

Main entry points: [`main.py`](https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/main.py) (Desktop API), [`gui/js/app.js`](https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/gui/js/app.js) (UI interactions), [`backend.py`](https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/backend.py) (Manifest processing), [`gui/index.html`](https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/gui/index.html) (WebView pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_webview["WebView pages<br/>[index.html]"]
  node_ui_logic["UI interactions<br/>[app.js]"]
end

subgraph group_api["Desktop services"]
  node_desktop_api["Desktop API<br/>[main.py]"]
  node_launcher_core["Launcher core<br/>[main.py]"]
  node_backend["Business backend<br/>[backend.py]"]
end

subgraph group_game["Game workflows"]
  node_game_library["Game library<br/>[backend.py]"]
  node_game_search["AppID search<br/>[backend.py]"]
  node_manifest_work["Manifest processing<br/>[backend.py]"]
  node_managed_files["Managed files<br/>[backend.py]"]
  node_multiplayer["Multiplayer launch<br/>[main.py]"]
end

subgraph group_ops["Management and operations"]
  node_config["User settings<br/>[config.json]"]
  node_steamtools["SteamTools files<br/>[backend.py]"]
  node_settings_ui["Settings and theme<br/>[app.js]"]
  node_updates["Updates and notices<br/>[backend.py]"]
  node_logs["Logs and task status<br/>[main.py]"]
end

node_user(("User"))
node_steam(("Steam client"))
node_online_sources{{"Online sources"}}

node_user -->|"uses"| node_webview
node_webview -->|"renders"| node_ui_logic
node_ui_logic -->|"calls API"| node_desktop_api
node_desktop_api -->|"delegates"| node_backend
node_desktop_api -->|"controls"| node_launcher_core
node_ui_logic -->|"searches"| node_game_search
node_ui_logic -->|"starts install"| node_manifest_work
node_desktop_api -->|"dispatches"| node_game_search
node_desktop_api -->|"runs task"| node_manifest_work
node_manifest_work -->|"fetches resources"| node_online_sources
node_manifest_work -->|"writes files"| node_managed_files
node_ui_logic -->|"shows library"| node_game_library
node_desktop_api -->|"serves library"| node_game_library
node_ui_logic -->|"controls launch"| node_multiplayer
node_multiplayer -->|"launches game"| node_steam
node_desktop_api -->|"manages files"| node_steamtools
node_ui_logic -->|"changes file state"| node_steamtools
node_ui_logic -->|"edits settings"| node_settings_ui
node_settings_ui -->|"reads and saves"| node_desktop_api
node_desktop_api -->|"reads and writes"| node_config
node_desktop_api -->|"checks updates"| node_updates
node_updates -->|"checks releases"| node_online_sources
node_ui_logic -->|"polls status"| node_logs
node_desktop_api -->|"records output"| node_logs
node_backend -->|"detects install"| node_steam

click node_webview "https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/gui/index.html"
click node_ui_logic "https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/gui/js/app.js"
click node_desktop_api "https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/main.py"
click node_launcher_core "https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/main.py"
click node_backend "https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/backend.py"
click node_config "https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/config.json"
click node_game_library "https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/backend.py"
click node_game_search "https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/backend.py"
click node_manifest_work "https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/backend.py"
click node_managed_files "https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/backend.py"
click node_multiplayer "https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/main.py"
click node_steamtools "https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/backend.py"
click node_settings_ui "https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/gui/js/app.js"
click node_updates "https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/backend.py"
click node_logs "https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/main.py"

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_webview,node_ui_logic,node_user,node_steam toneBlue
class node_desktop_api,node_launcher_core,node_backend toneAmber
class node_game_library,node_game_search,node_manifest_work,node_managed_files,node_multiplayer toneMint
class node_config,node_steamtools,node_settings_ui,node_updates,node_logs toneRose
class node_online_sources toneIndigo
```

## Components

### Desktop interface

- [WebView pages](https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/gui/index.html): `gui/index.html`
- [UI interactions](https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/gui/js/app.js): `gui/js/app.js`

### Desktop services

- [Desktop API](https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/main.py): `main.py`
- [Launcher core](https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/main.py): `main.py`
- [Business backend](https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/backend.py): `backend.py`

### Game workflows

- [Game library](https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/backend.py): `backend.py`
- [AppID search](https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/backend.py): `backend.py`
- [Manifest processing](https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/backend.py): `backend.py`
- [Managed files](https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/backend.py): `backend.py`
- [Multiplayer launch](https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/main.py): `main.py`

### Management and operations

- [User settings](https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/config.json): `config.json`
- [SteamTools files](https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/backend.py): `backend.py`
- [Settings and theme](https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/gui/js/app.js): `gui/js/app.js`
- [Updates and notices](https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/backend.py): `backend.py`
- [Logs and task status](https://github.com/pvzcxw/cai-install-reborn-opensrc/blob/main/main.py): `main.py`

### Other components

- **User**
- **Steam client**
- **Online sources**

## Connections

- User → WebView pages: uses (evidence: `README.md`)
- WebView pages → UI interactions: renders (evidence: `README.md`)
- UI interactions → Desktop API: calls API (evidence: `gui/js/app.js`)
- Desktop API → Business backend: delegates (evidence: `main.py`)
- Desktop API → Launcher core: controls (evidence: `main.py`)
- UI interactions → AppID search: searches (evidence: `gui/js/app.js`)
- UI interactions → Manifest processing: starts install (evidence: `gui/js/app.js`)
- Desktop API → AppID search: dispatches (evidence: `README.md`)
- Desktop API → Manifest processing: runs task (evidence: `main.py`)
- Manifest processing → Online sources: fetches resources (evidence: `README.md`)
- Manifest processing → Managed files: writes files (evidence: `README.md`)
- UI interactions → Game library: shows library (evidence: `README.md`)
- Desktop API → Game library: serves library (evidence: `README.md`)
- UI interactions → Multiplayer launch: controls launch (evidence: `gui/js/app.js`)
- Multiplayer launch → Steam client: launches game (evidence: `README.md`)
- Desktop API → SteamTools files: manages files (evidence: `README.md`)
- UI interactions → SteamTools files: changes file state (evidence: `gui/js/app.js`)
- UI interactions → Settings and theme: edits settings (evidence: `README.md`)
- Settings and theme → Desktop API: reads and saves (evidence: `gui/js/app.js`)
- Desktop API → User settings: reads and writes (evidence: `README.md`)
- Desktop API → Updates and notices: checks updates (evidence: `README.md`)
- Updates and notices → Online sources: checks releases (evidence: `README.md`)
- UI interactions → Logs and task status: polls status (evidence: `gui/js/app.js`)
- Desktop API → Logs and task status: records output (evidence: `main.py`)
- Business backend → Steam client: detects install (evidence: `backend.py`)
