# killa0132/calaplayupper architecture

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

- Interactive diagram: https://gitdiagram.com/killa0132/calaplayupper
- Repository: https://github.com/killa0132/calaplayupper
- Video tour (about a minute): https://gitdiagram.com/killa0132/calaplayupper/video

## Overview

CalaplayUpper is a desktop tool for turning user-supplied images and audio into installable CalaPlayer patch containers, with a second workflow for combining existing Mods. The main route is select assets and game paths → validate and build → install or roll back; the merge route discovers selected Mods, checks conflicts, creates one container, and can install it. The GUI is the primary interface, with a CLI alternative. Internal asset-processing stages are shown where the index or excerpts support them; some GUI wiring and merge internals were not sampled.

Main entry points: [`core/builder.py`](https://github.com/killa0132/calaplayupper/blob/main/core/builder.py) (Single-package builder), [`gui/app.py`](https://github.com/killa0132/calaplayupper/blob/main/gui/app.py) (GUI backend), [`gui/tasks.py`](https://github.com/killa0132/calaplayupper/blob/main/gui/tasks.py) (Task workers), [`core/merger.py`](https://github.com/killa0132/calaplayupper/blob/main/core/merger.py) (Merge engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interfaces"]
  node_desktop["Desktop host<br/>[desktop.py]"]
  node_backend["GUI backend<br/>[app.py]"]
  node_frontend["Vue interface<br/>[App.vue]"]
  node_api["Frontend API<br/>[api.js]"]
  node_preferences[("Preferences<br/>[prefs.py]")]
end

subgraph group_workflow["Build and install"]
  node_task_worker["Task workers<br/>[tasks.py]"]
  node_builder["Single-package builder<br/>[builder.py]"]
  node_deploy["Patch deployment<br/>[deploy.py]"]
  node_cli["CLI entry<br/>[build_srcm.py]"]
end

subgraph group_merge["Mod merging"]
  node_mod_discovery["Mod discovery<br/>[mods.py]"]
  node_merger["Merge engine<br/>[merger.py]"]
end

subgraph group_engine["Asset engine"]
  node_atlas["Atlas processing<br/>[atlas.py]"]
  node_atlas_cells["Atlas cell mapping<br/>[atlas_cells.py]"]
  node_texture["Texture processing<br/>[texture.py]"]
  node_bc1["BC1 encoding<br/>[bc1.py]"]
  node_data_assets["DataAsset editing<br/>[da.py]"]
  node_audio["Audio utilities<br/>[wavutil.py]"]
end

subgraph group_tools["Tool integration"]
  node_kit["Tool wrappers<br/>[kit.py]"]
  node_shared["Shared runtime<br/>[common.py]"]
end

node_user(("User"))
node_external_tools["Unreal asset tools"]
node_game_files[("Game files")]

node_user -->|"launches"| node_desktop
node_desktop -->|"hosts"| node_backend
node_frontend -.->|"requests"| node_api
node_api -.->|"calls"| node_backend
node_backend -->|"reads and writes"| node_preferences
node_backend -->|"discovers Mods"| node_mod_discovery
node_backend -->|"starts tasks"| node_task_worker
node_task_worker -->|"runs build"| node_builder
node_task_worker -->|"runs merge"| node_merger
node_task_worker -->|"installs patch"| node_deploy
node_user -->|"runs command"| node_cli
node_cli -->|"builds package"| node_builder
node_builder -->|"processes atlas"| node_atlas
node_builder -->|"maps cells"| node_atlas_cells
node_builder -->|"builds textures"| node_texture
node_builder -->|"encodes images"| node_bc1
node_builder -->|"appends rows"| node_data_assets
node_builder -->|"processes audio"| node_audio
node_builder -->|"uses tools"| node_kit
node_builder -->|"logs and validates"| node_shared
node_merger -->|"edits tables"| node_data_assets
node_merger -->|"runs tools"| node_kit
node_kit -->|"invokes"| node_external_tools
node_builder -->|"reads game data"| node_game_files
node_deploy -->|"installs or restores"| node_game_files
node_merger -->|"reads base files"| node_game_files

click node_desktop "https://github.com/killa0132/calaplayupper/blob/main/gui/desktop.py"
click node_backend "https://github.com/killa0132/calaplayupper/blob/main/gui/app.py"
click node_frontend "https://github.com/killa0132/calaplayupper/blob/main/gui/frontend/src/App.vue"
click node_api "https://github.com/killa0132/calaplayupper/blob/main/gui/frontend/src/api.js"
click node_preferences "https://github.com/killa0132/calaplayupper/blob/main/gui/prefs.py"
click node_task_worker "https://github.com/killa0132/calaplayupper/blob/main/gui/tasks.py"
click node_builder "https://github.com/killa0132/calaplayupper/blob/main/core/builder.py"
click node_deploy "https://github.com/killa0132/calaplayupper/blob/main/core/deploy.py"
click node_cli "https://github.com/killa0132/calaplayupper/blob/main/cli/build_srcm.py"
click node_mod_discovery "https://github.com/killa0132/calaplayupper/blob/main/gui/mods.py"
click node_merger "https://github.com/killa0132/calaplayupper/blob/main/core/merger.py"
click node_atlas "https://github.com/killa0132/calaplayupper/blob/main/core/atlas.py"
click node_atlas_cells "https://github.com/killa0132/calaplayupper/blob/main/core/atlas_cells.py"
click node_texture "https://github.com/killa0132/calaplayupper/blob/main/core/texture.py"
click node_bc1 "https://github.com/killa0132/calaplayupper/blob/main/core/bc1.py"
click node_data_assets "https://github.com/killa0132/calaplayupper/blob/main/core/da.py"
click node_audio "https://github.com/killa0132/calaplayupper/blob/main/core/wavutil.py"
click node_kit "https://github.com/killa0132/calaplayupper/blob/main/core/kit.py"
click node_shared "https://github.com/killa0132/calaplayupper/blob/main/core/common.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_desktop,node_backend,node_frontend,node_api,node_preferences,node_user toneBlue
class node_task_worker,node_builder,node_deploy,node_cli,node_game_files toneAmber
class node_mod_discovery,node_merger toneMint
class node_atlas,node_atlas_cells,node_texture,node_bc1,node_data_assets,node_audio toneRose
class node_kit,node_shared,node_external_tools toneIndigo
```

## Components

### User interfaces

- [Desktop host](https://github.com/killa0132/calaplayupper/blob/main/gui/desktop.py): `gui/desktop.py`
- [GUI backend](https://github.com/killa0132/calaplayupper/blob/main/gui/app.py): `gui/app.py`
- [Vue interface](https://github.com/killa0132/calaplayupper/blob/main/gui/frontend/src/App.vue): `gui/frontend/src/App.vue`
- [Frontend API](https://github.com/killa0132/calaplayupper/blob/main/gui/frontend/src/api.js): `gui/frontend/src/api.js`
- [Preferences](https://github.com/killa0132/calaplayupper/blob/main/gui/prefs.py): `gui/prefs.py`

### Build and install

- [Task workers](https://github.com/killa0132/calaplayupper/blob/main/gui/tasks.py): `gui/tasks.py`
- [Single-package builder](https://github.com/killa0132/calaplayupper/blob/main/core/builder.py): `core/builder.py`
- [Patch deployment](https://github.com/killa0132/calaplayupper/blob/main/core/deploy.py): `core/deploy.py`
- [CLI entry](https://github.com/killa0132/calaplayupper/blob/main/cli/build_srcm.py): `cli/build_srcm.py`

### Mod merging

- [Mod discovery](https://github.com/killa0132/calaplayupper/blob/main/gui/mods.py): `gui/mods.py`
- [Merge engine](https://github.com/killa0132/calaplayupper/blob/main/core/merger.py): `core/merger.py`

### Asset engine

- [Atlas processing](https://github.com/killa0132/calaplayupper/blob/main/core/atlas.py): `core/atlas.py`
- [Atlas cell mapping](https://github.com/killa0132/calaplayupper/blob/main/core/atlas_cells.py): `core/atlas_cells.py`
- [Texture processing](https://github.com/killa0132/calaplayupper/blob/main/core/texture.py): `core/texture.py`
- [BC1 encoding](https://github.com/killa0132/calaplayupper/blob/main/core/bc1.py): `core/bc1.py`
- [DataAsset editing](https://github.com/killa0132/calaplayupper/blob/main/core/da.py): `core/da.py`
- [Audio utilities](https://github.com/killa0132/calaplayupper/blob/main/core/wavutil.py): `core/wavutil.py`

### Tool integration

- [Tool wrappers](https://github.com/killa0132/calaplayupper/blob/main/core/kit.py): `core/kit.py`
- [Shared runtime](https://github.com/killa0132/calaplayupper/blob/main/core/common.py): `core/common.py`

### Other components

- **User**
- **Unreal asset tools**
- **Game files**

## Connections

- User → Desktop host: launches (evidence: `README.md`)
- Desktop host → GUI backend: hosts (evidence: `gui/desktop.py`)
- Vue interface → Frontend API: requests (evidence: `gui/frontend/src/App.vue`)
- Frontend API → GUI backend: calls
- GUI backend → Preferences: reads and writes (evidence: `gui/app.py`)
- GUI backend → Mod discovery: discovers Mods (evidence: `gui/app.py`)
- GUI backend → Task workers: starts tasks (evidence: `gui/app.py`)
- Task workers → Single-package builder: runs build (evidence: `gui/tasks.py`)
- Task workers → Merge engine: runs merge (evidence: `gui/tasks.py`)
- Task workers → Patch deployment: installs patch (evidence: `gui/tasks.py`)
- User → CLI entry: runs command (evidence: `README.md`)
- CLI entry → Single-package builder: builds package (evidence: `cli/build_srcm.py`)
- Single-package builder → Atlas processing: processes atlas (evidence: `core/builder.py`)
- Single-package builder → Atlas cell mapping: maps cells (evidence: `core/builder.py`)
- Single-package builder → Texture processing: builds textures (evidence: `core/builder.py`)
- Single-package builder → BC1 encoding: encodes images (evidence: `core/builder.py`)
- Single-package builder → DataAsset editing: appends rows (evidence: `core/builder.py`)
- Single-package builder → Audio utilities: processes audio (evidence: `core/builder.py`)
- Single-package builder → Tool wrappers: uses tools (evidence: `core/builder.py`)
- Single-package builder → Shared runtime: logs and validates (evidence: `core/builder.py`)
- Merge engine → DataAsset editing: edits tables (evidence: `core/merger.py`)
- Merge engine → Tool wrappers: runs tools (evidence: `core/merger.py`)
- Tool wrappers → Unreal asset tools: invokes (evidence: `core/kit.py`)
- Single-package builder → Game files: reads game data (evidence: `README.md`)
- Patch deployment → Game files: installs or restores (evidence: `README.md`)
- Merge engine → Game files: reads base files (evidence: `README.md`)
