# ysfztpp/termquake architecture

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

- Interactive diagram: https://gitdiagram.com/ysfztpp/termquake
- Repository: https://github.com/ysfztpp/termquake

## Overview

TermQuake is a multilingual disaster-response terminology product: people search or browse an entry, choose a language pair, and present the term to someone else, including in offline use. Its repository also contains the editorial data workflow: SQL-backed terminology is built and maintained, reviewed or supplemented, then exported for the website and downloadable formats. The README documents several workflows not visible in sampled implementation; those links are cited to it. The app excerpt is partial, so its data-loading path is not asserted.

Main entry points: [`site/src/app.tsx`](https://github.com/ysfztpp/termquake/blob/main/site/src/app.tsx) (Search and browse app), [`src/termquake/cli.py`](https://github.com/ysfztpp/termquake/blob/main/src/termquake/cli.py) (TermQuake commands), [`src/termquake/db.py`](https://github.com/ysfztpp/termquake/blob/main/src/termquake/db.py) (Build and dump), [`src/termquake/export.py`](https://github.com/ysfztpp/termquake/blob/main/src/termquake/export.py) (Data export)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Offline terminology site"]
  node_app["Search and browse app<br/>[app.tsx]"]
  node_search["Search and folding<br/>[search.ts]"]
  node_entry["Entry presentation<br/>[entry-row.tsx]"]
  node_show["Full-screen term<br/>[show-mode.tsx]"]
  node_suggest["Suggestion form<br/>[suggest.tsx]"]
  node_coverage["Language coverage<br/>[coverage.tsx]"]
  node_preferences["Saved preferences<br/>[storage.ts]"]
  node_translations["Interface translations<br/>[i18n.ts]"]
  node_pwa["Offline support<br/>[pwa.ts]"]
end

subgraph group_data["Terminology data"]
  node_sqlsource[("Canonical SQL data")]
  node_schema["Database schema<br/>[schema.sql]"]
  node_legacy["Sheet snapshot"]
  node_ai_data["AI suggestions"]
end

subgraph group_editorial["Editorial workflow"]
  node_review_data["Review suggestions"]
  node_cli["TermQuake commands<br/>[cli.py]"]
  node_database["Build and dump<br/>[db.py]"]
  node_sheet["Sheet import and fetch<br/>[sheet.py]"]
  node_clean["Text cleanup<br/>[clean.py]"]
  node_standardise["Term standardisation<br/>[standardise.py]"]
  node_review["Language review sheets<br/>[review.py]"]
  node_ai_import["AI data import<br/>[ai.py]"]
end

subgraph group_publishing["Publishing and exports"]
  node_export["Data export<br/>[export.py]"]
  node_webdata["Offline site data"]
  node_downloads["TBX CSV SQLite"]
end

node_user(("Interpreter or responder"))
node_github["GitHub issue"]

node_user -->|"searches or browses"| node_app
node_app -->|"searches terms"| node_search
node_app -->|"renders entries"| node_entry
node_app -->|"opens full screen"| node_show
node_app -->|"opens form"| node_suggest
node_app -->|"shows coverage"| node_coverage
node_app -->|"saves choices"| node_preferences
node_app -->|"checks offline state"| node_pwa
node_app -->|"uses interface text"| node_translations
node_suggest -->|"creates issue or text"| node_github
node_schema -->|"defines tables"| node_database
node_sqlsource -->|"builds SQLite"| node_database
node_database -->|"dumps edited data"| node_sqlsource
node_legacy -->|"imports snapshot"| node_cli
node_cli -->|"dispatches import"| node_sheet
node_cli -->|"dispatches build and dump"| node_database
node_cli -->|"dispatches cleanup"| node_clean
node_cli -->|"dispatches standardise"| node_standardise
node_cli -->|"dispatches review"| node_review
node_cli -->|"dispatches AI import"| node_ai_import
node_review_data -->|"provides suggestions"| node_review
node_ai_data -->|"provides suggestions"| node_ai_import
node_database -->|"exports database"| node_export
node_export -->|"writes app data"| node_webdata
node_export -->|"writes formats"| node_downloads
node_user -->|"downloads terminology"| node_downloads
node_sheet -.->|"fetches read-only sheet"| node_github

click node_app "https://github.com/ysfztpp/termquake/blob/main/site/src/app.tsx"
click node_search "https://github.com/ysfztpp/termquake/blob/main/site/src/search.ts"
click node_entry "https://github.com/ysfztpp/termquake/blob/main/site/src/components/entry-row.tsx"
click node_show "https://github.com/ysfztpp/termquake/blob/main/site/src/components/show-mode.tsx"
click node_suggest "https://github.com/ysfztpp/termquake/blob/main/site/src/components/suggest.tsx"
click node_coverage "https://github.com/ysfztpp/termquake/blob/main/site/src/components/coverage.tsx"
click node_preferences "https://github.com/ysfztpp/termquake/blob/main/site/src/storage.ts"
click node_translations "https://github.com/ysfztpp/termquake/blob/main/site/src/i18n.ts"
click node_pwa "https://github.com/ysfztpp/termquake/blob/main/site/src/pwa.ts"
click node_sqlsource "https://github.com/ysfztpp/termquake/tree/main/data/db"
click node_schema "https://github.com/ysfztpp/termquake/blob/main/db/schema.sql"
click node_legacy "https://github.com/ysfztpp/termquake/tree/main/data/legacy"
click node_ai_data "https://github.com/ysfztpp/termquake/tree/main/data/ai"
click node_review_data "https://github.com/ysfztpp/termquake/tree/main/data/review"
click node_cli "https://github.com/ysfztpp/termquake/blob/main/src/termquake/cli.py"
click node_database "https://github.com/ysfztpp/termquake/blob/main/src/termquake/db.py"
click node_sheet "https://github.com/ysfztpp/termquake/blob/main/src/termquake/sheet.py"
click node_clean "https://github.com/ysfztpp/termquake/blob/main/src/termquake/clean.py"
click node_standardise "https://github.com/ysfztpp/termquake/blob/main/src/termquake/standardise.py"
click node_review "https://github.com/ysfztpp/termquake/blob/main/src/termquake/review.py"
click node_ai_import "https://github.com/ysfztpp/termquake/blob/main/src/termquake/ai.py"
click node_export "https://github.com/ysfztpp/termquake/blob/main/src/termquake/export.py"
click node_webdata "https://github.com/ysfztpp/termquake/tree/main/site/public"
click node_downloads "https://github.com/ysfztpp/termquake/tree/main/site/public"

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_app,node_search,node_entry,node_show,node_suggest,node_coverage,node_preferences,node_translations,node_pwa toneBlue
class node_sqlsource,node_schema,node_legacy,node_ai_data toneAmber
class node_review_data,node_cli,node_database,node_sheet,node_clean,node_standardise,node_review,node_ai_import toneMint
class node_export,node_webdata,node_downloads toneRose
class node_user,node_github toneIndigo
```

## Components

### Offline terminology site

- [Search and browse app](https://github.com/ysfztpp/termquake/blob/main/site/src/app.tsx): `site/src/app.tsx`
- [Search and folding](https://github.com/ysfztpp/termquake/blob/main/site/src/search.ts): `site/src/search.ts`
- [Entry presentation](https://github.com/ysfztpp/termquake/blob/main/site/src/components/entry-row.tsx): `site/src/components/entry-row.tsx`
- [Full-screen term](https://github.com/ysfztpp/termquake/blob/main/site/src/components/show-mode.tsx): `site/src/components/show-mode.tsx`
- [Suggestion form](https://github.com/ysfztpp/termquake/blob/main/site/src/components/suggest.tsx): `site/src/components/suggest.tsx`
- [Language coverage](https://github.com/ysfztpp/termquake/blob/main/site/src/components/coverage.tsx): `site/src/components/coverage.tsx`
- [Saved preferences](https://github.com/ysfztpp/termquake/blob/main/site/src/storage.ts): `site/src/storage.ts`
- [Interface translations](https://github.com/ysfztpp/termquake/blob/main/site/src/i18n.ts): `site/src/i18n.ts`
- [Offline support](https://github.com/ysfztpp/termquake/blob/main/site/src/pwa.ts): `site/src/pwa.ts`

### Terminology data

- [Canonical SQL data](https://github.com/ysfztpp/termquake/tree/main/data/db): `data/db`
- [Database schema](https://github.com/ysfztpp/termquake/blob/main/db/schema.sql): `db/schema.sql`
- [Sheet snapshot](https://github.com/ysfztpp/termquake/tree/main/data/legacy): `data/legacy`
- [AI suggestions](https://github.com/ysfztpp/termquake/tree/main/data/ai): `data/ai`

### Editorial workflow

- [Review suggestions](https://github.com/ysfztpp/termquake/tree/main/data/review): `data/review`
- [TermQuake commands](https://github.com/ysfztpp/termquake/blob/main/src/termquake/cli.py): `src/termquake/cli.py`
- [Build and dump](https://github.com/ysfztpp/termquake/blob/main/src/termquake/db.py): `src/termquake/db.py`
- [Sheet import and fetch](https://github.com/ysfztpp/termquake/blob/main/src/termquake/sheet.py): `src/termquake/sheet.py`
- [Text cleanup](https://github.com/ysfztpp/termquake/blob/main/src/termquake/clean.py): `src/termquake/clean.py`
- [Term standardisation](https://github.com/ysfztpp/termquake/blob/main/src/termquake/standardise.py): `src/termquake/standardise.py`
- [Language review sheets](https://github.com/ysfztpp/termquake/blob/main/src/termquake/review.py): `src/termquake/review.py`
- [AI data import](https://github.com/ysfztpp/termquake/blob/main/src/termquake/ai.py): `src/termquake/ai.py`

### Publishing and exports

- [Data export](https://github.com/ysfztpp/termquake/blob/main/src/termquake/export.py): `src/termquake/export.py`
- [Offline site data](https://github.com/ysfztpp/termquake/tree/main/site/public): `site/public`
- [TBX CSV SQLite](https://github.com/ysfztpp/termquake/tree/main/site/public): `site/public`

### Other components

- **Interpreter or responder**
- **GitHub issue**

## Connections

- Interpreter or responder → Search and browse app: searches or browses (evidence: `README.md`)
- Search and browse app → Search and folding: searches terms (evidence: `site/src/app.tsx`)
- Search and browse app → Entry presentation: renders entries (evidence: `site/src/app.tsx`)
- Search and browse app → Full-screen term: opens full screen (evidence: `README.md`)
- Search and browse app → Suggestion form: opens form (evidence: `site/src/app.tsx`)
- Search and browse app → Language coverage: shows coverage (evidence: `site/src/app.tsx`)
- Search and browse app → Saved preferences: saves choices (evidence: `site/src/app.tsx`)
- Search and browse app → Offline support: checks offline state (evidence: `site/src/app.tsx`)
- Search and browse app → Interface translations: uses interface text (evidence: `site/src/app.tsx`)
- Suggestion form → GitHub issue: creates issue or text (evidence: `README.md`)
- Database schema → Build and dump: defines tables (evidence: `README.md`)
- Canonical SQL data → Build and dump: builds SQLite (evidence: `README.md`)
- Build and dump → Canonical SQL data: dumps edited data (evidence: `README.md`)
- Sheet snapshot → TermQuake commands: imports snapshot (evidence: `README.md`)
- TermQuake commands → Sheet import and fetch: dispatches import (evidence: `src/termquake/cli.py`)
- TermQuake commands → Build and dump: dispatches build and dump (evidence: `src/termquake/cli.py`)
- TermQuake commands → Text cleanup: dispatches cleanup (evidence: `src/termquake/cli.py`)
- TermQuake commands → Term standardisation: dispatches standardise (evidence: `src/termquake/cli.py`)
- TermQuake commands → Language review sheets: dispatches review (evidence: `src/termquake/cli.py`)
- TermQuake commands → AI data import: dispatches AI import (evidence: `src/termquake/cli.py`)
- Review suggestions → Language review sheets: provides suggestions (evidence: `src/termquake/review.py`)
- AI suggestions → AI data import: provides suggestions (evidence: `README.md`)
- Build and dump → Data export: exports database (evidence: `README.md`)
- Data export → Offline site data: writes app data (evidence: `src/termquake/export.py`)
- Data export → TBX CSV SQLite: writes formats (evidence: `src/termquake/export.py`)
- Interpreter or responder → TBX CSV SQLite: downloads terminology (evidence: `README.md`)
- Sheet import and fetch → GitHub issue: fetches read-only sheet (evidence: `README.md`)
