# brandon-m-smith4439/delivery-list-scanning-project architecture

> Architecture diagram of the GitHub repository brandon-m-smith4439/delivery-list-scanning-project, 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/brandon-m-smith4439/delivery-list-scanning-project
- Repository: https://github.com/brandon-m-smith4439/delivery-list-scanning-project

## Overview

Delivery List Scanner is a browser-based operations app for importing delivery lists, scanning and reviewing production work, and managing warehouse and reject workflows. Users interact through the web UI and API; the server routes requests into the scanner store and operational extensions. Separate automation imports Crystal or SQL-generated delivery exports into that same store. Production-file access, reject-history reconciliation, and schema management support the workflows. The README documents additional fabrication, inventory, rack, and reporting capabilities; source excerpts do not expose all of their runtime wiring, so those links are omitted.

Main entry points: [`server.py`](https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/server.py) (Web API), [`backend/store.py`](https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/backend/store.py) (Scanner store), [`automation/crystal_delivery_export/import_delivery_folder.py`](https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/automation/crystal_delivery_export/import_delivery_folder.py) (Crystal importer), [`automation/sql_delivery_export/import_delivery_folder.py`](https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/automation/sql_delivery_export/import_delivery_folder.py) (SQL importer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Scanner application"]
  node_ui["Browser interface<br/>[app.js]"]
  node_http["Web API<br/>[server.py]"]
  node_operations["Operational workflows<br/>[operations.py]"]
  node_config["Application config<br/>[config.py]"]
end

subgraph group_imports["Delivery imports"]
  node_automation["Automation control"]
  node_crystal["Crystal importer"]
  node_sqlimport["SQL importer"]
  node_safety["Safe reconciliation<br/>[import_safety.py]"]
end

subgraph group_production["Production operations"]
  node_files["Production files"]
  node_geometry["Sketch geometry<br/>[sketch_geometry.py]"]
  node_rejects["Reject vocabulary"]
end

subgraph group_persistence["Persistence"]
  node_store[("Scanner store<br/>[store.py]")]
  node_contract["Database contract<br/>[contract.py]"]
  node_migrations["Schema migrations<br/>[migrations.py]"]
  node_integrity["Integrity checks<br/>[integrity.py]"]
  node_database[("SQLite database")]
end

node_operator(("Scanner user"))

node_operator -->|"uses"| node_ui
node_ui -.->|"requests"| node_http
node_http -->|"routes requests"| node_store
node_http -->|"delegates workflows"| node_operations
node_http -->|"controls automation"| node_automation
node_crystal -->|"loads config"| node_config
node_crystal -->|"installs safeguards"| node_safety
node_crystal -->|"imports exports"| node_store
node_sqlimport -->|"loads config"| node_config
node_sqlimport -->|"uses reconciliation"| node_safety
node_sqlimport -->|"imports workbooks"| node_store
node_safety -->|"wraps importer"| node_store
node_files -->|"uses geometry"| node_geometry
node_operations -->|"uses vocabulary"| node_rejects
node_http -->|"loads settings"| node_config
node_store -.->|"persists state"| node_database
node_migrations -->|"uses schema contract"| node_contract
node_integrity -->|"checks contract"| node_contract
node_integrity -->|"checks migrations"| node_migrations

click node_ui "https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/static/js/app.js"
click node_http "https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/server.py"
click node_operations "https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/backend/operations.py"
click node_automation "https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/backend/automation_control.py"
click node_crystal "https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/automation/crystal_delivery_export/import_delivery_folder.py"
click node_sqlimport "https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/automation/sql_delivery_export/import_delivery_folder.py"
click node_safety "https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/backend/import_safety.py"
click node_files "https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/backend/production_files.py"
click node_geometry "https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/backend/sketch_geometry.py"
click node_rejects "https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/backend/aw_reject_legacy.py"
click node_config "https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/backend/config.py"
click node_store "https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/backend/store.py"
click node_contract "https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/database/contract.py"
click node_migrations "https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/database/migrations.py"
click node_integrity "https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/database/integrity.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_ui,node_http,node_operations,node_config,node_operator toneBlue
class node_automation,node_crystal,node_sqlimport,node_safety toneAmber
class node_files,node_geometry,node_rejects toneMint
class node_store,node_contract,node_migrations,node_integrity,node_database toneRose
```

## Components

### Scanner application

- [Browser interface](https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/static/js/app.js): `static/js/app.js`
- [Web API](https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/server.py): `server.py`
- [Operational workflows](https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/backend/operations.py): `backend/operations.py`
- [Application config](https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/backend/config.py): `backend/config.py`

### Delivery imports

- [Automation control](https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/backend/automation_control.py): `backend/automation_control.py`
- [Crystal importer](https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/automation/crystal_delivery_export/import_delivery_folder.py): `automation/crystal_delivery_export/import_delivery_folder.py`
- [SQL importer](https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/automation/sql_delivery_export/import_delivery_folder.py): `automation/sql_delivery_export/import_delivery_folder.py`
- [Safe reconciliation](https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/backend/import_safety.py): `backend/import_safety.py`

### Production operations

- [Production files](https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/backend/production_files.py): `backend/production_files.py`
- [Sketch geometry](https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/backend/sketch_geometry.py): `backend/sketch_geometry.py`
- [Reject vocabulary](https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/backend/aw_reject_legacy.py): `backend/aw_reject_legacy.py`

### Persistence

- [Scanner store](https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/backend/store.py): `backend/store.py`
- [Database contract](https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/database/contract.py): `database/contract.py`
- [Schema migrations](https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/database/migrations.py): `database/migrations.py`
- [Integrity checks](https://github.com/brandon-m-smith4439/delivery-list-scanning-project/blob/main/database/integrity.py): `database/integrity.py`
- **SQLite database**

### Other components

- **Scanner user**

## Connections

- Scanner user → Browser interface: uses (evidence: `README.md`)
- Browser interface → Web API: requests
- Web API → Scanner store: routes requests (evidence: `server.py`)
- Web API → Operational workflows: delegates workflows (evidence: `server.py`)
- Web API → Automation control: controls automation (evidence: `server.py`)
- Crystal importer → Application config: loads config (evidence: `automation/crystal_delivery_export/import_delivery_folder.py`)
- Crystal importer → Safe reconciliation: installs safeguards (evidence: `automation/crystal_delivery_export/import_delivery_folder.py`)
- Crystal importer → Scanner store: imports exports (evidence: `automation/crystal_delivery_export/import_delivery_folder.py`)
- SQL importer → Application config: loads config (evidence: `automation/sql_delivery_export/import_delivery_folder.py`)
- SQL importer → Safe reconciliation: uses reconciliation (evidence: `automation/sql_delivery_export/import_delivery_folder.py`)
- SQL importer → Scanner store: imports workbooks (evidence: `automation/sql_delivery_export/import_delivery_folder.py`)
- Safe reconciliation → Scanner store: wraps importer (evidence: `backend/import_safety.py`)
- Production files → Sketch geometry: uses geometry (evidence: `backend/production_files.py`)
- Operational workflows → Reject vocabulary: uses vocabulary (evidence: `backend/operations.py`)
- Web API → Application config: loads settings (evidence: `server.py`)
- Scanner store → SQLite database: persists state
- Schema migrations → Database contract: uses schema contract (evidence: `database/migrations.py`)
- Integrity checks → Database contract: checks contract (evidence: `database/integrity.py`)
- Integrity checks → Schema migrations: checks migrations (evidence: `database/integrity.py`)
