# f1ni/oxhack2026 architecture

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

- Interactive diagram: https://gitdiagram.com/f1ni/oxhack2026
- Repository: https://github.com/f1ni/oxhack2026

## Overview

Rescue AI is a search-and-rescue mission simulator with a browser UI and FastAPI backend. The main workflow is to configure an area and search scenario, create a mission and probability heatmap, then advance drone scans while inspecting the map and mission status. Backend stages include geography and walking-route data, movement/route priors, mission orchestration, and optional camera detection. The tree also contains a separate dataset-reference implementation. Some links reflect documented capabilities; unsampled modules are not treated as inspected.

Main entry points: [`backend/app/simulation/engine.py`](https://github.com/f1ni/oxhack2026/blob/main/backend/app/simulation/engine.py) (Mission engine), [`backend/app/probability/routes.py`](https://github.com/f1ni/oxhack2026/blob/main/backend/app/probability/routes.py) (Route prior), [`frontend/src/features/mission/MissionDemo.tsx`](https://github.com/f1ni/oxhack2026/blob/main/frontend/src/features/mission/MissionDemo.tsx) (Mission workflow), [`frontend/src/components/SearchMap.tsx`](https://github.com/f1ni/oxhack2026/blob/main/frontend/src/components/SearchMap.tsx) (Search map)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Mission UI"]
  node_mission_ui["Mission workflow<br/>[MissionDemo.tsx]"]
  node_scenario_form["Scenario setup<br/>[ScenarioForm.tsx]"]
  node_api_client["API client<br/>[client.ts]"]
  node_search_grid["Search grid<br/>[SearchGrid.tsx]"]
  node_search_map["Search map<br/>[SearchMap.tsx]"]
  node_cell_inspector["Cell inspector<br/>[CellInspector.tsx]"]
  node_fleet["Drone overlays<br/>[fleet.ts]"]
end

subgraph group_backend["Simulation Backend"]
  node_api_routes["Mission API<br/>[routes.py]"]
  node_engine["Mission engine<br/>[engine.py]"]
  node_contracts["API contracts<br/>[models.py]"]
  node_planner["Search planning<br/>[adaptive.py]"]
  node_detector["YOLO detector<br/>[yolo.py]"]
end

subgraph group_geodata["Geography and Priors"]
  node_geography["Geography providers<br/>[interfaces.py]"]
  node_coordinates["Grid coordinates<br/>[coordinates.py]"]
  node_walking_router["Walking router<br/>[routing.py]"]
  node_route_prior["Route prior<br/>[routes.py]"]
  node_movement_prior["Movement prior<br/>[movement.py]"]
end

subgraph group_reference["Dataset Reference"]
  node_reference_api["Reference API<br/>[__init__.py]"]
  node_reference_engine["Reference simulator<br/>[__init__.py]"]
  node_reference_priors["Historical priors<br/>[priors.py]"]
  node_reference_terrain["Reference terrain<br/>[terrain.py]"]
end

node_user(("Rescue operator"))

node_user -->|"configures mission"| node_mission_ui
node_mission_ui -.->|"collects settings"| node_scenario_form
node_mission_ui -.->|"requests mission"| node_api_client
node_api_client -->|"calls API"| node_api_routes
node_api_routes -->|"creates mission"| node_engine
node_api_routes -->|"advances mission"| node_engine
node_engine -->|"uses contracts"| node_contracts
node_engine -->|"loads geography"| node_geography
node_engine -.->|"requests plans"| node_planner
node_engine -->|"uses detection"| node_detector
node_engine -.->|"generates prior"| node_route_prior
node_route_prior -->|"uses baseline"| node_movement_prior
node_route_prior -->|"routes paths"| node_walking_router
node_route_prior -->|"resolves cells"| node_coordinates
node_walking_router -->|"maps cells"| node_coordinates
node_search_grid -->|"renders map"| node_search_map
node_search_grid -->|"renders inspector"| node_cell_inspector
node_search_map -->|"renders inspector"| node_cell_inspector
node_search_map -->|"renders overlays"| node_fleet
node_reference_api -->|"creates router"| node_reference_engine
node_reference_engine -.->|"uses priors"| node_reference_priors
node_reference_engine -.->|"loads terrain"| node_reference_terrain

click node_mission_ui "https://github.com/f1ni/oxhack2026/blob/main/frontend/src/features/mission/MissionDemo.tsx"
click node_scenario_form "https://github.com/f1ni/oxhack2026/blob/main/frontend/src/features/mission/ScenarioForm.tsx"
click node_api_client "https://github.com/f1ni/oxhack2026/blob/main/frontend/src/api/client.ts"
click node_search_grid "https://github.com/f1ni/oxhack2026/blob/main/frontend/src/components/SearchGrid.tsx"
click node_search_map "https://github.com/f1ni/oxhack2026/blob/main/frontend/src/components/SearchMap.tsx"
click node_cell_inspector "https://github.com/f1ni/oxhack2026/blob/main/frontend/src/components/CellInspector.tsx"
click node_fleet "https://github.com/f1ni/oxhack2026/blob/main/frontend/src/maps/fleet.ts"
click node_api_routes "https://github.com/f1ni/oxhack2026/blob/main/backend/app/api/routes.py"
click node_engine "https://github.com/f1ni/oxhack2026/blob/main/backend/app/simulation/engine.py"
click node_contracts "https://github.com/f1ni/oxhack2026/blob/main/backend/app/schemas/models.py"
click node_geography "https://github.com/f1ni/oxhack2026/blob/main/backend/app/geography/interfaces.py"
click node_coordinates "https://github.com/f1ni/oxhack2026/blob/main/backend/app/geography/coordinates.py"
click node_walking_router "https://github.com/f1ni/oxhack2026/blob/main/backend/app/geography/routing.py"
click node_route_prior "https://github.com/f1ni/oxhack2026/blob/main/backend/app/probability/routes.py"
click node_movement_prior "https://github.com/f1ni/oxhack2026/blob/main/backend/app/probability/movement.py"
click node_planner "https://github.com/f1ni/oxhack2026/blob/main/backend/app/planning/adaptive.py"
click node_detector "https://github.com/f1ni/oxhack2026/blob/main/backend/app/vision/yolo.py"
click node_reference_api "https://github.com/f1ni/oxhack2026/blob/main/backend/dataset_reference/api/__init__.py"
click node_reference_engine "https://github.com/f1ni/oxhack2026/blob/main/backend/dataset_reference/simulation/__init__.py"
click node_reference_priors "https://github.com/f1ni/oxhack2026/blob/main/backend/dataset_reference/probability/priors.py"
click node_reference_terrain "https://github.com/f1ni/oxhack2026/blob/main/backend/dataset_reference/geography/terrain.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_mission_ui,node_scenario_form,node_api_client,node_search_grid,node_search_map,node_cell_inspector,node_fleet toneBlue
class node_api_routes,node_engine,node_contracts,node_planner,node_detector toneAmber
class node_geography,node_coordinates,node_walking_router,node_route_prior,node_movement_prior toneMint
class node_reference_api,node_reference_engine,node_reference_priors,node_reference_terrain toneRose
class node_user toneIndigo
```

## Components

### Mission UI

- [Mission workflow](https://github.com/f1ni/oxhack2026/blob/main/frontend/src/features/mission/MissionDemo.tsx): `frontend/src/features/mission/MissionDemo.tsx`
- [Scenario setup](https://github.com/f1ni/oxhack2026/blob/main/frontend/src/features/mission/ScenarioForm.tsx): `frontend/src/features/mission/ScenarioForm.tsx`
- [API client](https://github.com/f1ni/oxhack2026/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Search grid](https://github.com/f1ni/oxhack2026/blob/main/frontend/src/components/SearchGrid.tsx): `frontend/src/components/SearchGrid.tsx`
- [Search map](https://github.com/f1ni/oxhack2026/blob/main/frontend/src/components/SearchMap.tsx): `frontend/src/components/SearchMap.tsx`
- [Cell inspector](https://github.com/f1ni/oxhack2026/blob/main/frontend/src/components/CellInspector.tsx): `frontend/src/components/CellInspector.tsx`
- [Drone overlays](https://github.com/f1ni/oxhack2026/blob/main/frontend/src/maps/fleet.ts): `frontend/src/maps/fleet.ts`

### Simulation Backend

- [Mission API](https://github.com/f1ni/oxhack2026/blob/main/backend/app/api/routes.py): `backend/app/api/routes.py`
- [Mission engine](https://github.com/f1ni/oxhack2026/blob/main/backend/app/simulation/engine.py): `backend/app/simulation/engine.py`
- [API contracts](https://github.com/f1ni/oxhack2026/blob/main/backend/app/schemas/models.py): `backend/app/schemas/models.py`
- [Search planning](https://github.com/f1ni/oxhack2026/blob/main/backend/app/planning/adaptive.py): `backend/app/planning/adaptive.py`
- [YOLO detector](https://github.com/f1ni/oxhack2026/blob/main/backend/app/vision/yolo.py): `backend/app/vision/yolo.py`

### Geography and Priors

- [Geography providers](https://github.com/f1ni/oxhack2026/blob/main/backend/app/geography/interfaces.py): `backend/app/geography/interfaces.py`
- [Grid coordinates](https://github.com/f1ni/oxhack2026/blob/main/backend/app/geography/coordinates.py): `backend/app/geography/coordinates.py`
- [Walking router](https://github.com/f1ni/oxhack2026/blob/main/backend/app/geography/routing.py): `backend/app/geography/routing.py`
- [Route prior](https://github.com/f1ni/oxhack2026/blob/main/backend/app/probability/routes.py): `backend/app/probability/routes.py`
- [Movement prior](https://github.com/f1ni/oxhack2026/blob/main/backend/app/probability/movement.py): `backend/app/probability/movement.py`

### Dataset Reference

- [Reference API](https://github.com/f1ni/oxhack2026/blob/main/backend/dataset_reference/api/__init__.py): `backend/dataset_reference/api/__init__.py`
- [Reference simulator](https://github.com/f1ni/oxhack2026/blob/main/backend/dataset_reference/simulation/__init__.py): `backend/dataset_reference/simulation/__init__.py`
- [Historical priors](https://github.com/f1ni/oxhack2026/blob/main/backend/dataset_reference/probability/priors.py): `backend/dataset_reference/probability/priors.py`
- [Reference terrain](https://github.com/f1ni/oxhack2026/blob/main/backend/dataset_reference/geography/terrain.py): `backend/dataset_reference/geography/terrain.py`

### Other components

- **Rescue operator**

## Connections

- Rescue operator → Mission workflow: configures mission (evidence: `README.md`)
- Mission workflow → Scenario setup: collects settings
- Mission workflow → API client: requests mission
- API client → Mission API: calls API (evidence: `README.md`)
- Mission API → Mission engine: creates mission (evidence: `backend/app/api/routes.py`)
- Mission API → Mission engine: advances mission (evidence: `backend/app/api/routes.py`)
- Mission engine → API contracts: uses contracts (evidence: `backend/app/simulation/engine.py`)
- Mission engine → Geography providers: loads geography (evidence: `backend/app/simulation/engine.py`)
- Mission engine → Search planning: requests plans
- Mission engine → YOLO detector: uses detection (evidence: `backend/app/simulation/engine.py`)
- Mission engine → Route prior: generates prior
- Route prior → Movement prior: uses baseline (evidence: `backend/app/probability/routes.py`)
- Route prior → Walking router: routes paths (evidence: `backend/app/probability/routes.py`)
- Route prior → Grid coordinates: resolves cells (evidence: `backend/app/probability/routes.py`)
- Walking router → Grid coordinates: maps cells (evidence: `backend/app/geography/routing.py`)
- Search grid → Search map: renders map (evidence: `frontend/src/components/SearchGrid.tsx`)
- Search grid → Cell inspector: renders inspector (evidence: `frontend/src/components/SearchGrid.tsx`)
- Search map → Cell inspector: renders inspector (evidence: `frontend/src/components/SearchMap.tsx`)
- Search map → Drone overlays: renders overlays (evidence: `frontend/src/components/SearchMap.tsx`)
- Reference API → Reference simulator: creates router (evidence: `backend/dataset_reference/api/__init__.py`)
- Reference simulator → Historical priors: uses priors
- Reference simulator → Reference terrain: loads terrain
