# mathewthomas2/employee-allocation-system architecture

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

- Interactive diagram: https://gitdiagram.com/mathewthomas2/employee-allocation-system
- Repository: https://github.com/mathewthomas2/employee-allocation-system

## Overview

The product monitors employee availability from video, identifies employees by badge OCR, and reports status to a central backend for supervisor and employee interfaces. The main path is video processing → status updates → dashboard/mobile consumption. The README documents those integrations; backend internals and Flutter/web UI source were not excerpted, so their internal behavior is shown only at a high level.

Main entry points: [`cv_engine/main.py`](https://github.com/mathewthomas2/employee-allocation-system/blob/main/cv_engine/main.py) (CV processor), [`backend/main.py`](https://github.com/mathewthomas2/employee-allocation-system/blob/main/backend/main.py) (Status API), [`run_scenario.py`](https://github.com/mathewthomas2/employee-allocation-system/blob/main/run_scenario.py) (Multi-camera runner), [`cv_engine/detector.py`](https://github.com/mathewthomas2/employee-allocation-system/blob/main/cv_engine/detector.py) (Person detector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_vision["Video monitoring"]
  node_cv_main["CV processor<br/>[main.py]"]
  node_detector["Person detector<br/>[detector.py]"]
  node_ocr["Badge OCR<br/>[ocr_module.py]"]
  node_interaction["Interaction logic<br/>[logic.py]"]
end

subgraph group_server["Status service"]
  node_backend["Status API<br/>[main.py]"]
end

subgraph group_interfaces["User interfaces"]
  node_dashboard["Supervisor dashboard<br/>[app.js]"]
  node_employee_app["Employee app"]
end

subgraph group_scenario["Scenario runner"]
  node_scenario_runner["Multi-camera runner<br/>[run_scenario.py]"]
end

node_video(("Video feed"))

node_video -->|"provides frames"| node_cv_main
node_cv_main -->|"detects people"| node_detector
node_cv_main -->|"reads badges"| node_ocr
node_cv_main -->|"initializes"| node_interaction
node_cv_main -->|"posts status"| node_backend
node_backend -.->|"serves status"| node_dashboard
node_employee_app -.->|"connects to"| node_backend
node_scenario_runner -->|"detects people"| node_detector
node_scenario_runner -->|"reads badges"| node_ocr
node_scenario_runner -->|"posts status"| node_backend

click node_cv_main "https://github.com/mathewthomas2/employee-allocation-system/blob/main/cv_engine/main.py"
click node_detector "https://github.com/mathewthomas2/employee-allocation-system/blob/main/cv_engine/detector.py"
click node_ocr "https://github.com/mathewthomas2/employee-allocation-system/blob/main/cv_engine/ocr_module.py"
click node_interaction "https://github.com/mathewthomas2/employee-allocation-system/blob/main/cv_engine/logic.py"
click node_backend "https://github.com/mathewthomas2/employee-allocation-system/blob/main/backend/main.py"
click node_dashboard "https://github.com/mathewthomas2/employee-allocation-system/blob/main/dashboard/app.js"
click node_employee_app "https://github.com/mathewthomas2/employee-allocation-system/tree/main/mobile_app/lib"
click node_scenario_runner "https://github.com/mathewthomas2/employee-allocation-system/blob/main/run_scenario.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_cv_main,node_detector,node_ocr,node_interaction toneBlue
class node_backend toneAmber
class node_dashboard,node_employee_app toneMint
class node_scenario_runner toneRose
class node_video toneIndigo
```

## Components

### Video monitoring

- [CV processor](https://github.com/mathewthomas2/employee-allocation-system/blob/main/cv_engine/main.py): `cv_engine/main.py`
- [Person detector](https://github.com/mathewthomas2/employee-allocation-system/blob/main/cv_engine/detector.py): `cv_engine/detector.py`
- [Badge OCR](https://github.com/mathewthomas2/employee-allocation-system/blob/main/cv_engine/ocr_module.py): `cv_engine/ocr_module.py`
- [Interaction logic](https://github.com/mathewthomas2/employee-allocation-system/blob/main/cv_engine/logic.py): `cv_engine/logic.py`

### Status service

- [Status API](https://github.com/mathewthomas2/employee-allocation-system/blob/main/backend/main.py): `backend/main.py`

### User interfaces

- [Supervisor dashboard](https://github.com/mathewthomas2/employee-allocation-system/blob/main/dashboard/app.js): `dashboard/app.js`
- [Employee app](https://github.com/mathewthomas2/employee-allocation-system/tree/main/mobile_app/lib): `mobile_app/lib`

### Scenario runner

- [Multi-camera runner](https://github.com/mathewthomas2/employee-allocation-system/blob/main/run_scenario.py): `run_scenario.py`

### Other components

- **Video feed**

## Connections

- Video feed → CV processor: provides frames (evidence: `cv_engine/main.py`)
- CV processor → Person detector: detects people (evidence: `cv_engine/main.py`)
- CV processor → Badge OCR: reads badges (evidence: `cv_engine/main.py`)
- CV processor → Interaction logic: initializes (evidence: `cv_engine/main.py`)
- CV processor → Status API: posts status (evidence: `cv_engine/main.py`)
- Status API → Supervisor dashboard: serves status (evidence: `README.md`)
- Employee app → Status API: connects to (evidence: `README.md`)
- Multi-camera runner → Person detector: detects people (evidence: `run_scenario.py`)
- Multi-camera runner → Badge OCR: reads badges (evidence: `run_scenario.py`)
- Multi-camera runner → Status API: posts status (evidence: `run_scenario.py`)
