# team-code-4-chnage/project-garud architecture

> Architecture diagram of the GitHub repository team-code-4-chnage/project-garud, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/team-code-4-chnage/project-garud
- Repository: https://github.com/team-code-4-chnage/project-garud

## Overview

Project Garud is a network-attack monitoring and forecasting application. Operators use its dashboard to monitor live or uploaded flow telemetry; the backend validates and processes flows, scores them with a recurrent world model, persists sessions and alerts, and exposes forecasts, explanations, network context, and reports. Packet capture and deterministic signatures complement model scoring. The training pipeline is represented as a supporting model component, not as a claim about how production artifacts are built. Several route and UI implementations were not sampled, so their internal call paths are left unasserted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/team-code-4-chnage/project-garud/blob/main/frontend/src/App.jsx) (Dashboard shell), [`backend/app/ingestion.py`](https://github.com/team-code-4-chnage/project-garud/blob/main/backend/app/ingestion.py) (Flow processing), [`backend/app/inference.py`](https://github.com/team-code-4-chnage/project-garud/blob/main/backend/app/inference.py) (Forecast inference), [`capture/live_capture.py`](https://github.com/team-code-4-chnage/project-garud/blob/main/capture/live_capture.py) (Packet capture)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Operator interface"]
  node_app_ui["Dashboard shell<br/>[App.jsx]"]
  node_alert_view["Alerts view<br/>[AlertPanel.jsx]"]
  node_network_view["Network map<br/>[NetworkMap.jsx]"]
  node_settings_view["Settings view<br/>[SettingsPanel.jsx]"]
  node_explain_view["Explain view<br/>[ExplainView.jsx]"]
  node_reports_view["Reports view<br/>[ReportsView.jsx]"]
  node_frontend_api["API client<br/>[api.js]"]
end

subgraph group_service["API and monitoring"]
  node_api_app["FastAPI service<br/>[main.py]"]
  node_routes["API routes"]
  node_ingest_route["Flow ingestion route<br/>[ingest.py]"]
  node_ingestion["Flow processing<br/>[ingestion.py]"]
  node_capture["Packet capture<br/>[live_capture.py]"]
  node_database[("Flow and alert store<br/>[database.py]")]
end

subgraph group_analysis["Detection and context"]
  node_flow_features["Flow reconstruction<br/>[flow_state.py]"]
  node_signatures["Wire signatures<br/>[signatures.py]"]
  node_inference["Forecast inference<br/>[inference.py]"]
  node_artifacts["Model loader<br/>[model_loader.py]"]
  node_network_context["Network context<br/>[network_state.py]"]
  node_explanations["Session explanations<br/>[explain.py]"]
end

subgraph group_model["Model development"]
  node_training_model["World model<br/>[pipeline_fixed.py]"]
  node_v3_model["Network-state model<br/>[lib.py]"]
end

node_operator(("Security operator"))

node_operator -->|"operates"| node_app_ui
node_app_ui -->|"requests data"| node_frontend_api
node_app_ui -->|"renders"| node_alert_view
node_app_ui -->|"renders"| node_network_view
node_app_ui -->|"renders"| node_settings_view
node_app_ui -->|"renders"| node_explain_view
node_app_ui -->|"renders"| node_reports_view
node_app_ui -->|"controls capture"| node_api_app
node_api_app -->|"registers routes"| node_routes
node_routes -.->|"includes"| node_ingest_route
node_ingest_route -->|"processes flows"| node_ingestion
node_ingestion -->|"scores windows"| node_inference
node_ingestion -->|"persists records"| node_database
node_ingestion -->|"uses context"| node_network_context
node_inference -->|"uses loaded model"| node_artifacts
node_capture -->|"reconstructs flows"| node_flow_features
node_flow_features -->|"checks signatures"| node_signatures
node_capture -.->|"submits captured flows"| node_ingestion
node_explanations -->|"reads sessions"| node_database
node_explanations -->|"uses model"| node_inference
node_training_model -.->|"produces model artifacts"| node_artifacts
node_v3_model -.->|"shares model family"| node_training_model

click node_app_ui "https://github.com/team-code-4-chnage/project-garud/blob/main/frontend/src/App.jsx"
click node_alert_view "https://github.com/team-code-4-chnage/project-garud/blob/main/frontend/src/components/AlertPanel.jsx"
click node_network_view "https://github.com/team-code-4-chnage/project-garud/blob/main/frontend/src/components/NetworkMap.jsx"
click node_settings_view "https://github.com/team-code-4-chnage/project-garud/blob/main/frontend/src/components/SettingsPanel.jsx"
click node_explain_view "https://github.com/team-code-4-chnage/project-garud/blob/main/frontend/src/components/ExplainView.jsx"
click node_reports_view "https://github.com/team-code-4-chnage/project-garud/blob/main/frontend/src/components/ReportsView.jsx"
click node_frontend_api "https://github.com/team-code-4-chnage/project-garud/blob/main/frontend/src/api.js"
click node_api_app "https://github.com/team-code-4-chnage/project-garud/blob/main/backend/app/main.py"
click node_routes "https://github.com/team-code-4-chnage/project-garud/tree/main/backend/app/routes"
click node_ingest_route "https://github.com/team-code-4-chnage/project-garud/blob/main/backend/app/routes/ingest.py"
click node_ingestion "https://github.com/team-code-4-chnage/project-garud/blob/main/backend/app/ingestion.py"
click node_capture "https://github.com/team-code-4-chnage/project-garud/blob/main/capture/live_capture.py"
click node_flow_features "https://github.com/team-code-4-chnage/project-garud/blob/main/capture/flow_state.py"
click node_signatures "https://github.com/team-code-4-chnage/project-garud/blob/main/capture/signatures.py"
click node_inference "https://github.com/team-code-4-chnage/project-garud/blob/main/backend/app/inference.py"
click node_artifacts "https://github.com/team-code-4-chnage/project-garud/blob/main/backend/app/model_loader.py"
click node_database "https://github.com/team-code-4-chnage/project-garud/blob/main/backend/app/database.py"
click node_network_context "https://github.com/team-code-4-chnage/project-garud/blob/main/backend/app/network_state.py"
click node_explanations "https://github.com/team-code-4-chnage/project-garud/blob/main/backend/app/routes/explain.py"
click node_training_model "https://github.com/team-code-4-chnage/project-garud/blob/main/pipeline_fixed.py"
click node_v3_model "https://github.com/team-code-4-chnage/project-garud/blob/main/worldmodel_v3/lib.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_app_ui,node_alert_view,node_network_view,node_settings_view,node_explain_view,node_reports_view,node_frontend_api toneBlue
class node_api_app,node_routes,node_ingest_route,node_ingestion,node_capture,node_database toneAmber
class node_flow_features,node_signatures,node_inference,node_artifacts,node_network_context,node_explanations toneMint
class node_training_model,node_v3_model toneRose
class node_operator toneIndigo
```

## Components

### Operator interface

- [Dashboard shell](https://github.com/team-code-4-chnage/project-garud/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Alerts view](https://github.com/team-code-4-chnage/project-garud/blob/main/frontend/src/components/AlertPanel.jsx): `frontend/src/components/AlertPanel.jsx`
- [Network map](https://github.com/team-code-4-chnage/project-garud/blob/main/frontend/src/components/NetworkMap.jsx): `frontend/src/components/NetworkMap.jsx`
- [Settings view](https://github.com/team-code-4-chnage/project-garud/blob/main/frontend/src/components/SettingsPanel.jsx): `frontend/src/components/SettingsPanel.jsx`
- [Explain view](https://github.com/team-code-4-chnage/project-garud/blob/main/frontend/src/components/ExplainView.jsx): `frontend/src/components/ExplainView.jsx`
- [Reports view](https://github.com/team-code-4-chnage/project-garud/blob/main/frontend/src/components/ReportsView.jsx): `frontend/src/components/ReportsView.jsx`
- [API client](https://github.com/team-code-4-chnage/project-garud/blob/main/frontend/src/api.js): `frontend/src/api.js`

### API and monitoring

- [FastAPI service](https://github.com/team-code-4-chnage/project-garud/blob/main/backend/app/main.py): `backend/app/main.py`
- [API routes](https://github.com/team-code-4-chnage/project-garud/tree/main/backend/app/routes): `backend/app/routes`
- [Flow ingestion route](https://github.com/team-code-4-chnage/project-garud/blob/main/backend/app/routes/ingest.py): `backend/app/routes/ingest.py`
- [Flow processing](https://github.com/team-code-4-chnage/project-garud/blob/main/backend/app/ingestion.py): `backend/app/ingestion.py`
- [Packet capture](https://github.com/team-code-4-chnage/project-garud/blob/main/capture/live_capture.py): `capture/live_capture.py`
- [Flow and alert store](https://github.com/team-code-4-chnage/project-garud/blob/main/backend/app/database.py): `backend/app/database.py`

### Detection and context

- [Flow reconstruction](https://github.com/team-code-4-chnage/project-garud/blob/main/capture/flow_state.py): `capture/flow_state.py`
- [Wire signatures](https://github.com/team-code-4-chnage/project-garud/blob/main/capture/signatures.py): `capture/signatures.py`
- [Forecast inference](https://github.com/team-code-4-chnage/project-garud/blob/main/backend/app/inference.py): `backend/app/inference.py`
- [Model loader](https://github.com/team-code-4-chnage/project-garud/blob/main/backend/app/model_loader.py): `backend/app/model_loader.py`
- [Network context](https://github.com/team-code-4-chnage/project-garud/blob/main/backend/app/network_state.py): `backend/app/network_state.py`
- [Session explanations](https://github.com/team-code-4-chnage/project-garud/blob/main/backend/app/routes/explain.py): `backend/app/routes/explain.py`

### Model development

- [World model](https://github.com/team-code-4-chnage/project-garud/blob/main/pipeline_fixed.py): `pipeline_fixed.py`
- [Network-state model](https://github.com/team-code-4-chnage/project-garud/blob/main/worldmodel_v3/lib.py): `worldmodel_v3/lib.py`

### Other components

- **Security operator**

## Connections

- Security operator → Dashboard shell: operates (evidence: `README.md`)
- Dashboard shell → API client: requests data (evidence: `frontend/src/App.jsx`)
- Dashboard shell → Alerts view: renders (evidence: `frontend/src/App.jsx`)
- Dashboard shell → Network map: renders (evidence: `frontend/src/App.jsx`)
- Dashboard shell → Settings view: renders (evidence: `frontend/src/App.jsx`)
- Dashboard shell → Explain view: renders (evidence: `frontend/src/App.jsx`)
- Dashboard shell → Reports view: renders (evidence: `frontend/src/App.jsx`)
- Dashboard shell → FastAPI service: controls capture (evidence: `frontend/src/App.jsx`)
- FastAPI service → API routes: registers routes (evidence: `backend/app/main.py`)
- API routes → Flow ingestion route: includes (evidence: `backend/app/routes/ingest.py`)
- Flow ingestion route → Flow processing: processes flows (evidence: `backend/app/routes/ingest.py`)
- Flow processing → Forecast inference: scores windows (evidence: `backend/app/ingestion.py`)
- Flow processing → Flow and alert store: persists records (evidence: `backend/app/ingestion.py`)
- Flow processing → Network context: uses context (evidence: `backend/app/ingestion.py`)
- Forecast inference → Model loader: uses loaded model (evidence: `backend/app/inference.py`)
- Packet capture → Flow reconstruction: reconstructs flows (evidence: `capture/flow_state.py`)
- Flow reconstruction → Wire signatures: checks signatures (evidence: `capture/flow_state.py`)
- Packet capture → Flow processing: submits captured flows
- Session explanations → Flow and alert store: reads sessions (evidence: `backend/app/routes/explain.py`)
- Session explanations → Forecast inference: uses model (evidence: `backend/app/routes/explain.py`)
- World model → Model loader: produces model artifacts
- Network-state model → World model: shares model family
