# thwibi/triagelens architecture

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

- Interactive diagram: https://gitdiagram.com/thwibi/triagelens
- Repository: https://github.com/thwibi/triagelens

## Overview

TriageLens is a local security-log triage workbench: analysts create cases, import and normalize evidence, run detections, investigate alerts and related data, then generate reports or exports. The graph preserves the README’s major capabilities and adds the job, detection, report, API-client, and configuration layers visible in sampled source. Many backend routers and feature screens were not sampled, so their documented relationships cite the README; other unsampled implementation links are omitted.

Main entry points: [`backend/app/main.py`](https://github.com/thwibi/triagelens/blob/main/backend/app/main.py) (FastAPI Application), [`frontend/src/App.tsx`](https://github.com/thwibi/triagelens/blob/main/frontend/src/App.tsx) (Screen Router), [`backend/app/jobs/manager.py`](https://github.com/thwibi/triagelens/blob/main/backend/app/jobs/manager.py) (Job Manager), [`backend/app/db/connection.py`](https://github.com/thwibi/triagelens/blob/main/backend/app/db/connection.py) (SQLite Database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Analyst Workbench"]
  node_webapp["Screen Router<br/>[App.tsx]"]
  node_api_client["API Client<br/>[client.ts]"]
  node_api_endpoints["API Endpoints<br/>[endpoints.ts]"]
  node_api_hooks["Query Hooks<br/>[hooks.ts]"]
  node_case_sources["Cases &amp; Sources<br/>[SourcesPage.tsx]"]
  node_alerts_ui["Alert Review<br/>[AlertsPage.tsx]"]
  node_events_ui["Event Browser<br/>[EventsPage.tsx]"]
  node_investigation_ui["Investigation Screens"]
  node_report_ui["Reports Screen<br/>[ReportsPage.tsx]"]
end

subgraph group_ingest["Evidence Intake"]
  node_intake["Import &amp; Intake<br/>[intake.py]"]
  node_archive["Archive Handling<br/>[archive.py]"]
  node_parsers["Log Parsers"]
  node_normalizer["Event Normalization<br/>[normalize.py]"]
end

subgraph group_analysis["Detection &amp; Investigation"]
  node_detect_engine["Detection Engine<br/>[engine.py]"]
  node_ioc_extract["IOC Extraction<br/>[extract.py]"]
  node_mitre["ATT&amp;CK Context"]
end

subgraph group_runtime["Application Runtime"]
  node_job_manager["Job Manager<br/>[manager.py]"]
  node_ingest_tasks["Ingest Tasks<br/>[tasks.py]"]
  node_api_server["FastAPI Application<br/>[main.py]"]
  node_job_progress["Job Progress<br/>[progress.py]"]
  node_configuration["Validated Settings<br/>[config.py]"]
  node_core_utilities["Hashing &amp; Utilities"]
end

subgraph group_data["Persistence &amp; Output"]
  node_sqlite[("SQLite Database<br/>[connection.py]")]
  node_repositories["Data Repositories"]
  node_report_service["Report Service<br/>[service.py]"]
end

node_analyst(("Analyst"))

node_analyst -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_alerts_ui
node_webapp -->|"routes to"| node_events_ui
node_webapp -->|"routes to"| node_case_sources
node_webapp -->|"routes to"| node_investigation_ui
node_webapp -->|"routes to"| node_report_ui
node_alerts_ui -->|"queries"| node_api_hooks
node_events_ui -->|"queries"| node_api_hooks
node_api_hooks -->|"calls"| node_api_endpoints
node_api_endpoints -->|"requests through"| node_api_client
node_api_client -->|"HTTP requests"| node_api_server
node_api_server -->|"accepts imports"| node_intake
node_intake -->|"expands archives"| node_archive
node_intake -->|"queues work"| node_job_manager
node_job_manager -->|"dispatches"| node_ingest_tasks
node_ingest_tasks -->|"parses evidence"| node_parsers
node_parsers -->|"normalizes events"| node_normalizer
node_ingest_tasks -->|"stores events"| node_sqlite
node_api_server -->|"runs detection"| node_detect_engine
node_detect_engine -->|"queries events"| node_sqlite
node_api_server -->|"supports IOC review"| node_ioc_extract
node_api_server -->|"provides ATT&amp;CK context"| node_mitre
node_api_server -->|"serves API data"| node_repositories
node_repositories -->|"reads and writes"| node_sqlite
node_api_server -->|"manages jobs"| node_job_manager
node_job_manager -->|"publishes progress"| node_job_progress
node_api_server -->|"loads settings"| node_configuration
node_api_server -->|"generates reports"| node_report_service
node_report_service -->|"records reports"| node_repositories
node_report_service -->|"hashes output"| node_core_utilities
node_report_ui -->|"requests reports"| node_api_endpoints
node_api_server -->|"uses local store"| node_sqlite
node_api_server -->|"audit hashing"| node_core_utilities

click node_webapp "https://github.com/thwibi/triagelens/blob/main/frontend/src/App.tsx"
click node_api_client "https://github.com/thwibi/triagelens/blob/main/frontend/src/api/client.ts"
click node_api_endpoints "https://github.com/thwibi/triagelens/blob/main/frontend/src/api/endpoints.ts"
click node_api_hooks "https://github.com/thwibi/triagelens/blob/main/frontend/src/api/hooks.ts"
click node_case_sources "https://github.com/thwibi/triagelens/blob/main/frontend/src/features/sources/SourcesPage.tsx"
click node_alerts_ui "https://github.com/thwibi/triagelens/blob/main/frontend/src/features/alerts/AlertsPage.tsx"
click node_events_ui "https://github.com/thwibi/triagelens/blob/main/frontend/src/features/events/EventsPage.tsx"
click node_investigation_ui "https://github.com/thwibi/triagelens/tree/main/frontend/src/features"
click node_report_ui "https://github.com/thwibi/triagelens/blob/main/frontend/src/features/reports/ReportsPage.tsx"
click node_intake "https://github.com/thwibi/triagelens/blob/main/backend/app/ingest/intake.py"
click node_archive "https://github.com/thwibi/triagelens/blob/main/backend/app/ingest/archive.py"
click node_parsers "https://github.com/thwibi/triagelens/tree/main/backend/app/ingest/parsers"
click node_normalizer "https://github.com/thwibi/triagelens/blob/main/backend/app/ingest/normalize.py"
click node_job_manager "https://github.com/thwibi/triagelens/blob/main/backend/app/jobs/manager.py"
click node_ingest_tasks "https://github.com/thwibi/triagelens/blob/main/backend/app/jobs/tasks.py"
click node_detect_engine "https://github.com/thwibi/triagelens/blob/main/backend/app/detect/engine.py"
click node_ioc_extract "https://github.com/thwibi/triagelens/blob/main/backend/app/ioc/extract.py"
click node_mitre "https://github.com/thwibi/triagelens/tree/main/backend/app/mitre"
click node_api_server "https://github.com/thwibi/triagelens/blob/main/backend/app/main.py"
click node_sqlite "https://github.com/thwibi/triagelens/blob/main/backend/app/db/connection.py"
click node_repositories "https://github.com/thwibi/triagelens/tree/main/backend/app/db/repositories"
click node_report_service "https://github.com/thwibi/triagelens/blob/main/backend/app/reports/service.py"
click node_job_progress "https://github.com/thwibi/triagelens/blob/main/backend/app/jobs/progress.py"
click node_configuration "https://github.com/thwibi/triagelens/blob/main/backend/app/config.py"
click node_core_utilities "https://github.com/thwibi/triagelens/tree/main/backend/app/util"

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_webapp,node_api_client,node_api_endpoints,node_api_hooks,node_case_sources,node_alerts_ui,node_events_ui,node_investigation_ui,node_report_ui toneBlue
class node_intake,node_archive,node_parsers,node_normalizer toneAmber
class node_detect_engine,node_ioc_extract,node_mitre toneMint
class node_job_manager,node_ingest_tasks,node_api_server,node_job_progress,node_configuration,node_core_utilities toneRose
class node_sqlite,node_repositories,node_report_service,node_analyst toneIndigo
```

## Components

### Analyst Workbench

- [Screen Router](https://github.com/thwibi/triagelens/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API Client](https://github.com/thwibi/triagelens/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [API Endpoints](https://github.com/thwibi/triagelens/blob/main/frontend/src/api/endpoints.ts): `frontend/src/api/endpoints.ts`
- [Query Hooks](https://github.com/thwibi/triagelens/blob/main/frontend/src/api/hooks.ts): `frontend/src/api/hooks.ts`
- [Cases & Sources](https://github.com/thwibi/triagelens/blob/main/frontend/src/features/sources/SourcesPage.tsx): `frontend/src/features/sources/SourcesPage.tsx`
- [Alert Review](https://github.com/thwibi/triagelens/blob/main/frontend/src/features/alerts/AlertsPage.tsx): `frontend/src/features/alerts/AlertsPage.tsx`
- [Event Browser](https://github.com/thwibi/triagelens/blob/main/frontend/src/features/events/EventsPage.tsx): `frontend/src/features/events/EventsPage.tsx`
- [Investigation Screens](https://github.com/thwibi/triagelens/tree/main/frontend/src/features): `frontend/src/features`
- [Reports Screen](https://github.com/thwibi/triagelens/blob/main/frontend/src/features/reports/ReportsPage.tsx): `frontend/src/features/reports/ReportsPage.tsx`

### Evidence Intake

- [Import & Intake](https://github.com/thwibi/triagelens/blob/main/backend/app/ingest/intake.py): `backend/app/ingest/intake.py`
- [Archive Handling](https://github.com/thwibi/triagelens/blob/main/backend/app/ingest/archive.py): `backend/app/ingest/archive.py`
- [Log Parsers](https://github.com/thwibi/triagelens/tree/main/backend/app/ingest/parsers): `backend/app/ingest/parsers`
- [Event Normalization](https://github.com/thwibi/triagelens/blob/main/backend/app/ingest/normalize.py): `backend/app/ingest/normalize.py`

### Detection & Investigation

- [Detection Engine](https://github.com/thwibi/triagelens/blob/main/backend/app/detect/engine.py): `backend/app/detect/engine.py`
- [IOC Extraction](https://github.com/thwibi/triagelens/blob/main/backend/app/ioc/extract.py): `backend/app/ioc/extract.py`
- [ATT&CK Context](https://github.com/thwibi/triagelens/tree/main/backend/app/mitre): `backend/app/mitre`

### Application Runtime

- [Job Manager](https://github.com/thwibi/triagelens/blob/main/backend/app/jobs/manager.py): `backend/app/jobs/manager.py`
- [Ingest Tasks](https://github.com/thwibi/triagelens/blob/main/backend/app/jobs/tasks.py): `backend/app/jobs/tasks.py`
- [FastAPI Application](https://github.com/thwibi/triagelens/blob/main/backend/app/main.py): `backend/app/main.py`
- [Job Progress](https://github.com/thwibi/triagelens/blob/main/backend/app/jobs/progress.py): `backend/app/jobs/progress.py`
- [Validated Settings](https://github.com/thwibi/triagelens/blob/main/backend/app/config.py): `backend/app/config.py`
- [Hashing & Utilities](https://github.com/thwibi/triagelens/tree/main/backend/app/util): `backend/app/util`

### Persistence & Output

- [SQLite Database](https://github.com/thwibi/triagelens/blob/main/backend/app/db/connection.py): `backend/app/db/connection.py`
- [Data Repositories](https://github.com/thwibi/triagelens/tree/main/backend/app/db/repositories): `backend/app/db/repositories`
- [Report Service](https://github.com/thwibi/triagelens/blob/main/backend/app/reports/service.py): `backend/app/reports/service.py`

### Other components

- **Analyst**

## Connections

- Analyst → Screen Router: uses (evidence: `README.md`)
- Screen Router → Alert Review: routes to (evidence: `frontend/src/App.tsx`)
- Screen Router → Event Browser: routes to (evidence: `frontend/src/App.tsx`)
- Screen Router → Cases & Sources: routes to (evidence: `frontend/src/App.tsx`)
- Screen Router → Investigation Screens: routes to (evidence: `frontend/src/App.tsx`)
- Screen Router → Reports Screen: routes to (evidence: `frontend/src/App.tsx`)
- Alert Review → Query Hooks: queries (evidence: `frontend/src/features/alerts/AlertsPage.tsx`)
- Event Browser → Query Hooks: queries (evidence: `frontend/src/features/events/EventsPage.tsx`)
- Query Hooks → API Endpoints: calls (evidence: `frontend/src/api/hooks.ts`)
- API Endpoints → API Client: requests through (evidence: `frontend/src/api/endpoints.ts`)
- API Client → FastAPI Application: HTTP requests (evidence: `README.md`)
- FastAPI Application → Import & Intake: accepts imports (evidence: `README.md`)
- Import & Intake → Archive Handling: expands archives (evidence: `README.md`)
- Import & Intake → Job Manager: queues work (evidence: `README.md`)
- Job Manager → Ingest Tasks: dispatches (evidence: `backend/app/jobs/manager.py`)
- Ingest Tasks → Log Parsers: parses evidence (evidence: `README.md`)
- Log Parsers → Event Normalization: normalizes events (evidence: `README.md`)
- Ingest Tasks → SQLite Database: stores events (evidence: `README.md`)
- FastAPI Application → Detection Engine: runs detection (evidence: `README.md`)
- Detection Engine → SQLite Database: queries events (evidence: `backend/app/detect/engine.py`)
- FastAPI Application → IOC Extraction: supports IOC review (evidence: `README.md`)
- FastAPI Application → ATT&CK Context: provides ATT&CK context (evidence: `README.md`)
- FastAPI Application → Data Repositories: serves API data (evidence: `README.md`)
- Data Repositories → SQLite Database: reads and writes (evidence: `README.md`)
- FastAPI Application → Job Manager: manages jobs (evidence: `backend/app/main.py`)
- Job Manager → Job Progress: publishes progress (evidence: `backend/app/jobs/manager.py`)
- FastAPI Application → Validated Settings: loads settings (evidence: `backend/app/main.py`)
- FastAPI Application → Report Service: generates reports (evidence: `README.md`)
- Report Service → Data Repositories: records reports (evidence: `backend/app/reports/service.py`)
- Report Service → Hashing & Utilities: hashes output (evidence: `backend/app/reports/service.py`)
- Reports Screen → API Endpoints: requests reports (evidence: `README.md`)
- FastAPI Application → SQLite Database: uses local store (evidence: `README.md`)
- FastAPI Application → Hashing & Utilities: audit hashing (evidence: `README.md`)
