# zhou-air/engineering-workload-tool architecture

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

- Interactive diagram: https://gitdiagram.com/zhou-air/engineering-workload-tool
- Repository: https://github.com/zhou-air/engineering-workload-tool

## Overview

Engineering Workload Tool is an offline Windows desktop app for recording engineering work, calculating rule-based scores, reviewing history, and exporting summaries; SQLite is its authoritative store. The principal workflow is GUI entry → rule calculation and validation → snapshot-backed record persistence → history or export. The graph also preserves master-data administration, special-rule confirmation, database backup, and localization. Source excerpts and the index support the main service relationships; some README-listed UI features are not individually sampled, so their implementation is represented at the main-window level.

Main entry points: [`app/database/database.py`](https://github.com/zhou-air/engineering-workload-tool/blob/main/app/database/database.py) (Database operations), [`app/ui/main_window.py`](https://github.com/zhou-air/engineering-workload-tool/blob/main/app/ui/main_window.py) (Work entry), [`app/services/record_service.py`](https://github.com/zhou-air/engineering-workload-tool/blob/main/app/services/record_service.py) (Record validation and snapshots), [`main.py`](https://github.com/zhou-air/engineering-workload-tool/blob/main/main.py) (Application startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_entry["Work entry<br/>[main_window.py]"]
  node_master["Master-data management<br/>[main_window.py]"]
  node_history["History and editing<br/>[main_window.py]"]
  node_datepickers["Date selectors<br/>[date_widgets.py]"]
  node_ui_text["Chinese UI text<br/>[i18n.py]"]
  node_app_entry["Application startup<br/>[main.py]"]
end

subgraph group_workload["Workload processing"]
  node_calculation["Rule calculation<br/>[calculator.py]"]
  node_record_service["Record validation and snapshots<br/>[record_service.py]"]
end

subgraph group_persistence["SQLite persistence"]
  node_database_api["Database operations<br/>[database.py]"]
  node_seed_data["Initial dictionaries<br/>[seed.py]"]
  node_sqlite[("SQLite workload database")]
  node_backup["Online database backup<br/>[database.py]"]
end

subgraph group_outputs["Review and export"]
  node_exports_ui["Export controls<br/>[main_window.py]"]
  node_export_service["Excel and AI export<br/>[export_service.py]"]
end

node_user(("Desktop user"))

node_user -->|"enters work"| node_entry
node_user -->|"manages dictionaries"| node_master
node_user -->|"reviews records"| node_history
node_entry -->|"uses selectors"| node_datepickers
node_entry -->|"uses labels"| node_ui_text
node_entry -->|"previews score"| node_calculation
node_entry -->|"saves record"| node_record_service
node_record_service -->|"calculates score"| node_calculation
node_record_service -->|"writes snapshot"| node_database_api
node_master -->|"manages dictionaries"| node_database_api
node_history -->|"filters records"| node_database_api
node_history -->|"resaves edits"| node_record_service
node_database_api -->|"reads and writes"| node_sqlite
node_database_api -->|"loads initial data"| node_seed_data
node_exports_ui -->|"requests export"| node_export_service
node_export_service -->|"queries records"| node_database_api
node_backup -->|"backs up database"| node_sqlite
node_app_entry -->|"initializes database"| node_database_api
node_app_entry -->|"launches interface"| node_entry

click node_entry "https://github.com/zhou-air/engineering-workload-tool/blob/main/app/ui/main_window.py"
click node_master "https://github.com/zhou-air/engineering-workload-tool/blob/main/app/ui/main_window.py"
click node_history "https://github.com/zhou-air/engineering-workload-tool/blob/main/app/ui/main_window.py"
click node_datepickers "https://github.com/zhou-air/engineering-workload-tool/blob/main/app/ui/date_widgets.py"
click node_ui_text "https://github.com/zhou-air/engineering-workload-tool/blob/main/app/i18n.py"
click node_calculation "https://github.com/zhou-air/engineering-workload-tool/blob/main/app/services/calculator.py"
click node_record_service "https://github.com/zhou-air/engineering-workload-tool/blob/main/app/services/record_service.py"
click node_database_api "https://github.com/zhou-air/engineering-workload-tool/blob/main/app/database/database.py"
click node_seed_data "https://github.com/zhou-air/engineering-workload-tool/blob/main/app/database/seed.py"
click node_exports_ui "https://github.com/zhou-air/engineering-workload-tool/blob/main/app/ui/main_window.py"
click node_export_service "https://github.com/zhou-air/engineering-workload-tool/blob/main/app/services/export_service.py"
click node_backup "https://github.com/zhou-air/engineering-workload-tool/blob/main/app/database/database.py"
click node_app_entry "https://github.com/zhou-air/engineering-workload-tool/blob/main/main.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_entry,node_master,node_history,node_datepickers,node_ui_text,node_app_entry,node_user toneBlue
class node_calculation,node_record_service toneAmber
class node_database_api,node_seed_data,node_sqlite,node_backup toneMint
class node_exports_ui,node_export_service toneRose
```

## Components

### Desktop interface

- [Work entry](https://github.com/zhou-air/engineering-workload-tool/blob/main/app/ui/main_window.py): `app/ui/main_window.py`
- [Master-data management](https://github.com/zhou-air/engineering-workload-tool/blob/main/app/ui/main_window.py): `app/ui/main_window.py`
- [History and editing](https://github.com/zhou-air/engineering-workload-tool/blob/main/app/ui/main_window.py): `app/ui/main_window.py`
- [Date selectors](https://github.com/zhou-air/engineering-workload-tool/blob/main/app/ui/date_widgets.py): `app/ui/date_widgets.py`
- [Chinese UI text](https://github.com/zhou-air/engineering-workload-tool/blob/main/app/i18n.py): `app/i18n.py`
- [Application startup](https://github.com/zhou-air/engineering-workload-tool/blob/main/main.py): `main.py`

### Workload processing

- [Rule calculation](https://github.com/zhou-air/engineering-workload-tool/blob/main/app/services/calculator.py): `app/services/calculator.py`
- [Record validation and snapshots](https://github.com/zhou-air/engineering-workload-tool/blob/main/app/services/record_service.py): `app/services/record_service.py`

### SQLite persistence

- [Database operations](https://github.com/zhou-air/engineering-workload-tool/blob/main/app/database/database.py): `app/database/database.py`
- [Initial dictionaries](https://github.com/zhou-air/engineering-workload-tool/blob/main/app/database/seed.py): `app/database/seed.py`
- **SQLite workload database**
- [Online database backup](https://github.com/zhou-air/engineering-workload-tool/blob/main/app/database/database.py): `app/database/database.py`

### Review and export

- [Export controls](https://github.com/zhou-air/engineering-workload-tool/blob/main/app/ui/main_window.py): `app/ui/main_window.py`
- [Excel and AI export](https://github.com/zhou-air/engineering-workload-tool/blob/main/app/services/export_service.py): `app/services/export_service.py`

### Other components

- **Desktop user**

## Connections

- Desktop user → Work entry: enters work (evidence: `README.md`)
- Desktop user → Master-data management: manages dictionaries (evidence: `README.md`)
- Desktop user → History and editing: reviews records (evidence: `README.md`)
- Work entry → Date selectors: uses selectors (evidence: `app/ui/main_window.py`)
- Work entry → Chinese UI text: uses labels (evidence: `app/ui/main_window.py`)
- Work entry → Rule calculation: previews score (evidence: `app/ui/main_window.py`)
- Work entry → Record validation and snapshots: saves record (evidence: `app/ui/main_window.py`)
- Record validation and snapshots → Rule calculation: calculates score (evidence: `app/services/record_service.py`)
- Record validation and snapshots → Database operations: writes snapshot (evidence: `app/services/record_service.py`)
- Master-data management → Database operations: manages dictionaries (evidence: `app/ui/main_window.py`)
- History and editing → Database operations: filters records (evidence: `app/ui/main_window.py`)
- History and editing → Record validation and snapshots: resaves edits (evidence: `app/ui/main_window.py`)
- Database operations → SQLite workload database: reads and writes (evidence: `app/database/database.py`)
- Database operations → Initial dictionaries: loads initial data (evidence: `app/database/database.py`)
- Export controls → Excel and AI export: requests export (evidence: `app/ui/main_window.py`)
- Excel and AI export → Database operations: queries records (evidence: `app/services/export_service.py`)
- Online database backup → SQLite workload database: backs up database (evidence: `app/database/database.py`)
- Application startup → Database operations: initializes database (evidence: `main.py`)
- Application startup → Work entry: launches interface (evidence: `main.py`)
