# nmechiworx/live_simulator architecture

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

- Interactive diagram: https://gitdiagram.com/nmechiworx/live_simulator
- Repository: https://github.com/nmechiworx/live_simulator

## Overview

This is a browser-based factory workforce monitoring simulation: the user views a 3D factory, observes employee movement and restricted-zone occupancy, and can inspect workforce, alerts, and history. App.tsx visibly orchestrates factory geometry, restricted-zone rendering, movement history, and camera following; sampled components show route-based movement and employee markers. Dashboard and data modules provide workforce and sensor-health summaries. Several App.tsx excerpts are omitted, so uncertain orchestration links are left unverified rather than inferred as definite calls.

Main entry points: [`src/App.tsx`](https://github.com/nmechiworx/live_simulator/blob/main/src/App.tsx) (Simulation app), [`src/components/ManagementDashboard.tsx`](https://github.com/nmechiworx/live_simulator/blob/main/src/components/ManagementDashboard.tsx) (Management dashboard), [`src/data/routes.ts`](https://github.com/nmechiworx/live_simulator/blob/main/src/data/routes.ts) (Route definitions), [`src/data/employees.ts`](https://github.com/nmechiworx/live_simulator/blob/main/src/data/employees.ts) (Employee records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Simulation orchestration"]
  node_app["Simulation app<br/>[App.tsx]"]
  node_historytype["History model<br/>[history.ts]"]
end

subgraph group_factory["Factory visualization"]
  node_camera["Camera follow<br/>[CameraFollow.tsx]"]
  node_walls["Factory walls<br/>[FactoryWalls.tsx]"]
  node_factoryzones["Factory zones<br/>[FactoryZones.tsx]"]
  node_machine["Machine models<br/>[Machine.tsx]"]
  node_workstation["Workstations<br/>[Workstation.tsx]"]
  node_restrictedview["Restricted zones<br/>[RestrictedZone.tsx]"]
  node_trail["Movement trail<br/>[MovementTrail.tsx]"]
end

subgraph group_workforce["Workforce and routes"]
  node_employeeview["Employee marker<br/>[EmployeeMarker.tsx]"]
  node_movingemployee["Route movement<br/>[MovingEmployee.tsx]"]
  node_routeview["Route display<br/>[EmployeeRoute.tsx]"]
  node_routes["Route definitions<br/>[routes.ts]"]
  node_routetype["Route model<br/>[route.ts]"]
end

subgraph group_monitoring["Monitoring and domain data"]
  node_dashboard["Management dashboard"]
  node_employees["Employee records<br/>[employees.ts]"]
  node_safetydata["Safety zones<br/>[safetyZones.ts]"]
  node_monitoringdata["Monitoring zones<br/>[monitoring.ts]"]
  node_employeetype["Employee model<br/>[employee.ts]"]
end

node_user(("Viewer"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_walls
node_app -->|"renders"| node_factoryzones
node_app -->|"renders"| node_machine
node_app -->|"renders"| node_restrictedview
node_app -->|"configures"| node_camera
node_app -->|"renders"| node_trail
node_app -->|"checks zones"| node_safetydata
node_movingemployee -->|"renders"| node_employeeview
node_dashboard -->|"reads"| node_employees
node_dashboard -->|"reads"| node_routes
node_dashboard -->|"uses"| node_monitoringdata
node_dashboard -->|"uses position type"| node_safetydata
node_employees -->|"types records"| node_employeetype
node_routes -->|"types routes"| node_routetype
node_app -.->|"renders"| node_dashboard
node_app -.->|"updates movement"| node_movingemployee
node_app -.->|"renders routes"| node_routeview
node_app -.->|"loads records"| node_employees
node_app -.->|"loads routes"| node_routes
node_app -.->|"renders"| node_workstation
node_app -.->|"tracks history"| node_historytype

click node_app "https://github.com/nmechiworx/live_simulator/blob/main/src/App.tsx"
click node_camera "https://github.com/nmechiworx/live_simulator/blob/main/src/components/CameraFollow.tsx"
click node_walls "https://github.com/nmechiworx/live_simulator/blob/main/src/components/FactoryWalls.tsx"
click node_factoryzones "https://github.com/nmechiworx/live_simulator/blob/main/src/components/FactoryZones.tsx"
click node_machine "https://github.com/nmechiworx/live_simulator/blob/main/src/components/Machine.tsx"
click node_workstation "https://github.com/nmechiworx/live_simulator/blob/main/src/components/Workstation.tsx"
click node_restrictedview "https://github.com/nmechiworx/live_simulator/blob/main/src/components/RestrictedZone.tsx"
click node_trail "https://github.com/nmechiworx/live_simulator/blob/main/src/components/MovementTrail.tsx"
click node_employeeview "https://github.com/nmechiworx/live_simulator/blob/main/src/components/EmployeeMarker.tsx"
click node_movingemployee "https://github.com/nmechiworx/live_simulator/blob/main/src/components/MovingEmployee.tsx"
click node_routeview "https://github.com/nmechiworx/live_simulator/blob/main/src/components/EmployeeRoute.tsx"
click node_dashboard "https://github.com/nmechiworx/live_simulator/blob/main/src/components/ManagementDashboard.tsx"
click node_employees "https://github.com/nmechiworx/live_simulator/blob/main/src/data/employees.ts"
click node_routes "https://github.com/nmechiworx/live_simulator/blob/main/src/data/routes.ts"
click node_safetydata "https://github.com/nmechiworx/live_simulator/blob/main/src/data/safetyZones.ts"
click node_monitoringdata "https://github.com/nmechiworx/live_simulator/blob/main/src/data/monitoring.ts"
click node_employeetype "https://github.com/nmechiworx/live_simulator/blob/main/src/types/employee.ts"
click node_routetype "https://github.com/nmechiworx/live_simulator/blob/main/src/types/route.ts"
click node_historytype "https://github.com/nmechiworx/live_simulator/blob/main/src/types/history.ts"

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_historytype,node_user toneBlue
class node_camera,node_walls,node_factoryzones,node_machine,node_workstation,node_restrictedview,node_trail toneAmber
class node_employeeview,node_movingemployee,node_routeview,node_routes,node_routetype toneMint
class node_dashboard,node_employees,node_safetydata,node_monitoringdata,node_employeetype toneRose
```

## Components

### Simulation orchestration

- [Simulation app](https://github.com/nmechiworx/live_simulator/blob/main/src/App.tsx): `src/App.tsx`
- [History model](https://github.com/nmechiworx/live_simulator/blob/main/src/types/history.ts): `src/types/history.ts`

### Factory visualization

- [Camera follow](https://github.com/nmechiworx/live_simulator/blob/main/src/components/CameraFollow.tsx): `src/components/CameraFollow.tsx`
- [Factory walls](https://github.com/nmechiworx/live_simulator/blob/main/src/components/FactoryWalls.tsx): `src/components/FactoryWalls.tsx`
- [Factory zones](https://github.com/nmechiworx/live_simulator/blob/main/src/components/FactoryZones.tsx): `src/components/FactoryZones.tsx`
- [Machine models](https://github.com/nmechiworx/live_simulator/blob/main/src/components/Machine.tsx): `src/components/Machine.tsx`
- [Workstations](https://github.com/nmechiworx/live_simulator/blob/main/src/components/Workstation.tsx): `src/components/Workstation.tsx`
- [Restricted zones](https://github.com/nmechiworx/live_simulator/blob/main/src/components/RestrictedZone.tsx): `src/components/RestrictedZone.tsx`
- [Movement trail](https://github.com/nmechiworx/live_simulator/blob/main/src/components/MovementTrail.tsx): `src/components/MovementTrail.tsx`

### Workforce and routes

- [Employee marker](https://github.com/nmechiworx/live_simulator/blob/main/src/components/EmployeeMarker.tsx): `src/components/EmployeeMarker.tsx`
- [Route movement](https://github.com/nmechiworx/live_simulator/blob/main/src/components/MovingEmployee.tsx): `src/components/MovingEmployee.tsx`
- [Route display](https://github.com/nmechiworx/live_simulator/blob/main/src/components/EmployeeRoute.tsx): `src/components/EmployeeRoute.tsx`
- [Route definitions](https://github.com/nmechiworx/live_simulator/blob/main/src/data/routes.ts): `src/data/routes.ts`
- [Route model](https://github.com/nmechiworx/live_simulator/blob/main/src/types/route.ts): `src/types/route.ts`

### Monitoring and domain data

- [Management dashboard](https://github.com/nmechiworx/live_simulator/blob/main/src/components/ManagementDashboard.tsx): `src/components/ManagementDashboard.tsx`
- [Employee records](https://github.com/nmechiworx/live_simulator/blob/main/src/data/employees.ts): `src/data/employees.ts`
- [Safety zones](https://github.com/nmechiworx/live_simulator/blob/main/src/data/safetyZones.ts): `src/data/safetyZones.ts`
- [Monitoring zones](https://github.com/nmechiworx/live_simulator/blob/main/src/data/monitoring.ts): `src/data/monitoring.ts`
- [Employee model](https://github.com/nmechiworx/live_simulator/blob/main/src/types/employee.ts): `src/types/employee.ts`

### Other components

- **Viewer**

## Connections

- Viewer → Simulation app: uses
- Simulation app → Factory walls: renders (evidence: `src/App.tsx`)
- Simulation app → Factory zones: renders (evidence: `src/App.tsx`)
- Simulation app → Machine models: renders (evidence: `src/App.tsx`)
- Simulation app → Restricted zones: renders (evidence: `src/App.tsx`)
- Simulation app → Camera follow: configures (evidence: `src/App.tsx`)
- Simulation app → Movement trail: renders (evidence: `src/App.tsx`)
- Simulation app → Safety zones: checks zones (evidence: `src/App.tsx`)
- Route movement → Employee marker: renders (evidence: `src/components/MovingEmployee.tsx`)
- Management dashboard → Employee records: reads (evidence: `src/components/ManagementDashboard.tsx`)
- Management dashboard → Route definitions: reads (evidence: `src/components/ManagementDashboard.tsx`)
- Management dashboard → Monitoring zones: uses (evidence: `src/components/ManagementDashboard.tsx`)
- Management dashboard → Safety zones: uses position type (evidence: `src/components/ManagementDashboard.tsx`)
- Employee records → Employee model: types records (evidence: `src/data/employees.ts`)
- Route definitions → Route model: types routes (evidence: `src/data/routes.ts`)
- Simulation app → Management dashboard: renders (evidence: `src/App.tsx`)
- Simulation app → Route movement: updates movement (evidence: `src/App.tsx`)
- Simulation app → Route display: renders routes (evidence: `src/App.tsx`)
- Simulation app → Employee records: loads records (evidence: `src/App.tsx`)
- Simulation app → Route definitions: loads routes (evidence: `src/App.tsx`)
- Simulation app → Workstations: renders (evidence: `src/App.tsx`)
- Simulation app → History model: tracks history (evidence: `src/App.tsx`)
