# ujwal-naik/aegisops architecture

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

- Interactive diagram: https://gitdiagram.com/ujwal-naik/aegisops
- Repository: https://github.com/ujwal-naik/aegisops

## Overview

AegisOps is an offline-first emergency coordination platform. Its main workflow accepts a field report, assesses START triage, clusters spatial duplicates, stores incidents and fleet state, and lets operators trigger capability-aware ICS dispatch. The dashboard and field CLI expose these workflows; mesh sync exchanges incident and unit updates between disconnected nodes. README capabilities are retained, but some UI telemetry wiring and implementation details are not shown in the excerpts, so those links are documented rather than inferred from module names.

Main entry points: [`aegisops/api.py`](https://github.com/ujwal-naik/aegisops/blob/main/aegisops/api.py) (Coordination API), [`aegisops/models.py`](https://github.com/ujwal-naik/aegisops/blob/main/aegisops/models.py) (Tactical data models), [`static/app.js`](https://github.com/ujwal-naik/aegisops/blob/main/static/app.js) (Tactical dashboard), [`aegisops/dedup.py`](https://github.com/ujwal-naik/aegisops/blob/main/aegisops/dedup.py) (Spatial deduplication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operator["Operator Interfaces"]
  node_dashboard["Tactical dashboard<br/>[app.js]"]
  node_field_cli["Field CLI<br/>[aegisctl.py]"]
end

subgraph group_coordination["Incident Coordination"]
  node_api["Coordination API<br/>[api.py]"]
  node_incident_store[("Incident and fleet store<br/>[database.py]")]
  node_domain_models["Tactical data models<br/>[models.py]"]
  node_server_launcher["Local server launcher<br/>[main.py]"]
end

subgraph group_domain["Tactical Engines"]
  node_triage["START triage<br/>[triage.py]"]
  node_dedup["Spatial deduplication<br/>[dedup.py]"]
  node_dispatch["ICS dispatch optimizer<br/>[dispatch.py]"]
end

subgraph group_resilience["Offline Resilience"]
  node_mesh["DTN mesh sync<br/>[mesh_sync.py]"]
end

subgraph group_scenario["Scenario Data"]
  node_scenario_loader["Disaster scenario loader<br/>[seed_disaster.py]"]
end

node_operator(("Emergency operators"))
node_peer_node(("Peer mesh node"))

node_operator -->|"uses"| node_dashboard
node_operator -->|"uses"| node_field_cli
node_dashboard -->|"submits reports"| node_api
node_dashboard -->|"requests dispatch"| node_api
node_dashboard -->|"sends sync"| node_api
node_dashboard -.->|"loads telemetry"| node_api
node_field_cli -->|"calls endpoints"| node_api
node_api -->|"assesses reports"| node_triage
node_api -->|"checks duplicates"| node_dedup
node_api -->|"runs matching"| node_dispatch
node_api -->|"ingests and exports"| node_mesh
node_api -->|"reads and writes"| node_incident_store
node_api -->|"uses request models"| node_domain_models
node_incident_store -->|"persists records"| node_domain_models
node_triage -->|"returns assessment"| node_domain_models
node_dedup -->|"merges incidents"| node_domain_models
node_dispatch -->|"calculates distance"| node_dedup
node_dispatch -->|"updates assignments"| node_domain_models
node_mesh -->|"exchanges records"| node_incident_store
node_mesh -->|"clusters incoming reports"| node_dedup
node_mesh -->|"reconciles payloads"| node_domain_models
node_peer_node -->|"sends sync package"| node_api
node_api -->|"exports delta"| node_peer_node
node_server_launcher -->|"loads scenario"| node_scenario_loader
node_scenario_loader -->|"seeds state"| node_incident_store
node_scenario_loader -->|"assesses samples"| node_triage
node_scenario_loader -->|"clusters samples"| node_dedup
node_server_launcher -->|"starts server"| node_api

click node_dashboard "https://github.com/ujwal-naik/aegisops/blob/main/static/app.js"
click node_field_cli "https://github.com/ujwal-naik/aegisops/blob/main/cli/aegisctl.py"
click node_api "https://github.com/ujwal-naik/aegisops/blob/main/aegisops/api.py"
click node_incident_store "https://github.com/ujwal-naik/aegisops/blob/main/aegisops/database.py"
click node_domain_models "https://github.com/ujwal-naik/aegisops/blob/main/aegisops/models.py"
click node_triage "https://github.com/ujwal-naik/aegisops/blob/main/aegisops/triage.py"
click node_dedup "https://github.com/ujwal-naik/aegisops/blob/main/aegisops/dedup.py"
click node_dispatch "https://github.com/ujwal-naik/aegisops/blob/main/aegisops/dispatch.py"
click node_mesh "https://github.com/ujwal-naik/aegisops/blob/main/aegisops/mesh_sync.py"
click node_scenario_loader "https://github.com/ujwal-naik/aegisops/blob/main/simulator/seed_disaster.py"
click node_server_launcher "https://github.com/ujwal-naik/aegisops/blob/main/main.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_dashboard,node_field_cli toneBlue
class node_api,node_incident_store,node_domain_models,node_server_launcher toneAmber
class node_triage,node_dedup,node_dispatch toneMint
class node_mesh toneRose
class node_scenario_loader,node_operator,node_peer_node toneIndigo
```

## Components

### Operator Interfaces

- [Tactical dashboard](https://github.com/ujwal-naik/aegisops/blob/main/static/app.js): `static/app.js`
- [Field CLI](https://github.com/ujwal-naik/aegisops/blob/main/cli/aegisctl.py): `cli/aegisctl.py`

### Incident Coordination

- [Coordination API](https://github.com/ujwal-naik/aegisops/blob/main/aegisops/api.py): `aegisops/api.py`
- [Incident and fleet store](https://github.com/ujwal-naik/aegisops/blob/main/aegisops/database.py): `aegisops/database.py`
- [Tactical data models](https://github.com/ujwal-naik/aegisops/blob/main/aegisops/models.py): `aegisops/models.py`
- [Local server launcher](https://github.com/ujwal-naik/aegisops/blob/main/main.py): `main.py`

### Tactical Engines

- [START triage](https://github.com/ujwal-naik/aegisops/blob/main/aegisops/triage.py): `aegisops/triage.py`
- [Spatial deduplication](https://github.com/ujwal-naik/aegisops/blob/main/aegisops/dedup.py): `aegisops/dedup.py`
- [ICS dispatch optimizer](https://github.com/ujwal-naik/aegisops/blob/main/aegisops/dispatch.py): `aegisops/dispatch.py`

### Offline Resilience

- [DTN mesh sync](https://github.com/ujwal-naik/aegisops/blob/main/aegisops/mesh_sync.py): `aegisops/mesh_sync.py`

### Scenario Data

- [Disaster scenario loader](https://github.com/ujwal-naik/aegisops/blob/main/simulator/seed_disaster.py): `simulator/seed_disaster.py`

### Other components

- **Emergency operators**
- **Peer mesh node**

## Connections

- Emergency operators → Tactical dashboard: uses (evidence: `README.md`)
- Emergency operators → Field CLI: uses (evidence: `cli/aegisctl.py`)
- Tactical dashboard → Coordination API: submits reports (evidence: `static/app.js`)
- Tactical dashboard → Coordination API: requests dispatch (evidence: `static/app.js`)
- Tactical dashboard → Coordination API: sends sync (evidence: `static/app.js`)
- Tactical dashboard → Coordination API: loads telemetry (evidence: `README.md`)
- Field CLI → Coordination API: calls endpoints (evidence: `cli/aegisctl.py`)
- Coordination API → START triage: assesses reports (evidence: `aegisops/api.py`)
- Coordination API → Spatial deduplication: checks duplicates (evidence: `aegisops/api.py`)
- Coordination API → ICS dispatch optimizer: runs matching (evidence: `aegisops/api.py`)
- Coordination API → DTN mesh sync: ingests and exports (evidence: `aegisops/api.py`)
- Coordination API → Incident and fleet store: reads and writes (evidence: `aegisops/api.py`)
- Coordination API → Tactical data models: uses request models (evidence: `aegisops/api.py`)
- Incident and fleet store → Tactical data models: persists records (evidence: `aegisops/database.py`)
- START triage → Tactical data models: returns assessment (evidence: `aegisops/triage.py`)
- Spatial deduplication → Tactical data models: merges incidents (evidence: `aegisops/dedup.py`)
- ICS dispatch optimizer → Spatial deduplication: calculates distance (evidence: `aegisops/dispatch.py`)
- ICS dispatch optimizer → Tactical data models: updates assignments (evidence: `aegisops/dispatch.py`)
- DTN mesh sync → Incident and fleet store: exchanges records (evidence: `aegisops/mesh_sync.py`)
- DTN mesh sync → Spatial deduplication: clusters incoming reports (evidence: `aegisops/mesh_sync.py`)
- DTN mesh sync → Tactical data models: reconciles payloads (evidence: `aegisops/mesh_sync.py`)
- Peer mesh node → Coordination API: sends sync package (evidence: `aegisops/api.py`)
- Coordination API → Peer mesh node: exports delta (evidence: `aegisops/api.py`)
- Local server launcher → Disaster scenario loader: loads scenario (evidence: `main.py`)
- Disaster scenario loader → Incident and fleet store: seeds state (evidence: `simulator/seed_disaster.py`)
- Disaster scenario loader → START triage: assesses samples (evidence: `simulator/seed_disaster.py`)
- Disaster scenario loader → Spatial deduplication: clusters samples (evidence: `simulator/seed_disaster.py`)
- Local server launcher → Coordination API: starts server (evidence: `main.py`)
