# auvalabs/threatwatch architecture

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

- Interactive diagram: https://gitdiagram.com/auvalabs/threatwatch
- Repository: https://github.com/auvalabs/threatwatch

## Overview

ThreatWatch collects public cyber reporting, turns it into classified and correlated intelligence, and presents evidence-backed operational decisions through a dashboard and integrations. The principal workflow runs from feed and threat-data collection through deduplication, enrichment, and analysis into briefings, a threat ledger, and evidence-gated hunts. The dashboard exposes these products via a JSON API. Several internal relationships are documented or indexed, but unsampled implementations are not assumed to call one another; the graph omits uncertain links.

Main entry points: [`threatdigest_main.py`](https://github.com/auvalabs/threatwatch/blob/main/threatdigest_main.py) (Pipeline runner), [`serve_threatwatch.py`](https://github.com/auvalabs/threatwatch/blob/main/serve_threatwatch.py) (HTTP API server), [`modules/hunt_engine.py`](https://github.com/auvalabs/threatwatch/blob/main/modules/hunt_engine.py) (Evidence-gated hunts), [`modules/feed_fetcher.py`](https://github.com/auvalabs/threatwatch/blob/main/modules/feed_fetcher.py) (Feed collection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Collection and processing"]
  node_pipeline["Pipeline runner"]
  node_feeds["Feed collection<br/>[feed_fetcher.py]"]
  node_threatdata["Threat data feeds<br/>[darkweb_monitor.py]"]
  node_dedup["Article deduplication<br/>[deduplicator.py]"]
  node_classification["Classification and regions"]
  node_config["Runtime configuration<br/>[config.py]"]
  node_dedupstate[("Deduplication index<br/>[deduplicator.py]")]
end

subgraph group_intelligence["Intelligence analysis"]
  node_briefings["Briefings and stories"]
  node_ai["AI enrichment<br/>[ai_enrichment.py]"]
  node_llm["Provider failover<br/>[llm_client.py]"]
  node_kev["KEV enrichment<br/>[kev_enricher.py]"]
  node_trends["Trend detection<br/>[trend_detector.py]"]
end

subgraph group_operations["Operations workspace"]
  node_ledger[("Threat ledger<br/>[threat_ledger.py]")]
  node_hunts["Evidence-gated hunts<br/>[hunt_engine.py]"]
  node_iocquality["Observable validation<br/>[ioc_quality.py]"]
  node_watchlist["Watchlist monitoring"]
end

subgraph group_delivery["API and delivery"]
  node_server["HTTP API server"]
  node_stix["STIX export<br/>[stix_output.py]"]
  node_webhooks["Alert dispatch<br/>[webhook.py]"]
end

subgraph group_frontend["Dashboard"]
  node_router["Route selection<br/>[router.ts]"]
  node_app["Dashboard app<br/>[App.tsx]"]
  node_resource["Resource loading<br/>[useResource.ts]"]
  node_api["API client<br/>[api.ts]"]
  node_views["Workspace views"]
end

node_analyst(("Analyst"))

node_analyst -.->|"initiates"| node_pipeline
node_pipeline -->|"fetches reports"| node_feeds
node_pipeline -->|"collects threat data"| node_threatdata
node_pipeline -->|"deduplicates"| node_dedup
node_pipeline -.->|"classifies articles"| node_classification
node_feeds -.->|"supplies articles"| node_dedup
node_pipeline -.->|"generates intelligence"| node_briefings
node_briefings -->|"requests generation"| node_llm
node_ai -.->|"requests enrichment"| node_llm
node_pipeline -.->|"enriches vulnerabilities"| node_kev
node_pipeline -.->|"detects trends"| node_trends
node_pipeline -.->|"builds ledger"| node_ledger
node_pipeline -.->|"builds hunt packages"| node_hunts
node_hunts -->|"validates observables"| node_iocquality
node_pipeline -->|"monitors watchlists"| node_watchlist
node_watchlist -->|"checks duplicates"| node_dedupstate
node_server -->|"loads records"| node_ledger
node_server -->|"loads hunts"| node_hunts
node_server -->|"serves trend data"| node_trends
node_server -->|"exports bundles"| node_stix
node_server -.->|"dispatches alerts"| node_webhooks
node_analyst -->|"selects workspace"| node_router
node_router -->|"provides route"| node_app
node_app -->|"renders view"| node_views
node_views -->|"loads resources"| node_resource
node_resource -->|"invokes loader"| node_api
node_api -->|"requests JSON"| node_server

click node_pipeline "https://github.com/auvalabs/threatwatch/blob/main/threatdigest_main.py"
click node_feeds "https://github.com/auvalabs/threatwatch/blob/main/modules/feed_fetcher.py"
click node_threatdata "https://github.com/auvalabs/threatwatch/blob/main/modules/darkweb_monitor.py"
click node_dedup "https://github.com/auvalabs/threatwatch/blob/main/modules/deduplicator.py"
click node_classification "https://github.com/auvalabs/threatwatch/blob/main/modules/hybrid_classifier.py"
click node_config "https://github.com/auvalabs/threatwatch/blob/main/modules/config.py"
click node_briefings "https://github.com/auvalabs/threatwatch/blob/main/modules/briefing_generator.py"
click node_ai "https://github.com/auvalabs/threatwatch/blob/main/modules/ai_enrichment.py"
click node_llm "https://github.com/auvalabs/threatwatch/blob/main/modules/llm_client.py"
click node_kev "https://github.com/auvalabs/threatwatch/blob/main/modules/kev_enricher.py"
click node_trends "https://github.com/auvalabs/threatwatch/blob/main/modules/trend_detector.py"
click node_ledger "https://github.com/auvalabs/threatwatch/blob/main/modules/threat_ledger.py"
click node_hunts "https://github.com/auvalabs/threatwatch/blob/main/modules/hunt_engine.py"
click node_iocquality "https://github.com/auvalabs/threatwatch/blob/main/modules/ioc_quality.py"
click node_watchlist "https://github.com/auvalabs/threatwatch/blob/main/modules/watchlist_monitor.py"
click node_dedupstate "https://github.com/auvalabs/threatwatch/blob/main/modules/deduplicator.py"
click node_server "https://github.com/auvalabs/threatwatch/blob/main/serve_threatwatch.py"
click node_stix "https://github.com/auvalabs/threatwatch/blob/main/modules/stix_output.py"
click node_webhooks "https://github.com/auvalabs/threatwatch/blob/main/modules/webhook.py"
click node_router "https://github.com/auvalabs/threatwatch/blob/main/frontend/src/router.ts"
click node_app "https://github.com/auvalabs/threatwatch/blob/main/frontend/src/App.tsx"
click node_resource "https://github.com/auvalabs/threatwatch/blob/main/frontend/src/hooks/useResource.ts"
click node_api "https://github.com/auvalabs/threatwatch/blob/main/frontend/src/services/api.ts"
click node_views "https://github.com/auvalabs/threatwatch/tree/main/frontend/src/views"

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_pipeline,node_feeds,node_threatdata,node_dedup,node_classification,node_config,node_dedupstate toneBlue
class node_briefings,node_ai,node_llm,node_kev,node_trends toneAmber
class node_ledger,node_hunts,node_iocquality,node_watchlist toneMint
class node_server,node_stix,node_webhooks toneRose
class node_router,node_app,node_resource,node_api,node_views,node_analyst toneIndigo
```

## Components

### Collection and processing

- [Pipeline runner](https://github.com/auvalabs/threatwatch/blob/main/threatdigest_main.py): `threatdigest_main.py`
- [Feed collection](https://github.com/auvalabs/threatwatch/blob/main/modules/feed_fetcher.py): `modules/feed_fetcher.py`
- [Threat data feeds](https://github.com/auvalabs/threatwatch/blob/main/modules/darkweb_monitor.py): `modules/darkweb_monitor.py`
- [Article deduplication](https://github.com/auvalabs/threatwatch/blob/main/modules/deduplicator.py): `modules/deduplicator.py`
- [Classification and regions](https://github.com/auvalabs/threatwatch/blob/main/modules/hybrid_classifier.py): `modules/hybrid_classifier.py`
- [Runtime configuration](https://github.com/auvalabs/threatwatch/blob/main/modules/config.py): `modules/config.py`
- [Deduplication index](https://github.com/auvalabs/threatwatch/blob/main/modules/deduplicator.py): `modules/deduplicator.py`

### Intelligence analysis

- [Briefings and stories](https://github.com/auvalabs/threatwatch/blob/main/modules/briefing_generator.py): `modules/briefing_generator.py`
- [AI enrichment](https://github.com/auvalabs/threatwatch/blob/main/modules/ai_enrichment.py): `modules/ai_enrichment.py`
- [Provider failover](https://github.com/auvalabs/threatwatch/blob/main/modules/llm_client.py): `modules/llm_client.py`
- [KEV enrichment](https://github.com/auvalabs/threatwatch/blob/main/modules/kev_enricher.py): `modules/kev_enricher.py`
- [Trend detection](https://github.com/auvalabs/threatwatch/blob/main/modules/trend_detector.py): `modules/trend_detector.py`

### Operations workspace

- [Threat ledger](https://github.com/auvalabs/threatwatch/blob/main/modules/threat_ledger.py): `modules/threat_ledger.py`
- [Evidence-gated hunts](https://github.com/auvalabs/threatwatch/blob/main/modules/hunt_engine.py): `modules/hunt_engine.py`
- [Observable validation](https://github.com/auvalabs/threatwatch/blob/main/modules/ioc_quality.py): `modules/ioc_quality.py`
- [Watchlist monitoring](https://github.com/auvalabs/threatwatch/blob/main/modules/watchlist_monitor.py): `modules/watchlist_monitor.py`

### API and delivery

- [HTTP API server](https://github.com/auvalabs/threatwatch/blob/main/serve_threatwatch.py): `serve_threatwatch.py`
- [STIX export](https://github.com/auvalabs/threatwatch/blob/main/modules/stix_output.py): `modules/stix_output.py`
- [Alert dispatch](https://github.com/auvalabs/threatwatch/blob/main/modules/webhook.py): `modules/webhook.py`

### Dashboard

- [Route selection](https://github.com/auvalabs/threatwatch/blob/main/frontend/src/router.ts): `frontend/src/router.ts`
- [Dashboard app](https://github.com/auvalabs/threatwatch/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Resource loading](https://github.com/auvalabs/threatwatch/blob/main/frontend/src/hooks/useResource.ts): `frontend/src/hooks/useResource.ts`
- [API client](https://github.com/auvalabs/threatwatch/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- [Workspace views](https://github.com/auvalabs/threatwatch/tree/main/frontend/src/views): `frontend/src/views`

### Other components

- **Analyst**

## Connections

- Analyst → Pipeline runner: initiates
- Pipeline runner → Feed collection: fetches reports (evidence: `threatdigest_main.py`)
- Pipeline runner → Threat data feeds: collects threat data (evidence: `threatdigest_main.py`)
- Pipeline runner → Article deduplication: deduplicates (evidence: `threatdigest_main.py`)
- Pipeline runner → Classification and regions: classifies articles (evidence: `threatdigest_main.py`)
- Feed collection → Article deduplication: supplies articles
- Pipeline runner → Briefings and stories: generates intelligence
- Briefings and stories → Provider failover: requests generation (evidence: `modules/briefing_generator.py`)
- AI enrichment → Provider failover: requests enrichment
- Pipeline runner → KEV enrichment: enriches vulnerabilities (evidence: `threatdigest_main.py`)
- Pipeline runner → Trend detection: detects trends (evidence: `threatdigest_main.py`)
- Pipeline runner → Threat ledger: builds ledger (evidence: `threatdigest_main.py`)
- Pipeline runner → Evidence-gated hunts: builds hunt packages (evidence: `threatdigest_main.py`)
- Evidence-gated hunts → Observable validation: validates observables (evidence: `modules/hunt_engine.py`)
- Pipeline runner → Watchlist monitoring: monitors watchlists (evidence: `threatdigest_main.py`)
- Watchlist monitoring → Deduplication index: checks duplicates (evidence: `modules/watchlist_monitor.py`)
- HTTP API server → Threat ledger: loads records (evidence: `serve_threatwatch.py`)
- HTTP API server → Evidence-gated hunts: loads hunts (evidence: `serve_threatwatch.py`)
- HTTP API server → Trend detection: serves trend data (evidence: `serve_threatwatch.py`)
- HTTP API server → STIX export: exports bundles (evidence: `serve_threatwatch.py`)
- HTTP API server → Alert dispatch: dispatches alerts
- Analyst → Route selection: selects workspace (evidence: `frontend/src/router.ts`)
- Route selection → Dashboard app: provides route (evidence: `frontend/src/App.tsx`)
- Dashboard app → Workspace views: renders view (evidence: `frontend/src/App.tsx`)
- Workspace views → Resource loading: loads resources (evidence: `frontend/src/views/ExposureView.tsx`)
- Resource loading → API client: invokes loader (evidence: `frontend/src/views/ExposureView.tsx`)
- API client → HTTP API server: requests JSON (evidence: `frontend/src/services/api.ts`)
