# nguyenthong251/waretrack-3d architecture

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

- Interactive diagram: https://gitdiagram.com/nguyenthong251/waretrack-3d
- Repository: https://github.com/nguyenthong251/waretrack-3d

## Overview

WareTrack 3D is a mock-data warehouse operations dashboard: users choose a site, inspect a live 3D network and its trucks, forklifts, pallets and docks, and use overlays for KPIs, entity details, fleet status and shipment progress. Runtime flow runs from the app entry through the in-memory data and simulation, into the 3D scene and UI. The graph also preserves documented ERP/WMS data, layout, camera, interaction and search capabilities. Links are limited to README or source-index relationships; unshown implementation detail is not inferred.

Main entry points: [`src/three/world.js`](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/world.js) (World composition), [`src/main.js`](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/main.js) (App entry), [`src/ui/index.js`](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/ui/index.js) (Overlay mounting), [`src/data/db.js`](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/data/db.js) (Live data access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and State"]
  node_entry["App entry<br/>[main.js]"]
  node_store["UI state and events<br/>[store.js]"]
  node_simulation["Operations simulation<br/>[simulation.js]"]
end

subgraph group_ops["Operations Data"]
  node_mock[("Mock ERP/WMS data<br/>[mockData.js]")]
  node_database["Live data access<br/>[db.js]"]
  node_selectors["Derived views<br/>[selectors.js]"]
  node_format["Status and formatting<br/>[format.js]"]
  node_layout["Warehouse layouts<br/>[layout.js]"]
end

subgraph group_view3d["3D Operations View"]
  node_scene["Scene and camera<br/>[scene.js]"]
  node_world["World composition<br/>[world.js]"]
  node_environment["City and yard environment<br/>[environment.js]"]
  node_warehouse["Warehouse models<br/>[warehouse.js]"]
  node_truck["Truck models<br/>[truck.js]"]
  node_forklift["Forklift models<br/>[forklift.js]"]
  node_pallet["Pallet models<br/>[pallet.js]"]
  node_props["Yard props<br/>[props.js]"]
  node_palette["3D palette and materials<br/>[palette.js]"]
  node_canvastext["3D text labels<br/>[canvasText.js]"]
  node_interaction["Picking and selection<br/>[interaction.js]"]
  node_camera["Camera directing<br/>[cameraDirector.js]"]
end

subgraph group_overlay["Dashboard Overlay"]
  node_uiroot["Overlay mounting<br/>[index.js]"]
  node_topbar["Site, search and menu<br/>[topbar.js]"]
  node_kpis["Operations KPIs<br/>[kpis.js]"]
  node_mapcontrols["Map controls<br/>[mapControls.js]"]
  node_detail["Entity details<br/>[detailPanel.js]"]
  node_tracker["Shipment tracking<br/>[shipmentTracker.js]"]
  node_fleet["Fleet panel<br/>[fleetPanel.js]"]
  node_illustrations["Panel illustrations<br/>[illustrations.js]"]
  node_icons["UI icons<br/>[icons.js]"]
end

node_operator(("Operations user"))
node_erp[("ERP/WMS API")]

node_operator -->|"opens dashboard"| node_entry
node_entry -->|"creates scene"| node_scene
node_entry -->|"creates world"| node_world
node_entry -->|"enables picking"| node_interaction
node_entry -->|"sets camera"| node_camera
node_entry -->|"starts simulation"| node_simulation
node_entry -->|"mounts overlay"| node_uiroot
node_store -->|"resolves selection"| node_database
node_store -->|"initializes clock"| node_mock
node_database -->|"indexes entities"| node_mock
node_selectors -->|"derives views"| node_database
node_selectors -->|"formats values"| node_format
node_simulation -->|"updates entities"| node_database
node_simulation -->|"updates state"| node_store
node_simulation -->|"uses routes"| node_layout
node_world -->|"reads entities"| node_database
node_world -->|"places sites"| node_layout
node_world -->|"adds environment"| node_environment
node_world -->|"creates buildings"| node_warehouse
node_world -->|"creates trucks"| node_truck
node_world -->|"creates forklifts"| node_forklift
node_world -->|"creates pallets"| node_pallet
node_world -->|"creates props"| node_props
node_environment -->|"reads layout"| node_layout
node_environment -->|"adds parked trucks"| node_truck
node_warehouse -->|"uses materials"| node_palette
node_truck -->|"uses materials"| node_palette
node_truck -->|"renders labels"| node_canvastext
node_forklift -->|"reuses model parts"| node_truck
node_pallet -->|"uses materials"| node_palette
node_props -->|"uses materials"| node_palette
node_props -->|"places pallets"| node_pallet
node_props -->|"renders labels"| node_canvastext
node_interaction -->|"resolves picked entity"| node_database
node_interaction -.->|"highlights objects"| node_world
node_camera -->|"reads camera state"| node_store
node_camera -->|"resolves targets"| node_database
node_camera -->|"moves camera"| node_scene
node_uiroot -->|"mounts"| node_topbar
node_uiroot -->|"mounts"| node_kpis
node_uiroot -->|"mounts"| node_mapcontrols
node_uiroot -->|"mounts"| node_detail
node_uiroot -->|"mounts"| node_tracker
node_uiroot -->|"mounts"| node_fleet
node_topbar -->|"changes selection"| node_store
node_topbar -->|"reads entities"| node_database
node_topbar -->|"builds search results"| node_selectors
node_topbar -->|"formats display"| node_format

click node_entry "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/main.js"
click node_store "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/state/store.js"
click node_simulation "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/state/simulation.js"
click node_mock "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/data/mockData.js"
click node_database "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/data/db.js"
click node_selectors "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/data/selectors.js"
click node_format "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/data/format.js"
click node_layout "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/data/layout.js"
click node_scene "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/scene.js"
click node_world "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/world.js"
click node_environment "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/environment.js"
click node_warehouse "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/models/warehouse.js"
click node_truck "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/models/truck.js"
click node_forklift "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/models/forklift.js"
click node_pallet "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/models/pallet.js"
click node_props "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/models/props.js"
click node_palette "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/palette.js"
click node_canvastext "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/canvasText.js"
click node_interaction "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/interaction.js"
click node_camera "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/cameraDirector.js"
click node_uiroot "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/ui/index.js"
click node_topbar "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/ui/topbar.js"
click node_kpis "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/ui/kpis.js"
click node_mapcontrols "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/ui/mapControls.js"
click node_detail "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/ui/detailPanel.js"
click node_tracker "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/ui/shipmentTracker.js"
click node_fleet "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/ui/fleetPanel.js"
click node_illustrations "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/ui/illustrations.js"
click node_icons "https://github.com/nguyenthong251/waretrack-3d/blob/main/src/ui/icons.js"

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_store,node_simulation,node_operator toneBlue
class node_mock,node_database,node_selectors,node_format,node_layout,node_erp toneAmber
class node_scene,node_world,node_environment,node_warehouse,node_truck,node_forklift,node_pallet,node_props,node_palette,node_canvastext,node_interaction,node_camera toneMint
class node_uiroot,node_topbar,node_kpis,node_mapcontrols,node_detail,node_tracker,node_fleet,node_illustrations,node_icons toneRose
```

## Components

### App and State

- [App entry](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/main.js): `src/main.js`
- [UI state and events](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/state/store.js): `src/state/store.js`
- [Operations simulation](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/state/simulation.js): `src/state/simulation.js`

### Operations Data

- [Mock ERP/WMS data](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/data/mockData.js): `src/data/mockData.js`
- [Live data access](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/data/db.js): `src/data/db.js`
- [Derived views](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/data/selectors.js): `src/data/selectors.js`
- [Status and formatting](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/data/format.js): `src/data/format.js`
- [Warehouse layouts](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/data/layout.js): `src/data/layout.js`

### 3D Operations View

- [Scene and camera](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/scene.js): `src/three/scene.js`
- [World composition](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/world.js): `src/three/world.js`
- [City and yard environment](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/environment.js): `src/three/environment.js`
- [Warehouse models](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/models/warehouse.js): `src/three/models/warehouse.js`
- [Truck models](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/models/truck.js): `src/three/models/truck.js`
- [Forklift models](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/models/forklift.js): `src/three/models/forklift.js`
- [Pallet models](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/models/pallet.js): `src/three/models/pallet.js`
- [Yard props](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/models/props.js): `src/three/models/props.js`
- [3D palette and materials](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/palette.js): `src/three/palette.js`
- [3D text labels](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/canvasText.js): `src/three/canvasText.js`
- [Picking and selection](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/interaction.js): `src/three/interaction.js`
- [Camera directing](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/three/cameraDirector.js): `src/three/cameraDirector.js`

### Dashboard Overlay

- [Overlay mounting](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/ui/index.js): `src/ui/index.js`
- [Site, search and menu](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/ui/topbar.js): `src/ui/topbar.js`
- [Operations KPIs](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/ui/kpis.js): `src/ui/kpis.js`
- [Map controls](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/ui/mapControls.js): `src/ui/mapControls.js`
- [Entity details](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/ui/detailPanel.js): `src/ui/detailPanel.js`
- [Shipment tracking](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/ui/shipmentTracker.js): `src/ui/shipmentTracker.js`
- [Fleet panel](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/ui/fleetPanel.js): `src/ui/fleetPanel.js`
- [Panel illustrations](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/ui/illustrations.js): `src/ui/illustrations.js`
- [UI icons](https://github.com/nguyenthong251/waretrack-3d/blob/main/src/ui/icons.js): `src/ui/icons.js`

### Other components

- **Operations user**
- **ERP/WMS API**

## Connections

- Operations user → App entry: opens dashboard (evidence: `README.md`)
- App entry → Scene and camera: creates scene (evidence: `src/main.js`)
- App entry → World composition: creates world (evidence: `src/main.js`)
- App entry → Picking and selection: enables picking (evidence: `src/main.js`)
- App entry → Camera directing: sets camera (evidence: `src/main.js`)
- App entry → Operations simulation: starts simulation (evidence: `src/main.js`)
- App entry → Overlay mounting: mounts overlay (evidence: `src/main.js`)
- UI state and events → Live data access: resolves selection (evidence: `src/state/store.js`)
- UI state and events → Mock ERP/WMS data: initializes clock (evidence: `src/state/store.js`)
- Live data access → Mock ERP/WMS data: indexes entities (evidence: `src/data/db.js`)
- Derived views → Live data access: derives views (evidence: `src/data/selectors.js`)
- Derived views → Status and formatting: formats values (evidence: `src/data/selectors.js`)
- Operations simulation → Live data access: updates entities (evidence: `src/state/simulation.js`)
- Operations simulation → UI state and events: updates state (evidence: `src/state/simulation.js`)
- Operations simulation → Warehouse layouts: uses routes (evidence: `src/state/simulation.js`)
- World composition → Live data access: reads entities (evidence: `src/three/world.js`)
- World composition → Warehouse layouts: places sites (evidence: `src/three/world.js`)
- World composition → City and yard environment: adds environment (evidence: `src/three/world.js`)
- World composition → Warehouse models: creates buildings (evidence: `src/three/world.js`)
- World composition → Truck models: creates trucks (evidence: `src/three/world.js`)
- World composition → Forklift models: creates forklifts (evidence: `src/three/world.js`)
- World composition → Pallet models: creates pallets (evidence: `src/three/world.js`)
- World composition → Yard props: creates props (evidence: `src/three/world.js`)
- City and yard environment → Warehouse layouts: reads layout (evidence: `src/three/environment.js`)
- City and yard environment → Truck models: adds parked trucks (evidence: `src/three/environment.js`)
- Warehouse models → 3D palette and materials: uses materials (evidence: `src/three/models/warehouse.js`)
- Truck models → 3D palette and materials: uses materials (evidence: `src/three/models/truck.js`)
- Truck models → 3D text labels: renders labels (evidence: `src/three/models/truck.js`)
- Forklift models → Truck models: reuses model parts (evidence: `src/three/models/forklift.js`)
- Pallet models → 3D palette and materials: uses materials (evidence: `src/three/models/pallet.js`)
- Yard props → 3D palette and materials: uses materials (evidence: `src/three/models/props.js`)
- Yard props → Pallet models: places pallets (evidence: `src/three/models/props.js`)
- Yard props → 3D text labels: renders labels (evidence: `src/three/models/props.js`)
- Picking and selection → Live data access: resolves picked entity (evidence: `src/three/interaction.js`)
- Picking and selection → World composition: highlights objects
- Camera directing → UI state and events: reads camera state (evidence: `src/three/cameraDirector.js`)
- Camera directing → Live data access: resolves targets (evidence: `src/three/cameraDirector.js`)
- Camera directing → Scene and camera: moves camera (evidence: `src/three/cameraDirector.js`)
- Overlay mounting → Site, search and menu: mounts (evidence: `src/ui/index.js`)
- Overlay mounting → Operations KPIs: mounts (evidence: `src/ui/index.js`)
- Overlay mounting → Map controls: mounts (evidence: `src/ui/index.js`)
- Overlay mounting → Entity details: mounts (evidence: `src/ui/index.js`)
- Overlay mounting → Shipment tracking: mounts (evidence: `src/ui/index.js`)
- Overlay mounting → Fleet panel: mounts (evidence: `src/ui/index.js`)
- Site, search and menu → UI state and events: changes selection (evidence: `src/ui/topbar.js`)
- Site, search and menu → Live data access: reads entities (evidence: `src/ui/topbar.js`)
- Site, search and menu → Derived views: builds search results (evidence: `src/ui/topbar.js`)
- Site, search and menu → Status and formatting: formats display (evidence: `src/ui/topbar.js`)
