# baoddc/test-kho architecture

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

- Interactive diagram: https://gitdiagram.com/baoddc/test-kho
- Repository: https://github.com/baoddc/test-kho

## Overview

DDC’s Kho Phôi Cuộn is a warehouse-management web application, also packaged for mobile and desktop. The principal workflow is staff entering the application, recording or reviewing inventory activity for coil blanks, tole, and sheet goods, then using operational reports. The README also identifies authentication, 5S/HSE, Excel exchange, and voice recognition as capabilities. Frontend implementation excerpts were not provided, so feature-to-data-layer links are limited to relationships documented in the README; the Cloudflare worker is represented as a separate HSE storage service without an asserted caller.

Main entry points: [`pages/index.html`](https://github.com/baoddc/test-kho/blob/main/pages/index.html) (Page entry), [`assets/js/core/supabase-data-engine.js`](https://github.com/baoddc/test-kho/blob/main/assets/js/core/supabase-data-engine.js) (Supabase data engine), [`assets/js/xg`](https://github.com/baoddc/test-kho/tree/main/assets/js/xg) (Coil inventory), [`assets/js/tole`](https://github.com/baoddc/test-kho/tree/main/assets/js/tole) (Tole inventory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_entry["Page entry<br/>[index.html]"]
  node_auth["Authentication<br/>[dang_nhap.js]"]
  node_desktop["Desktop host<br/>[main.js]"]
  node_mobile["Android host<br/>[MainActivity.java]"]
end

subgraph group_inventory["Inventory operations"]
  node_coil["Coil inventory"]
  node_tole["Tole inventory"]
  node_sheet["Sheet inventory"]
end

subgraph group_operations["Operations and reporting"]
  node_five_s["5S and HSE"]
  node_reports["Inventory reports<br/>[xg-bieu-do.js]"]
  node_excel["Excel exchange"]
end

subgraph group_services["Shared services"]
  node_inventorydata["Supabase data engine"]
  node_supabase[("Supabase")]
  node_voice["Voice recognition<br/>[voice-assistant.js]"]
  node_r2[("HSE photo storage<br/>[worker.js]")]
end

node_staff(("Warehouse staff"))

node_staff -->|"opens"| node_entry
node_entry -->|"supports login"| node_auth
node_entry -->|"navigates to"| node_coil
node_entry -->|"navigates to"| node_tole
node_entry -->|"navigates to"| node_sheet
node_entry -->|"navigates to"| node_five_s
node_entry -.->|"navigates to"| node_reports
node_coil -.->|"uses engine"| node_inventorydata
node_tole -.->|"uses engine"| node_inventorydata
node_sheet -.->|"uses engine"| node_inventorydata
node_inventorydata -->|"accesses backend"| node_supabase
node_staff -->|"imports or exports"| node_excel
node_staff -->|"uses voice"| node_voice
node_desktop -.->|"hosts app"| node_entry
node_mobile -.->|"hosts app"| node_entry

click node_entry "https://github.com/baoddc/test-kho/blob/main/pages/index.html"
click node_auth "https://github.com/baoddc/test-kho/blob/main/assets/js/dang_nhap.js"
click node_coil "https://github.com/baoddc/test-kho/tree/main/assets/js/xg"
click node_tole "https://github.com/baoddc/test-kho/tree/main/assets/js/tole"
click node_sheet "https://github.com/baoddc/test-kho/tree/main/assets/js/pl"
click node_inventorydata "https://github.com/baoddc/test-kho/blob/main/assets/js/core/supabase-data-engine.js"
click node_five_s "https://github.com/baoddc/test-kho/tree/main/assets/js/5s"
click node_reports "https://github.com/baoddc/test-kho/blob/main/assets/js/xg/xg-bieu-do.js"
click node_excel "https://github.com/baoddc/test-kho/tree/main/assets/js/xg"
click node_voice "https://github.com/baoddc/test-kho/blob/main/assets/js/components/voice-assistant.js"
click node_r2 "https://github.com/baoddc/test-kho/blob/main/cloudflare-r2/worker.js"
click node_desktop "https://github.com/baoddc/test-kho/blob/main/dist-app/main.js"
click node_mobile "https://github.com/baoddc/test-kho/blob/main/android/app/src/main/java/com/ddc/khophoicuon/MainActivity.java"

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_auth,node_desktop,node_mobile toneBlue
class node_coil,node_tole,node_sheet toneAmber
class node_five_s,node_reports,node_excel toneMint
class node_inventorydata,node_supabase,node_voice,node_r2 toneRose
class node_staff toneIndigo
```

## Components

### Web application

- [Page entry](https://github.com/baoddc/test-kho/blob/main/pages/index.html): `pages/index.html`
- [Authentication](https://github.com/baoddc/test-kho/blob/main/assets/js/dang_nhap.js): `assets/js/dang_nhap.js`
- [Desktop host](https://github.com/baoddc/test-kho/blob/main/dist-app/main.js): `dist-app/main.js`
- [Android host](https://github.com/baoddc/test-kho/blob/main/android/app/src/main/java/com/ddc/khophoicuon/MainActivity.java): `android/app/src/main/java/com/ddc/khophoicuon/MainActivity.java`

### Inventory operations

- [Coil inventory](https://github.com/baoddc/test-kho/tree/main/assets/js/xg): `assets/js/xg`
- [Tole inventory](https://github.com/baoddc/test-kho/tree/main/assets/js/tole): `assets/js/tole`
- [Sheet inventory](https://github.com/baoddc/test-kho/tree/main/assets/js/pl): `assets/js/pl`

### Operations and reporting

- [5S and HSE](https://github.com/baoddc/test-kho/tree/main/assets/js/5s): `assets/js/5s`
- [Inventory reports](https://github.com/baoddc/test-kho/blob/main/assets/js/xg/xg-bieu-do.js): `assets/js/xg/xg-bieu-do.js`
- [Excel exchange](https://github.com/baoddc/test-kho/tree/main/assets/js/xg): `assets/js/xg`

### Shared services

- [Supabase data engine](https://github.com/baoddc/test-kho/blob/main/assets/js/core/supabase-data-engine.js): `assets/js/core/supabase-data-engine.js`
- **Supabase**
- [Voice recognition](https://github.com/baoddc/test-kho/blob/main/assets/js/components/voice-assistant.js): `assets/js/components/voice-assistant.js`
- [HSE photo storage](https://github.com/baoddc/test-kho/blob/main/cloudflare-r2/worker.js): `cloudflare-r2/worker.js`

### Other components

- **Warehouse staff**

## Connections

- Warehouse staff → Page entry: opens (evidence: `README.md`)
- Page entry → Authentication: supports login (evidence: `README.md`)
- Page entry → Coil inventory: navigates to (evidence: `README.md`)
- Page entry → Tole inventory: navigates to (evidence: `README.md`)
- Page entry → Sheet inventory: navigates to (evidence: `README.md`)
- Page entry → 5S and HSE: navigates to (evidence: `README.md`)
- Page entry → Inventory reports: navigates to
- Coil inventory → Supabase data engine: uses engine
- Tole inventory → Supabase data engine: uses engine
- Sheet inventory → Supabase data engine: uses engine
- Supabase data engine → Supabase: accesses backend (evidence: `README.md`)
- Warehouse staff → Excel exchange: imports or exports (evidence: `README.md`)
- Warehouse staff → Voice recognition: uses voice (evidence: `README.md`)
- Desktop host → Page entry: hosts app
- Android host → Page entry: hosts app
