# dev-next-gen/orodruin architecture

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

- Interactive diagram: https://gitdiagram.com/dev-next-gen/orodruin
- Repository: https://github.com/dev-next-gen/orodruin

## Overview

Orodruin is a self-hosted OSINT platform: it gathers public-source intelligence, stores selected feeds, serves them through a FastAPI backend, and presents them in a live map and actor graph. The principal workflow runs from source ingestion or live API proxying, through storage and analysis, to frontend visualization; the AI analyst adds a tool-driven question-and-action path. The README documents capabilities beyond the sampled code; relationships for those branches are shown at the documented subsystem level rather than inferred from filenames.

Main entry points: [`backend/app/main.py`](https://github.com/dev-next-gen/orodruin/blob/main/backend/app/main.py) (FastAPI application), [`backend/app/api/chat.py`](https://github.com/dev-next-gen/orodruin/blob/main/backend/app/api/chat.py) (AI analyst tools), [`frontend/src/App.jsx`](https://github.com/dev-next-gen/orodruin/blob/main/frontend/src/App.jsx) (Application shell), [`backend/app/db.py`](https://github.com/dev-next-gen/orodruin/blob/main/backend/app/db.py) (PostgreSQL store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Collection &amp; storage"]
  node_ingesters["Feed ingesters"]
  node_database[("PostgreSQL store<br/>[db.py]")]
  node_data_models["Intelligence records<br/>[models.py]"]
end

subgraph group_backend["Backend intelligence"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_event_api["Events &amp; actor graph<br/>[events.py]"]
  node_graph_api["Graph endpoint<br/>[graph.py]"]
  node_live_layers["Live map layers"]
  node_camera_api["Camera aggregation<br/>[cameras.py]"]
  node_alerts_api["Alerts &amp; hotspots<br/>[alerts.py]"]
  node_cyber_api["Cyber &amp; breach feeds<br/>[cyberthreat.py]"]
  node_markets_api["Markets &amp; research<br/>[markets.py]"]
  node_roads_api["Roads &amp; routing<br/>[roads.py]"]
  node_misc_api["OSINT tools"]
end

subgraph group_frontend["Map &amp; interface"]
  node_app_ui["Application shell<br/>[App.jsx]"]
  node_map_view["Interactive map<br/>[MapView.jsx]"]
  node_graph_view["Actor graph view<br/>[GraphView.jsx]"]
  node_camera_player["Camera player<br/>[CamPlayers.jsx]"]
  node_chat_ui["Analyst chat panel<br/>[ChatBox.jsx]"]
  node_globe_view["Photorealistic globe<br/>[GoogleGlobe.jsx]"]
  node_other_panels["Feeds &amp; utility panels"]
end

subgraph group_analysis["Analyst &amp; research"]
  node_chat_api["AI analyst tools<br/>[chat.py]"]
  node_briefing_api["Event briefings<br/>[analysis.py]"]
  node_llm_client["LLM client<br/>[llm.py]"]
  node_cameo["CAMEO labels<br/>[cameo.py]"]
end

node_public_sources(("Public data sources"))
node_llm_service{{"Compatible LLM service"}}

node_public_sources -->|"supply feeds"| node_ingesters
node_ingesters -->|"write records"| node_database
node_database -->|"maps records"| node_data_models
node_api_app -->|"initialize schema"| node_database
node_api_app -->|"register routes"| node_event_api
node_api_app -->|"register routes"| node_graph_api
node_api_app -->|"register routes"| node_live_layers
node_api_app -->|"register routes"| node_camera_api
node_api_app -->|"register routes"| node_alerts_api
node_api_app -->|"register routes"| node_cyber_api
node_api_app -->|"register routes"| node_markets_api
node_api_app -->|"register routes"| node_roads_api
node_api_app -->|"register routes"| node_misc_api
node_event_api -->|"query events"| node_database
node_alerts_api -->|"query records"| node_database
node_app_ui -->|"renders"| node_map_view
node_app_ui -->|"renders"| node_graph_view
node_app_ui -->|"renders"| node_chat_ui
node_app_ui -->|"renders"| node_camera_player
node_app_ui -->|"loads on selection"| node_globe_view
node_app_ui -->|"renders panels"| node_other_panels
node_map_view -->|"loads map data"| node_live_layers
node_map_view -->|"loads camera data"| node_camera_api
node_graph_view -->|"loads actor network"| node_graph_api
node_camera_player -->|"plays camera feeds"| node_camera_api
node_chat_ui -->|"sends questions"| node_chat_api
node_chat_api -->|"requests completions"| node_llm_service
node_chat_api -->|"queries events"| node_event_api
node_chat_api -->|"queries alerts"| node_alerts_api
node_chat_api -->|"looks up cameras"| node_camera_api
node_chat_api -->|"queries cyber data"| node_cyber_api
node_chat_api -->|"calls analyst tools"| node_misc_api
node_briefing_api -->|"queries events"| node_database
node_briefing_api -->|"generates briefing"| node_llm_client
node_llm_client -->|"posts completions"| node_llm_service
node_event_api -->|"labels event codes"| node_cameo

click node_ingesters "https://github.com/dev-next-gen/orodruin/tree/main/backend/app/ingest"
click node_database "https://github.com/dev-next-gen/orodruin/blob/main/backend/app/db.py"
click node_data_models "https://github.com/dev-next-gen/orodruin/blob/main/backend/app/models.py"
click node_api_app "https://github.com/dev-next-gen/orodruin/blob/main/backend/app/main.py"
click node_event_api "https://github.com/dev-next-gen/orodruin/blob/main/backend/app/api/events.py"
click node_graph_api "https://github.com/dev-next-gen/orodruin/blob/main/backend/app/api/graph.py"
click node_live_layers "https://github.com/dev-next-gen/orodruin/tree/main/backend/app/api"
click node_camera_api "https://github.com/dev-next-gen/orodruin/blob/main/backend/app/api/cameras.py"
click node_alerts_api "https://github.com/dev-next-gen/orodruin/blob/main/backend/app/api/alerts.py"
click node_cyber_api "https://github.com/dev-next-gen/orodruin/blob/main/backend/app/api/cyberthreat.py"
click node_markets_api "https://github.com/dev-next-gen/orodruin/blob/main/backend/app/api/markets.py"
click node_roads_api "https://github.com/dev-next-gen/orodruin/blob/main/backend/app/api/roads.py"
click node_misc_api "https://github.com/dev-next-gen/orodruin/tree/main/backend/app/api"
click node_chat_api "https://github.com/dev-next-gen/orodruin/blob/main/backend/app/api/chat.py"
click node_briefing_api "https://github.com/dev-next-gen/orodruin/blob/main/backend/app/api/analysis.py"
click node_llm_client "https://github.com/dev-next-gen/orodruin/blob/main/backend/app/llm.py"
click node_cameo "https://github.com/dev-next-gen/orodruin/blob/main/backend/app/cameo.py"
click node_app_ui "https://github.com/dev-next-gen/orodruin/blob/main/frontend/src/App.jsx"
click node_map_view "https://github.com/dev-next-gen/orodruin/blob/main/frontend/src/MapView.jsx"
click node_graph_view "https://github.com/dev-next-gen/orodruin/blob/main/frontend/src/GraphView.jsx"
click node_camera_player "https://github.com/dev-next-gen/orodruin/blob/main/frontend/src/CamPlayers.jsx"
click node_chat_ui "https://github.com/dev-next-gen/orodruin/blob/main/frontend/src/ChatBox.jsx"
click node_globe_view "https://github.com/dev-next-gen/orodruin/blob/main/frontend/src/GoogleGlobe.jsx"
click node_other_panels "https://github.com/dev-next-gen/orodruin/tree/main/frontend/src"

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_ingesters,node_database,node_data_models toneBlue
class node_api_app,node_event_api,node_graph_api,node_live_layers,node_camera_api,node_alerts_api,node_cyber_api,node_markets_api,node_roads_api,node_misc_api toneAmber
class node_app_ui,node_map_view,node_graph_view,node_camera_player,node_chat_ui,node_globe_view,node_other_panels toneMint
class node_chat_api,node_briefing_api,node_llm_client,node_cameo toneRose
class node_public_sources,node_llm_service toneIndigo
```

## Components

### Collection & storage

- [Feed ingesters](https://github.com/dev-next-gen/orodruin/tree/main/backend/app/ingest): `backend/app/ingest`
- [PostgreSQL store](https://github.com/dev-next-gen/orodruin/blob/main/backend/app/db.py): `backend/app/db.py`
- [Intelligence records](https://github.com/dev-next-gen/orodruin/blob/main/backend/app/models.py): `backend/app/models.py`

### Backend intelligence

- [FastAPI application](https://github.com/dev-next-gen/orodruin/blob/main/backend/app/main.py): `backend/app/main.py`
- [Events & actor graph](https://github.com/dev-next-gen/orodruin/blob/main/backend/app/api/events.py): `backend/app/api/events.py`
- [Graph endpoint](https://github.com/dev-next-gen/orodruin/blob/main/backend/app/api/graph.py): `backend/app/api/graph.py`
- [Live map layers](https://github.com/dev-next-gen/orodruin/tree/main/backend/app/api): `backend/app/api`
- [Camera aggregation](https://github.com/dev-next-gen/orodruin/blob/main/backend/app/api/cameras.py): `backend/app/api/cameras.py`
- [Alerts & hotspots](https://github.com/dev-next-gen/orodruin/blob/main/backend/app/api/alerts.py): `backend/app/api/alerts.py`
- [Cyber & breach feeds](https://github.com/dev-next-gen/orodruin/blob/main/backend/app/api/cyberthreat.py): `backend/app/api/cyberthreat.py`
- [Markets & research](https://github.com/dev-next-gen/orodruin/blob/main/backend/app/api/markets.py): `backend/app/api/markets.py`
- [Roads & routing](https://github.com/dev-next-gen/orodruin/blob/main/backend/app/api/roads.py): `backend/app/api/roads.py`
- [OSINT tools](https://github.com/dev-next-gen/orodruin/tree/main/backend/app/api): `backend/app/api`

### Map & interface

- [Application shell](https://github.com/dev-next-gen/orodruin/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Interactive map](https://github.com/dev-next-gen/orodruin/blob/main/frontend/src/MapView.jsx): `frontend/src/MapView.jsx`
- [Actor graph view](https://github.com/dev-next-gen/orodruin/blob/main/frontend/src/GraphView.jsx): `frontend/src/GraphView.jsx`
- [Camera player](https://github.com/dev-next-gen/orodruin/blob/main/frontend/src/CamPlayers.jsx): `frontend/src/CamPlayers.jsx`
- [Analyst chat panel](https://github.com/dev-next-gen/orodruin/blob/main/frontend/src/ChatBox.jsx): `frontend/src/ChatBox.jsx`
- [Photorealistic globe](https://github.com/dev-next-gen/orodruin/blob/main/frontend/src/GoogleGlobe.jsx): `frontend/src/GoogleGlobe.jsx`
- [Feeds & utility panels](https://github.com/dev-next-gen/orodruin/tree/main/frontend/src): `frontend/src`

### Analyst & research

- [AI analyst tools](https://github.com/dev-next-gen/orodruin/blob/main/backend/app/api/chat.py): `backend/app/api/chat.py`
- [Event briefings](https://github.com/dev-next-gen/orodruin/blob/main/backend/app/api/analysis.py): `backend/app/api/analysis.py`
- [LLM client](https://github.com/dev-next-gen/orodruin/blob/main/backend/app/llm.py): `backend/app/llm.py`
- [CAMEO labels](https://github.com/dev-next-gen/orodruin/blob/main/backend/app/cameo.py): `backend/app/cameo.py`

### Other components

- **Public data sources**
- **Compatible LLM service**

## Connections

- Public data sources → Feed ingesters: supply feeds (evidence: `README.md`)
- Feed ingesters → PostgreSQL store: write records (evidence: `backend/app/ingest/gdelt.py`)
- PostgreSQL store → Intelligence records: maps records (evidence: `backend/app/models.py`)
- FastAPI application → PostgreSQL store: initialize schema (evidence: `backend/app/main.py`)
- FastAPI application → Events & actor graph: register routes (evidence: `backend/app/main.py`)
- FastAPI application → Graph endpoint: register routes (evidence: `backend/app/main.py`)
- FastAPI application → Live map layers: register routes (evidence: `backend/app/main.py`)
- FastAPI application → Camera aggregation: register routes (evidence: `backend/app/main.py`)
- FastAPI application → Alerts & hotspots: register routes (evidence: `backend/app/main.py`)
- FastAPI application → Cyber & breach feeds: register routes (evidence: `backend/app/main.py`)
- FastAPI application → Markets & research: register routes (evidence: `backend/app/main.py`)
- FastAPI application → Roads & routing: register routes (evidence: `backend/app/main.py`)
- FastAPI application → OSINT tools: register routes (evidence: `backend/app/main.py`)
- Events & actor graph → PostgreSQL store: query events (evidence: `backend/app/api/events.py`)
- Alerts & hotspots → PostgreSQL store: query records (evidence: `backend/app/api/alerts.py`)
- Application shell → Interactive map: renders (evidence: `frontend/src/App.jsx`)
- Application shell → Actor graph view: renders (evidence: `frontend/src/App.jsx`)
- Application shell → Analyst chat panel: renders (evidence: `frontend/src/App.jsx`)
- Application shell → Camera player: renders (evidence: `frontend/src/App.jsx`)
- Application shell → Photorealistic globe: loads on selection (evidence: `frontend/src/App.jsx`)
- Application shell → Feeds & utility panels: renders panels (evidence: `frontend/src/App.jsx`)
- Interactive map → Live map layers: loads map data (evidence: `README.md`)
- Interactive map → Camera aggregation: loads camera data (evidence: `README.md`)
- Actor graph view → Graph endpoint: loads actor network (evidence: `README.md`)
- Camera player → Camera aggregation: plays camera feeds (evidence: `README.md`)
- Analyst chat panel → AI analyst tools: sends questions (evidence: `README.md`)
- AI analyst tools → Compatible LLM service: requests completions (evidence: `backend/app/api/chat.py`)
- AI analyst tools → Events & actor graph: queries events (evidence: `backend/app/api/chat.py`)
- AI analyst tools → Alerts & hotspots: queries alerts (evidence: `backend/app/api/chat.py`)
- AI analyst tools → Camera aggregation: looks up cameras (evidence: `backend/app/api/chat.py`)
- AI analyst tools → Cyber & breach feeds: queries cyber data (evidence: `backend/app/api/chat.py`)
- AI analyst tools → OSINT tools: calls analyst tools (evidence: `backend/app/api/chat.py`)
- Event briefings → PostgreSQL store: queries events (evidence: `backend/app/api/analysis.py`)
- Event briefings → LLM client: generates briefing (evidence: `backend/app/api/analysis.py`)
- LLM client → Compatible LLM service: posts completions (evidence: `backend/app/llm.py`)
- Events & actor graph → CAMEO labels: labels event codes (evidence: `backend/app/api/events.py`)
