# enlin06/weissschwarzrose_deck_builder architecture

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

- Interactive diagram: https://gitdiagram.com/enlin06/weissschwarzrose_deck_builder
- Repository: https://github.com/enlin06/weissschwarzrose_deck_builder

## Overview

這是以 PyQt5 製作的 Weiß Schwarz Rose 牌組編輯器。主要流程是使用者選系列、篩選並檢視卡片，將卡片加入牌組，再預覽及匯出牌組圖片。另有資料擷取與卡圖下載工具，用官方卡片網站產生 JSON 資料及本機卡圖。關係以 README 和已提供的程式片段為據；未取樣的介面程式細節不作推測。

Main entry points: [`viewer_V2.py`](https://github.com/enlin06/weissschwarzrose_deck_builder/blob/main/viewer_V2.py) (卡片介面), [`deck_creater.py`](https://github.com/enlin06/weissschwarzrose_deck_builder/blob/main/deck_creater.py) (牌組圖片生成), [`download_img.py`](https://github.com/enlin06/weissschwarzrose_deck_builder/blob/main/download_img.py) (卡圖下載), [`json`](https://github.com/enlin06/weissschwarzrose_deck_builder/tree/main/json) (卡片 JSON)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_editor["牌組編輯器"]
  node_viewer["卡片介面<br/>[viewer_V2.py]"]
  node_filters["卡片篩選<br/>[viewer_V2.py]"]
  node_details["卡片詳情<br/>[viewer_V2.py]"]
  node_deck_state["牌組編輯<br/>[viewer_V2.py]"]
end

subgraph group_catalog["卡片目錄"]
  node_json_store[("卡片 JSON")]
  node_image_store[("卡圖檔案")]
end

subgraph group_deck["牌組輸出"]
  node_deck_creator["牌組圖片生成<br/>[deck_creater.py]"]
end

subgraph group_ingestion["資料擷取"]
  node_data_builder["卡片資料擷取<br/>[databuild.py]"]
  node_image_downloader["卡圖下載<br/>[download_img.py]"]
end

node_user(("使用者"))
node_web["官方卡片網站"]

node_user -->|"操作"| node_viewer
node_viewer -->|"提供篩選"| node_filters
node_viewer -->|"讀取資料"| node_json_store
node_viewer -->|"顯示卡圖"| node_image_store
node_viewer -->|"開啟詳情"| node_details
node_viewer -->|"管理牌組"| node_deck_state
node_viewer -->|"呼叫生成"| node_deck_creator
node_deck_state -->|"提供牌組"| node_deck_creator
node_deck_creator -->|"讀取卡圖"| node_image_store
node_deck_creator -->|"匯出圖片"| node_user
node_data_builder -->|"擷取卡片"| node_web
node_data_builder -->|"寫入資料"| node_json_store
node_image_downloader -->|"讀取圖片網址"| node_json_store
node_image_downloader -->|"下載卡圖"| node_web
node_image_downloader -->|"儲存卡圖"| node_image_store

click node_viewer "https://github.com/enlin06/weissschwarzrose_deck_builder/blob/main/viewer_V2.py"
click node_filters "https://github.com/enlin06/weissschwarzrose_deck_builder/blob/main/viewer_V2.py"
click node_details "https://github.com/enlin06/weissschwarzrose_deck_builder/blob/main/viewer_V2.py"
click node_deck_state "https://github.com/enlin06/weissschwarzrose_deck_builder/blob/main/viewer_V2.py"
click node_json_store "https://github.com/enlin06/weissschwarzrose_deck_builder/tree/main/json"
click node_image_store "https://github.com/enlin06/weissschwarzrose_deck_builder/tree/main/image"
click node_deck_creator "https://github.com/enlin06/weissschwarzrose_deck_builder/blob/main/deck_creater.py"
click node_data_builder "https://github.com/enlin06/weissschwarzrose_deck_builder/blob/main/databuild.py"
click node_image_downloader "https://github.com/enlin06/weissschwarzrose_deck_builder/blob/main/download_img.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_viewer,node_filters,node_details,node_deck_state toneBlue
class node_json_store,node_image_store toneAmber
class node_deck_creator toneMint
class node_data_builder,node_image_downloader toneRose
class node_user,node_web toneIndigo
```

## Components

### 牌組編輯器

- [卡片介面](https://github.com/enlin06/weissschwarzrose_deck_builder/blob/main/viewer_V2.py): `viewer_V2.py`
- [卡片篩選](https://github.com/enlin06/weissschwarzrose_deck_builder/blob/main/viewer_V2.py): `viewer_V2.py`
- [卡片詳情](https://github.com/enlin06/weissschwarzrose_deck_builder/blob/main/viewer_V2.py): `viewer_V2.py`
- [牌組編輯](https://github.com/enlin06/weissschwarzrose_deck_builder/blob/main/viewer_V2.py): `viewer_V2.py`

### 卡片目錄

- [卡片 JSON](https://github.com/enlin06/weissschwarzrose_deck_builder/tree/main/json): `json`
- [卡圖檔案](https://github.com/enlin06/weissschwarzrose_deck_builder/tree/main/image): `image`

### 牌組輸出

- [牌組圖片生成](https://github.com/enlin06/weissschwarzrose_deck_builder/blob/main/deck_creater.py): `deck_creater.py`

### 資料擷取

- [卡片資料擷取](https://github.com/enlin06/weissschwarzrose_deck_builder/blob/main/databuild.py): `databuild.py`
- [卡圖下載](https://github.com/enlin06/weissschwarzrose_deck_builder/blob/main/download_img.py): `download_img.py`

### Other components

- **使用者**
- **官方卡片網站**

## Connections

- 使用者 → 卡片介面: 操作 (evidence: `README.md`)
- 卡片介面 → 卡片篩選: 提供篩選 (evidence: `viewer_V2.py`)
- 卡片介面 → 卡片 JSON: 讀取資料 (evidence: `README.md`)
- 卡片介面 → 卡圖檔案: 顯示卡圖 (evidence: `viewer_V2.py`)
- 卡片介面 → 卡片詳情: 開啟詳情 (evidence: `viewer_V2.py`)
- 卡片介面 → 牌組編輯: 管理牌組 (evidence: `viewer_V2.py`)
- 卡片介面 → 牌組圖片生成: 呼叫生成 (evidence: `viewer_V2.py`)
- 牌組編輯 → 牌組圖片生成: 提供牌組 (evidence: `viewer_V2.py`)
- 牌組圖片生成 → 卡圖檔案: 讀取卡圖 (evidence: `deck_creater.py`)
- 牌組圖片生成 → 使用者: 匯出圖片 (evidence: `README.md`)
- 卡片資料擷取 → 官方卡片網站: 擷取卡片 (evidence: `databuild.py`)
- 卡片資料擷取 → 卡片 JSON: 寫入資料 (evidence: `databuild.py`)
- 卡圖下載 → 卡片 JSON: 讀取圖片網址 (evidence: `download_img.py`)
- 卡圖下載 → 官方卡片網站: 下載卡圖 (evidence: `download_img.py`)
- 卡圖下載 → 卡圖檔案: 儲存卡圖 (evidence: `download_img.py`)
