# argonyx-26/t12-gryffindor architecture

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

- Interactive diagram: https://gitdiagram.com/argonyx-26/t12-gryffindor
- Repository: https://github.com/argonyx-26/t12-gryffindor

## Overview

Sentinel fuses CCTV vision, physical-access and cyber-authentication observations into explainable incidents, persists event and incident state, then streams alerts to a tactical dashboard. Producers send normalized events to FastAPI; temporal correlation and contextual scoring produce and update incidents, while PostgreSQL and Redis support persistence and live fan-out. The README documents the broad pipeline; sampled source confirms selected calls and dashboard composition, but does not expose every ingestion, persistence or broadcast call, so those documented links cite the README.

Main entry points: [`backend/main.py`](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/main.py) (Ingest and incident API), [`frontend/src/App.jsx`](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/frontend/src/App.jsx) (Dashboard application), [`backend/database.py`](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/database.py) (PostgreSQL access), [`simulators/common.py`](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/simulators/common.py) (Event producer helper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sources["Event sources"]
  node_vision["Vision worker<br/>[vision_worker.py]"]
  node_video["Video analytics<br/>[video_engine.py]"]
  node_physical["Physical sensors<br/>[sensor_sim.py]"]
  node_cyber["Cyber events<br/>[syslog_sim.py]"]
  node_event_helper["Event producer helper<br/>[common.py]"]
end

subgraph group_ingest["Ingestion and intelligence"]
  node_event_schema["Event and incident schema<br/>[models.py]"]
  node_api["Ingest and incident API<br/>[main.py]"]
  node_temporal["Temporal analytics<br/>[temporal_engine.py]"]
  node_scoring["Threat scoring<br/>[scoring_engine.py]"]
  node_cctv_adapter["CCTV adapter<br/>[cctv_adapter.py]"]
  node_zones["Zone configuration<br/>[location_config.py]"]
end

subgraph group_state["State and telemetry"]
  node_config["Runtime configuration<br/>[config.py]"]
  node_database["PostgreSQL access<br/>[database.py]"]
  node_db_models["Persistence models<br/>[db_models.py]"]
  node_redis["Redis state and pub/sub<br/>[redis_client.py]"]
  node_latency["Latency collection"]
end

subgraph group_dashboard["Tactical dashboard"]
  node_dashboard_app["Dashboard application<br/>[App.jsx]"]
  node_socket_hook["Alert WebSocket hook<br/>[useAlertSocket.js]"]
  node_feed["Live alert feed<br/>[LiveAlertFeed.jsx]"]
  node_alert_card["Alert details<br/>[AlertCard.jsx]"]
  node_evidence["Evidence drawer<br/>[EvidenceDrawer.jsx]"]
  node_map["Threat map<br/>[MapPanel.jsx]"]
  node_header["Operations header<br/>[Header.jsx]"]
end

node_operator(("Security operator"))
node_postgres[("PostgreSQL")]
node_redis_service[("Redis")]

node_vision -->|"posts events"| node_api
node_video -->|"creates events"| node_event_schema
node_physical -->|"builds events"| node_event_helper
node_cyber -->|"builds events"| node_event_helper
node_event_helper -->|"posts events"| node_api
node_api -->|"validates events"| node_event_schema
node_api -->|"correlates events"| node_temporal
node_api -->|"scores threats"| node_scoring
node_scoring -->|"uses patterns"| node_temporal
node_api -->|"persists records"| node_database
node_database -->|"maps records"| node_db_models
node_database -->|"reads and writes"| node_postgres
node_temporal -->|"loads baselines"| node_db_models
node_api -->|"caches and publishes"| node_redis
node_redis -->|"uses cache"| node_redis_service
node_api -->|"records timings"| node_latency
node_video -->|"records timings"| node_latency
node_api -->|"uses zone context"| node_zones
node_api -->|"loads settings"| node_config
node_dashboard_app -->|"subscribes to alerts"| node_socket_hook
node_socket_hook -->|"receives alert stream"| node_api
node_api -->|"fans out alerts"| node_redis
node_dashboard_app -->|"renders feed"| node_feed
node_feed -->|"renders alerts"| node_alert_card
node_dashboard_app -->|"renders evidence"| node_evidence
node_dashboard_app -->|"renders map"| node_map
node_dashboard_app -->|"renders header"| node_header
node_operator -.->|"reviews alerts"| node_dashboard_app

click node_vision "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/ai/vision_worker.py"
click node_video "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/video_engine.py"
click node_physical "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/simulators/sensor_sim.py"
click node_cyber "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/simulators/syslog_sim.py"
click node_event_helper "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/simulators/common.py"
click node_event_schema "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/models.py"
click node_api "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/main.py"
click node_temporal "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/temporal_engine.py"
click node_scoring "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/scoring_engine.py"
click node_cctv_adapter "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/cctv_adapter.py"
click node_zones "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/location_config.py"
click node_config "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/config.py"
click node_database "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/database.py"
click node_db_models "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/db_models.py"
click node_redis "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/redis_client.py"
click node_latency "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/latency_collector.py"
click node_dashboard_app "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/frontend/src/App.jsx"
click node_socket_hook "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/frontend/src/hooks/useAlertSocket.js"
click node_feed "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/frontend/src/components/LiveAlertFeed.jsx"
click node_alert_card "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/frontend/src/components/AlertCard.jsx"
click node_evidence "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/frontend/src/components/EvidenceDrawer.jsx"
click node_map "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/frontend/src/components/MapPanel.jsx"
click node_header "https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/frontend/src/components/Header.jsx"

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_vision,node_video,node_physical,node_cyber,node_event_helper toneBlue
class node_event_schema,node_api,node_temporal,node_scoring,node_cctv_adapter,node_zones,node_postgres,node_redis_service toneAmber
class node_config,node_database,node_db_models,node_redis,node_latency toneMint
class node_dashboard_app,node_socket_hook,node_feed,node_alert_card,node_evidence,node_map,node_header toneRose
class node_operator toneIndigo
```

## Components

### Event sources

- [Vision worker](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/ai/vision_worker.py): `ai/vision_worker.py`
- [Video analytics](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/video_engine.py): `backend/video_engine.py`
- [Physical sensors](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/simulators/sensor_sim.py): `simulators/sensor_sim.py`
- [Cyber events](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/simulators/syslog_sim.py): `simulators/syslog_sim.py`
- [Event producer helper](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/simulators/common.py): `simulators/common.py`

### Ingestion and intelligence

- [Event and incident schema](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/models.py): `backend/models.py`
- [Ingest and incident API](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/main.py): `backend/main.py`
- [Temporal analytics](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/temporal_engine.py): `backend/temporal_engine.py`
- [Threat scoring](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/scoring_engine.py): `backend/scoring_engine.py`
- [CCTV adapter](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/cctv_adapter.py): `backend/cctv_adapter.py`
- [Zone configuration](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/location_config.py): `backend/location_config.py`

### State and telemetry

- [Runtime configuration](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/config.py): `backend/config.py`
- [PostgreSQL access](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/database.py): `backend/database.py`
- [Persistence models](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/db_models.py): `backend/db_models.py`
- [Redis state and pub/sub](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/redis_client.py): `backend/redis_client.py`
- [Latency collection](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/backend/latency_collector.py): `backend/latency_collector.py`

### Tactical dashboard

- [Dashboard application](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Alert WebSocket hook](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/frontend/src/hooks/useAlertSocket.js): `frontend/src/hooks/useAlertSocket.js`
- [Live alert feed](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/frontend/src/components/LiveAlertFeed.jsx): `frontend/src/components/LiveAlertFeed.jsx`
- [Alert details](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/frontend/src/components/AlertCard.jsx): `frontend/src/components/AlertCard.jsx`
- [Evidence drawer](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/frontend/src/components/EvidenceDrawer.jsx): `frontend/src/components/EvidenceDrawer.jsx`
- [Threat map](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/frontend/src/components/MapPanel.jsx): `frontend/src/components/MapPanel.jsx`
- [Operations header](https://github.com/argonyx-26/t12-gryffindor/blob/pragna-pipeline/frontend/src/components/Header.jsx): `frontend/src/components/Header.jsx`

### Other components

- **Security operator**
- **PostgreSQL**
- **Redis**

## Connections

- Vision worker → Ingest and incident API: posts events (evidence: `README.md`)
- Video analytics → Event and incident schema: creates events (evidence: `backend/video_engine.py`)
- Physical sensors → Event producer helper: builds events (evidence: `simulators/sensor_sim.py`)
- Cyber events → Event producer helper: builds events (evidence: `simulators/syslog_sim.py`)
- Event producer helper → Ingest and incident API: posts events (evidence: `simulators/common.py`)
- Ingest and incident API → Event and incident schema: validates events (evidence: `README.md`)
- Ingest and incident API → Temporal analytics: correlates events (evidence: `backend/main.py`)
- Ingest and incident API → Threat scoring: scores threats (evidence: `backend/main.py`)
- Threat scoring → Temporal analytics: uses patterns (evidence: `backend/scoring_engine.py`)
- Ingest and incident API → PostgreSQL access: persists records (evidence: `README.md`)
- PostgreSQL access → Persistence models: maps records (evidence: `backend/database.py`)
- PostgreSQL access → PostgreSQL: reads and writes (evidence: `README.md`)
- Temporal analytics → Persistence models: loads baselines (evidence: `backend/temporal_engine.py`)
- Ingest and incident API → Redis state and pub/sub: caches and publishes (evidence: `README.md`)
- Redis state and pub/sub → Redis: uses cache (evidence: `backend/redis_client.py`)
- Ingest and incident API → Latency collection: records timings (evidence: `README.md`)
- Video analytics → Latency collection: records timings (evidence: `backend/video_engine.py`)
- Ingest and incident API → Zone configuration: uses zone context (evidence: `backend/main.py`)
- Ingest and incident API → Runtime configuration: loads settings (evidence: `backend/main.py`)
- Dashboard application → Alert WebSocket hook: subscribes to alerts (evidence: `frontend/src/App.jsx`)
- Alert WebSocket hook → Ingest and incident API: receives alert stream (evidence: `README.md`)
- Ingest and incident API → Redis state and pub/sub: fans out alerts (evidence: `README.md`)
- Dashboard application → Live alert feed: renders feed (evidence: `frontend/src/App.jsx`)
- Live alert feed → Alert details: renders alerts (evidence: `frontend/src/components/LiveAlertFeed.jsx`)
- Dashboard application → Evidence drawer: renders evidence (evidence: `frontend/src/App.jsx`)
- Dashboard application → Threat map: renders map (evidence: `frontend/src/App.jsx`)
- Dashboard application → Operations header: renders header (evidence: `frontend/src/App.jsx`)
- Security operator → Dashboard application: reviews alerts
