# tryph0n/hybrid-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/tryph0n/hybrid-tracker
- Repository: https://github.com/tryph0n/hybrid-tracker

## Overview

The product is a Streamlit dashboard for exploring European hybrid incidents, backed by per-source CSV snapshots. Its user workflow loads the unified events, filters them, and presents maps, charts, and a table. A separate ingestion workflow fetches registered sources, normalizes and validates events, then writes the stored CSVs. The graph preserves both source adapters and the shared schema; it omits delivery and documentation tooling. Edges reflect the shown calls, imports, and README-described storage behavior; unsampled dashboard details are represented at the app level.

Main entry points: [`src/tracker/sources.py`](https://github.com/tryph0n/hybrid-tracker/blob/main/src/tracker/sources.py) (Source registry and reader), [`src/tracker/schema.py`](https://github.com/tryph0n/hybrid-tracker/blob/main/src/tracker/schema.py) (Unified event schema and validation), [`src/tracker/ingest.py`](https://github.com/tryph0n/hybrid-tracker/blob/main/src/tracker/ingest.py) (Ingestion command), [`src/streamlit_app.py`](https://github.com/tryph0n/hybrid-tracker/blob/main/src/streamlit_app.py) (Dashboard and visualizations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Incident dashboard"]
  node_dashboard_app["Dashboard and visualizations<br/>[streamlit_app.py]"]
end

subgraph group_ingestion["Data ingestion"]
  node_stored_events[("Event CSV snapshots")]
  node_ingest_command["Ingestion command<br/>[ingest.py]"]
  node_source_registry["Source registry and reader<br/>[sources.py]"]
  node_eodi_adapter["EODI adapter<br/>[eodi.py]"]
  node_leiden_adapter["Leiden adapter<br/>[leiden.py]"]
end

subgraph group_contracts["Shared data contract"]
  node_event_schema["Unified event schema and validation<br/>[schema.py]"]
end

node_visitor(("Dashboard visitor"))
node_eodi_service{{"EODI open dataset"}}
node_leiden_service{{"Leiden dataset"}}

node_visitor -->|"uses dashboard"| node_dashboard_app
node_dashboard_app -->|"loads events"| node_source_registry
node_dashboard_app -->|"uses constants"| node_event_schema
node_source_registry -->|"reads CSVs"| node_stored_events
node_ingest_command -->|"selects sources"| node_source_registry
node_ingest_command -->|"validates events"| node_event_schema
node_ingest_command -->|"writes CSVs"| node_stored_events
node_source_registry -->|"registers fetch"| node_eodi_adapter
node_source_registry -->|"registers fetch"| node_leiden_adapter
node_eodi_adapter -->|"formats columns"| node_event_schema
node_leiden_adapter -->|"formats columns"| node_event_schema
node_eodi_adapter -->|"fetches register"| node_eodi_service
node_leiden_adapter -->|"fetches spreadsheet"| node_leiden_service

click node_dashboard_app "https://github.com/tryph0n/hybrid-tracker/blob/main/src/streamlit_app.py"
click node_stored_events "https://github.com/tryph0n/hybrid-tracker/tree/main/data/events"
click node_ingest_command "https://github.com/tryph0n/hybrid-tracker/blob/main/src/tracker/ingest.py"
click node_source_registry "https://github.com/tryph0n/hybrid-tracker/blob/main/src/tracker/sources.py"
click node_eodi_adapter "https://github.com/tryph0n/hybrid-tracker/blob/main/src/tracker/eodi.py"
click node_leiden_adapter "https://github.com/tryph0n/hybrid-tracker/blob/main/src/tracker/leiden.py"
click node_event_schema "https://github.com/tryph0n/hybrid-tracker/blob/main/src/tracker/schema.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_app toneBlue
class node_stored_events,node_ingest_command,node_source_registry,node_eodi_adapter,node_leiden_adapter toneAmber
class node_event_schema toneMint
class node_visitor,node_eodi_service,node_leiden_service toneIndigo
```

## Components

### Incident dashboard

- [Dashboard and visualizations](https://github.com/tryph0n/hybrid-tracker/blob/main/src/streamlit_app.py): `src/streamlit_app.py`

### Data ingestion

- [Event CSV snapshots](https://github.com/tryph0n/hybrid-tracker/tree/main/data/events): `data/events`
- [Ingestion command](https://github.com/tryph0n/hybrid-tracker/blob/main/src/tracker/ingest.py): `src/tracker/ingest.py`
- [Source registry and reader](https://github.com/tryph0n/hybrid-tracker/blob/main/src/tracker/sources.py): `src/tracker/sources.py`
- [EODI adapter](https://github.com/tryph0n/hybrid-tracker/blob/main/src/tracker/eodi.py): `src/tracker/eodi.py`
- [Leiden adapter](https://github.com/tryph0n/hybrid-tracker/blob/main/src/tracker/leiden.py): `src/tracker/leiden.py`

### Shared data contract

- [Unified event schema and validation](https://github.com/tryph0n/hybrid-tracker/blob/main/src/tracker/schema.py): `src/tracker/schema.py`

### Other components

- **Dashboard visitor**
- **EODI open dataset**
- **Leiden dataset**

## Connections

- Dashboard visitor → Dashboard and visualizations: uses dashboard (evidence: `README.md`)
- Dashboard and visualizations → Source registry and reader: loads events (evidence: `src/streamlit_app.py`)
- Dashboard and visualizations → Unified event schema and validation: uses constants (evidence: `src/streamlit_app.py`)
- Source registry and reader → Event CSV snapshots: reads CSVs (evidence: `src/tracker/sources.py`)
- Ingestion command → Source registry and reader: selects sources (evidence: `src/tracker/ingest.py`)
- Ingestion command → Unified event schema and validation: validates events (evidence: `src/tracker/ingest.py`)
- Ingestion command → Event CSV snapshots: writes CSVs (evidence: `src/tracker/ingest.py`)
- Source registry and reader → EODI adapter: registers fetch (evidence: `src/tracker/sources.py`)
- Source registry and reader → Leiden adapter: registers fetch (evidence: `src/tracker/sources.py`)
- EODI adapter → Unified event schema and validation: formats columns (evidence: `src/tracker/eodi.py`)
- Leiden adapter → Unified event schema and validation: formats columns (evidence: `src/tracker/leiden.py`)
- EODI adapter → EODI open dataset: fetches register (evidence: `src/tracker/eodi.py`)
- Leiden adapter → Leiden dataset: fetches spreadsheet (evidence: `src/tracker/leiden.py`)
