# sjcoding0130/cdn architecture

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

- Interactive diagram: https://gitdiagram.com/sjcoding0130/cdn
- Repository: https://github.com/sjcoding0130/cdn

## Overview

This repository collects Live A Hero game assets for use by the Wiki. Its main workflow downloads official bundles, extracts assets, and preprocesses selected files; the AssetStudio wrapper and UnityPy script provide separate extraction routes. The README documents the wrapper’s folder-based CLI, while the downloader’s source shows its network and file operations. Cleanup tools are independent command-line utilities. No publishing or upload implementation is shown, so the Wiki destination is represented as an intended consumer, not an automated integration.

Main entry points: [`tools/download-official-bundles.ts`](https://github.com/sjcoding0130/cdn/blob/main/tools/download-official-bundles.ts) (Bundle downloader), [`AssetStudioWrapper/AssetStudioConsole/Program.cs`](https://github.com/sjcoding0130/cdn/blob/main/AssetStudioWrapper/AssetStudioConsole/Program.cs) (AssetStudio CLI), [`extract.py`](https://github.com/sjcoding0130/cdn/blob/main/extract.py) (UnityPy extractor), [`preprocess.py`](https://github.com/sjcoding0130/cdn/blob/main/preprocess.py) (Asset preprocessor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Bundle collection"]
  node_version_api["Version API"]
  node_bundle_cdn["Bundle CDN"]
  node_downloader["Bundle downloader"]
  node_bundle_files[("Downloaded bundles")]
  node_asset_list["Asset list<br/>[assetList.Android]"]
end

subgraph group_extraction["Asset extraction"]
  node_assetstudio["AssetStudio CLI<br/>[Program.cs]"]
  node_unitypy["UnityPy extractor<br/>[extract.py]"]
  node_extracted_assets[("Extracted assets")]
end

subgraph group_processing["Asset processing"]
  node_preprocessor["Asset preprocessor<br/>[preprocess.py]"]
  node_processed_assets[("Processed assets")]
end

subgraph group_curation["Asset curation"]
  node_duplicate_remover["Duplicate remover"]
  node_sensitive_filter["Sensitive asset filter"]
  node_finish_watcher["Finish watcher"]
end

node_operator(("Operator"))
node_wiki_assets["Wiki assets"]

node_operator -->|"runs"| node_downloader
node_downloader -->|"requests version"| node_version_api
node_downloader -->|"fetches list and bundles"| node_bundle_cdn
node_downloader -->|"updates"| node_asset_list
node_downloader -->|"writes bundles"| node_bundle_files
node_operator -.->|"runs"| node_assetstudio
node_assetstudio -->|"exports assets"| node_extracted_assets
node_operator -->|"runs"| node_unitypy
node_unitypy -->|"writes assets"| node_extracted_assets
node_operator -.->|"runs"| node_preprocessor
node_preprocessor -->|"rewrites images and JSON"| node_processed_assets
node_operator -->|"runs"| node_duplicate_remover
node_operator -->|"runs"| node_sensitive_filter
node_operator -->|"runs"| node_finish_watcher
node_duplicate_remover -.->|"removes duplicates"| node_processed_assets
node_sensitive_filter -.->|"filters folders"| node_processed_assets
node_processed_assets -.->|"intended for"| node_wiki_assets

click node_downloader "https://github.com/sjcoding0130/cdn/blob/main/tools/download-official-bundles.ts"
click node_asset_list "https://github.com/sjcoding0130/cdn/blob/main/version/assetList.Android"
click node_assetstudio "https://github.com/sjcoding0130/cdn/blob/main/AssetStudioWrapper/AssetStudioConsole/Program.cs"
click node_unitypy "https://github.com/sjcoding0130/cdn/blob/main/extract.py"
click node_preprocessor "https://github.com/sjcoding0130/cdn/blob/main/preprocess.py"
click node_duplicate_remover "https://github.com/sjcoding0130/cdn/blob/main/tools/remove-duplicated-assets.ts"
click node_sensitive_filter "https://github.com/sjcoding0130/cdn/blob/main/tools/remove-sensitive-assets.ts"
click node_finish_watcher "https://github.com/sjcoding0130/cdn/blob/main/tools/watch-finish-indicator.ts"

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_version_api,node_bundle_cdn,node_downloader,node_bundle_files,node_asset_list toneBlue
class node_assetstudio,node_unitypy,node_extracted_assets toneAmber
class node_preprocessor,node_processed_assets toneMint
class node_duplicate_remover,node_sensitive_filter,node_finish_watcher toneRose
class node_operator,node_wiki_assets toneIndigo
```

## Components

### Bundle collection

- **Version API**
- **Bundle CDN**
- [Bundle downloader](https://github.com/sjcoding0130/cdn/blob/main/tools/download-official-bundles.ts): `tools/download-official-bundles.ts`
- **Downloaded bundles**
- [Asset list](https://github.com/sjcoding0130/cdn/blob/main/version/assetList.Android): `version/assetList.Android`

### Asset extraction

- [AssetStudio CLI](https://github.com/sjcoding0130/cdn/blob/main/AssetStudioWrapper/AssetStudioConsole/Program.cs): `AssetStudioWrapper/AssetStudioConsole/Program.cs`
- [UnityPy extractor](https://github.com/sjcoding0130/cdn/blob/main/extract.py): `extract.py`
- **Extracted assets**

### Asset processing

- [Asset preprocessor](https://github.com/sjcoding0130/cdn/blob/main/preprocess.py): `preprocess.py`
- **Processed assets**

### Asset curation

- [Duplicate remover](https://github.com/sjcoding0130/cdn/blob/main/tools/remove-duplicated-assets.ts): `tools/remove-duplicated-assets.ts`
- [Sensitive asset filter](https://github.com/sjcoding0130/cdn/blob/main/tools/remove-sensitive-assets.ts): `tools/remove-sensitive-assets.ts`
- [Finish watcher](https://github.com/sjcoding0130/cdn/blob/main/tools/watch-finish-indicator.ts): `tools/watch-finish-indicator.ts`

### Other components

- **Operator**
- **Wiki assets**

## Connections

- Operator → Bundle downloader: runs
- Bundle downloader → Version API: requests version (evidence: `tools/download-official-bundles.ts`)
- Bundle downloader → Bundle CDN: fetches list and bundles (evidence: `tools/download-official-bundles.ts`)
- Bundle downloader → Asset list: updates (evidence: `tools/download-official-bundles.ts`)
- Bundle downloader → Downloaded bundles: writes bundles (evidence: `tools/download-official-bundles.ts`)
- Operator → AssetStudio CLI: runs (evidence: `README.md`)
- AssetStudio CLI → Extracted assets: exports assets (evidence: `AssetStudioWrapper/AssetStudioConsole/Program.cs`)
- Operator → UnityPy extractor: runs (evidence: `extract.py`)
- UnityPy extractor → Extracted assets: writes assets (evidence: `extract.py`)
- Operator → Asset preprocessor: runs
- Asset preprocessor → Processed assets: rewrites images and JSON (evidence: `preprocess.py`)
- Operator → Duplicate remover: runs (evidence: `tools/remove-duplicated-assets.ts`)
- Operator → Sensitive asset filter: runs (evidence: `tools/remove-sensitive-assets.ts`)
- Operator → Finish watcher: runs (evidence: `tools/watch-finish-indicator.ts`)
- Duplicate remover → Processed assets: removes duplicates
- Sensitive asset filter → Processed assets: filters folders
- Processed assets → Wiki assets: intended for (evidence: `README.md`)
