# sahinurrahman-debug/missionsync architecture

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

- Interactive diagram: https://gitdiagram.com/sahinurrahman-debug/missionsync
- Repository: https://github.com/sahinurrahman-debug/missionsync

## Overview

MissionSync is a prototype live emergency-drill operations board. Net control enters field reports or views the shared picture; the backend parses and merges reports, assesses terrain and urgency, ranks incidents, recommends capability-matched unit deployments, and publishes snapshots to the dashboard. The simulator supplies evolving scenarios and xBD-derived evaluation truth. The graph reflects the documented pipeline and sampled API wiring; persistence, authentication, and other planned production capabilities are not shown as implemented.

Main entry points: [`backend/missionsync/orchestrator.py`](https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/orchestrator.py) (Pipeline orchestrator), [`backend/missionsync/llm.py`](https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/llm.py) (LLM client), [`frontend/src/App.tsx`](https://github.com/sahinurrahman-debug/missionsync/blob/main/frontend/src/App.tsx) (Live board), [`backend/missionsync/main.py`](https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/main.py) (FastAPI app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Dashboard"]
  node_dashboard["Live board<br/>[App.tsx]"]
end

subgraph group_api["API and delivery"]
  node_apiapp["FastAPI app<br/>[main.py]"]
  node_hub["Snapshot hub<br/>[main.py]"]
end

subgraph group_ops["Operations pipeline"]
  node_orchestrator["Pipeline orchestrator<br/>[orchestrator.py]"]
  node_world["World state<br/>[models.py]"]
end

subgraph group_intelligence["Agents and scenarios"]
  node_surveillance["Report parsing<br/>[agents.py]"]
  node_terrain["Terrain assessment<br/>[agents.py]"]
  node_risk["Urgency scoring<br/>[agents.py]"]
  node_logistics["Unit matching<br/>[agents.py]"]
  node_command["Recommendations<br/>[agents.py]"]
  node_llm["LLM client<br/>[llm.py]"]
  node_simulator["Scenario simulator<br/>[simulator.py]"]
  node_xbd["xBD loader<br/>[xbd.py]"]
end

node_operator(("Drill user"))
node_maptiles["Map tiles"]
node_groq["Groq API"]
node_kaggle["Kaggle dataset"]

node_operator -->|"uses"| node_dashboard
node_dashboard -->|"submits reports"| node_apiapp
node_apiapp -->|"injects report"| node_orchestrator
node_apiapp -->|"joins WebSocket"| node_hub
node_hub -->|"reads snapshots"| node_orchestrator
node_orchestrator -->|"broadcasts snapshots"| node_hub
node_dashboard -->|"receives snapshots"| node_apiapp
node_dashboard -->|"loads tiles"| node_maptiles
node_orchestrator -->|"advances scenario"| node_simulator
node_simulator -->|"loads seed records"| node_xbd
node_xbd -.->|"downloads annotations"| node_kaggle
node_orchestrator -->|"parses signals"| node_surveillance
node_orchestrator -->|"updates incidents"| node_world
node_orchestrator -->|"assesses terrain"| node_terrain
node_orchestrator -->|"scores incidents"| node_risk
node_terrain -->|"supplies assessment"| node_risk
node_orchestrator -->|"matches units"| node_logistics
node_orchestrator -->|"builds recommendations"| node_command
node_surveillance -->|"requests JSON"| node_llm
node_terrain -->|"requests JSON"| node_llm
node_risk -->|"requests JSON"| node_llm
node_logistics -->|"requests JSON"| node_llm
node_command -->|"requests JSON"| node_llm
node_llm -.->|"calls model"| node_groq

click node_dashboard "https://github.com/sahinurrahman-debug/missionsync/blob/main/frontend/src/App.tsx"
click node_apiapp "https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/main.py"
click node_hub "https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/main.py"
click node_orchestrator "https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/orchestrator.py"
click node_world "https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/models.py"
click node_surveillance "https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/agents.py"
click node_terrain "https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/agents.py"
click node_risk "https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/agents.py"
click node_logistics "https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/agents.py"
click node_command "https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/agents.py"
click node_llm "https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/llm.py"
click node_simulator "https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/simulator.py"
click node_xbd "https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/xbd.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_operator toneBlue
class node_apiapp,node_hub toneAmber
class node_orchestrator,node_world,node_groq toneMint
class node_surveillance,node_terrain,node_risk,node_logistics,node_command,node_llm,node_simulator,node_xbd toneRose
class node_maptiles,node_kaggle toneIndigo
```

## Components

### Dashboard

- [Live board](https://github.com/sahinurrahman-debug/missionsync/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`

### API and delivery

- [FastAPI app](https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/main.py): `backend/missionsync/main.py`
- [Snapshot hub](https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/main.py): `backend/missionsync/main.py`

### Operations pipeline

- [Pipeline orchestrator](https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/orchestrator.py): `backend/missionsync/orchestrator.py`
- [World state](https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/models.py): `backend/missionsync/models.py`

### Agents and scenarios

- [Report parsing](https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/agents.py): `backend/missionsync/agents.py`
- [Terrain assessment](https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/agents.py): `backend/missionsync/agents.py`
- [Urgency scoring](https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/agents.py): `backend/missionsync/agents.py`
- [Unit matching](https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/agents.py): `backend/missionsync/agents.py`
- [Recommendations](https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/agents.py): `backend/missionsync/agents.py`
- [LLM client](https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/llm.py): `backend/missionsync/llm.py`
- [Scenario simulator](https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/simulator.py): `backend/missionsync/simulator.py`
- [xBD loader](https://github.com/sahinurrahman-debug/missionsync/blob/main/backend/missionsync/xbd.py): `backend/missionsync/xbd.py`

### Other components

- **Drill user**
- **Map tiles**
- **Groq API**
- **Kaggle dataset**

## Connections

- Drill user → Live board: uses
- Live board → FastAPI app: submits reports
- FastAPI app → Pipeline orchestrator: injects report
- FastAPI app → Snapshot hub: joins WebSocket
- Snapshot hub → Pipeline orchestrator: reads snapshots
- Pipeline orchestrator → Snapshot hub: broadcasts snapshots
- Live board → FastAPI app: receives snapshots
- Live board → Map tiles: loads tiles
- Pipeline orchestrator → Scenario simulator: advances scenario
- Scenario simulator → xBD loader: loads seed records
- xBD loader → Kaggle dataset: downloads annotations
- Pipeline orchestrator → Report parsing: parses signals
- Pipeline orchestrator → World state: updates incidents
- Pipeline orchestrator → Terrain assessment: assesses terrain
- Pipeline orchestrator → Urgency scoring: scores incidents
- Terrain assessment → Urgency scoring: supplies assessment
- Pipeline orchestrator → Unit matching: matches units
- Pipeline orchestrator → Recommendations: builds recommendations
- Report parsing → LLM client: requests JSON
- Terrain assessment → LLM client: requests JSON
- Urgency scoring → LLM client: requests JSON
- Unit matching → LLM client: requests JSON
- Recommendations → LLM client: requests JSON
- LLM client → Groq API: calls model
