# coluxhu/bg7ldb-tool-hub architecture

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

- Interactive diagram: https://gitdiagram.com/coluxhu/bg7ldb-tool-hub
- Repository: https://github.com/coluxhu/bg7ldb-tool-hub

## Overview

BG7LDB Tools is a monorepo of independently usable web tools, not one shared processing pipeline. Users enter through the tool hub or open an app directly. The clearest domain workflows are Chinese text/telecode conversion and table-tennis doubles match scoring; luggage-tag creation is a separate tool. The telecode source excerpt shows its database and corpus loading and its call to Han conversion. The table-tennis excerpt shows match phases and browser state persistence. Other app capabilities are represented at app level because their runtime sources were not sampled.

Main entry points: [`apps/chinese-telecode/src/app.js`](https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/chinese-telecode/src/app.js) (Telecode interface), [`apps/table-tennis-doubles/src/app.js`](https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/table-tennis-doubles/src/app.js) (Match scorer), [`apps/tool-hub`](https://github.com/coluxhu/bg7ldb-tool-hub/tree/main/apps/tool-hub) (Tool Hub), [`apps/chinese-telecode/src/han-conversion.js`](https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/chinese-telecode/src/han-conversion.js) (Han conversion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_hub["Tool Directory"]
  node_toolhub["Tool Hub"]
end

subgraph group_telecode["Telecode Conversion"]
  node_teleapp["Telecode interface<br/>[app.js]"]
  node_textprep["Text preparation<br/>[app.js]"]
  node_encode["Encode and decode<br/>[app.js]"]
  node_results["Results and export<br/>[app.js]"]
  node_hanconvert["Han conversion<br/>[han-conversion.js]"]
  node_codedb[("Telegraph code data")]
  node_corpora["Sample corpora<br/>[manifest.json]"]
end

subgraph group_match["Doubles Scoring"]
  node_matchapp["Match scorer<br/>[app.js]"]
  node_matchstate[("Saved match state")]
end

subgraph group_luggage["Luggage Tag"]
  node_tagapp["Luggage Tag<br/>[script.js]"]
end

node_visitor(("Tool user"))

node_visitor -->|"opens"| node_toolhub
node_visitor -->|"uses"| node_tagapp
node_visitor -->|"uses"| node_matchapp
node_visitor -->|"uses"| node_teleapp
node_visitor -->|"enters text"| node_textprep
node_teleapp -->|"loads"| node_codedb
node_teleapp -->|"loads"| node_corpora
node_textprep -->|"converts variants"| node_hanconvert
node_teleapp -->|"runs conversion"| node_encode
node_encode -->|"renders output"| node_results
node_matchapp -->|"reads and writes"| node_matchstate

click node_toolhub "https://github.com/coluxhu/bg7ldb-tool-hub/tree/main/apps/tool-hub"
click node_tagapp "https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/luggage-tag/script.js"
click node_matchapp "https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/table-tennis-doubles/src/app.js"
click node_teleapp "https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/chinese-telecode/src/app.js"
click node_textprep "https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/chinese-telecode/src/app.js"
click node_encode "https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/chinese-telecode/src/app.js"
click node_results "https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/chinese-telecode/src/app.js"
click node_hanconvert "https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/chinese-telecode/src/han-conversion.js"
click node_codedb "https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/chinese-telecode/public/data/telegraph_compat_db.supplemented.json"
click node_corpora "https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/chinese-telecode/public/corpora/manifest.json"

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_toolhub,node_visitor toneBlue
class node_teleapp,node_textprep,node_encode,node_results,node_hanconvert,node_codedb,node_corpora toneAmber
class node_matchapp,node_matchstate toneMint
class node_tagapp toneRose
```

## Components

### Tool Directory

- [Tool Hub](https://github.com/coluxhu/bg7ldb-tool-hub/tree/main/apps/tool-hub): `apps/tool-hub`

### Telecode Conversion

- [Telecode interface](https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/chinese-telecode/src/app.js): `apps/chinese-telecode/src/app.js`
- [Text preparation](https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/chinese-telecode/src/app.js): `apps/chinese-telecode/src/app.js`
- [Encode and decode](https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/chinese-telecode/src/app.js): `apps/chinese-telecode/src/app.js`
- [Results and export](https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/chinese-telecode/src/app.js): `apps/chinese-telecode/src/app.js`
- [Han conversion](https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/chinese-telecode/src/han-conversion.js): `apps/chinese-telecode/src/han-conversion.js`
- [Telegraph code data](https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/chinese-telecode/public/data/telegraph_compat_db.supplemented.json): `apps/chinese-telecode/public/data/telegraph_compat_db.supplemented.json`
- [Sample corpora](https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/chinese-telecode/public/corpora/manifest.json): `apps/chinese-telecode/public/corpora/manifest.json`

### Doubles Scoring

- [Match scorer](https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/table-tennis-doubles/src/app.js): `apps/table-tennis-doubles/src/app.js`
- **Saved match state**

### Luggage Tag

- [Luggage Tag](https://github.com/coluxhu/bg7ldb-tool-hub/blob/main/apps/luggage-tag/script.js): `apps/luggage-tag/script.js`

### Other components

- **Tool user**

## Connections

- Tool user → Tool Hub: opens (evidence: `README.md`)
- Tool user → Luggage Tag: uses (evidence: `README.md`)
- Tool user → Match scorer: uses (evidence: `README.md`)
- Tool user → Telecode interface: uses (evidence: `README.md`)
- Tool user → Text preparation: enters text (evidence: `apps/chinese-telecode/src/app.js`)
- Telecode interface → Telegraph code data: loads (evidence: `apps/chinese-telecode/src/app.js`)
- Telecode interface → Sample corpora: loads (evidence: `apps/chinese-telecode/src/app.js`)
- Text preparation → Han conversion: converts variants (evidence: `apps/chinese-telecode/src/app.js`)
- Telecode interface → Encode and decode: runs conversion (evidence: `apps/chinese-telecode/src/app.js`)
- Encode and decode → Results and export: renders output (evidence: `apps/chinese-telecode/src/app.js`)
- Match scorer → Saved match state: reads and writes (evidence: `apps/table-tennis-doubles/src/app.js`)
