# letox4/osinthunter architecture

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

- Interactive diagram: https://gitdiagram.com/letox4/osinthunter
- Repository: https://github.com/letox4/osinthunter

## Overview

OsintHunter is a local desktop OSINT investigation platform: an investigator enters a clue in the browser UI, starts a case investigation, and receives linked entities and findings for an investigation graph, confidence analysis, map, timeline, and report. Collection spans username, email, phone, person, domain, IP, Chile-specific, and miscellaneous sources; optional deep scans and AI analysis extend the workflow. SQLite persists cases and graph data, while configuration manages settings and API keys. Several UI and route details are unsampled, so those connections are limited to documented behavior.

Main entry points: [`app/engine.py`](https://github.com/letox4/osinthunter/blob/main/app/engine.py) (Scan engine), [`app/main.py`](https://github.com/letox4/osinthunter/blob/main/app/main.py) (FastAPI service), [`app/db.py`](https://github.com/letox4/osinthunter/blob/main/app/db.py) (Case graph store), [`app/analysis.py`](https://github.com/letox4/osinthunter/blob/main/app/analysis.py) (Identity analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Investigation UI"]
  node_web_ui["Browser UI<br/>[app.js]"]
  node_api["FastAPI service<br/>[main.py]"]
end

subgraph group_runtime["Scan runtime"]
  node_engine["Scan engine<br/>[engine.py]"]
  node_module_contract["Module registry<br/>[base.py]"]
end

subgraph group_sources["OSINT sources"]
  node_username["Username scans<br/>[username.py]"]
  node_email["Email scans<br/>[email.py]"]
  node_phone["Phone scans<br/>[phone.py]"]
  node_people["Person sources<br/>[people.py]"]
  node_websearch["Web search<br/>[websearch.py]"]
  node_domain["Domain scans<br/>[domain.py]"]
  node_ip["IP scans<br/>[ip.py]"]
  node_chile["Chile sources<br/>[chile.py]"]
  node_chile_data["Chile datasets<br/>[chile_data.py]"]
  node_misc["Other sources<br/>[misc.py]"]
  node_documents["Document metadata<br/>[documents.py]"]
  node_deep["Deep scans<br/>[deep.py]"]
  node_enrich["Auto enrichment<br/>[enrich.py]"]
end

subgraph group_insights["Case analysis"]
  node_analysis["Identity analysis<br/>[analysis.py]"]
  node_exif["EXIF extraction<br/>[exif.py]"]
end

subgraph group_state["Local state"]
  node_models["Entity modeling<br/>[models.py]"]
  node_database[("Case graph store<br/>[db.py]")]
  node_config["Settings and keys<br/>[config.py]"]
end

node_investigator(("Investigator"))

node_investigator -->|"uses"| node_web_ui
node_web_ui -.->|"requests"| node_api
node_api -.->|"starts scans"| node_engine
node_api -->|"manages cases"| node_database
node_api -->|"validates entities"| node_models
node_api -->|"uses"| node_exif
node_engine -->|"writes findings"| node_database
node_engine -->|"runs analysis"| node_analysis
node_engine -.->|"loads registry"| node_module_contract
node_engine -.->|"dispatches"| node_username
node_engine -.->|"dispatches"| node_email
node_engine -.->|"dispatches"| node_phone
node_engine -.->|"dispatches"| node_people
node_engine -.->|"dispatches"| node_websearch
node_engine -.->|"dispatches"| node_domain
node_engine -.->|"dispatches"| node_ip
node_engine -.->|"dispatches"| node_chile
node_engine -.->|"dispatches"| node_chile_data
node_engine -.->|"dispatches"| node_misc
node_engine -.->|"dispatches"| node_documents
node_engine -.->|"dispatches"| node_deep
node_engine -.->|"dispatches"| node_enrich
node_analysis -->|"reads graph"| node_database
node_analysis -->|"uses settings"| node_config
node_database -->|"uses entity types"| node_models
node_database -->|"reads data path"| node_config

click node_web_ui "https://github.com/letox4/osinthunter/blob/main/web/app.js"
click node_api "https://github.com/letox4/osinthunter/blob/main/app/main.py"
click node_engine "https://github.com/letox4/osinthunter/blob/main/app/engine.py"
click node_module_contract "https://github.com/letox4/osinthunter/blob/main/app/modules/base.py"
click node_username "https://github.com/letox4/osinthunter/blob/main/app/modules/username.py"
click node_email "https://github.com/letox4/osinthunter/blob/main/app/modules/email.py"
click node_phone "https://github.com/letox4/osinthunter/blob/main/app/modules/phone.py"
click node_people "https://github.com/letox4/osinthunter/blob/main/app/modules/people.py"
click node_websearch "https://github.com/letox4/osinthunter/blob/main/app/modules/websearch.py"
click node_domain "https://github.com/letox4/osinthunter/blob/main/app/modules/domain.py"
click node_ip "https://github.com/letox4/osinthunter/blob/main/app/modules/ip.py"
click node_chile "https://github.com/letox4/osinthunter/blob/main/app/modules/chile.py"
click node_chile_data "https://github.com/letox4/osinthunter/blob/main/app/modules/chile_data.py"
click node_misc "https://github.com/letox4/osinthunter/blob/main/app/modules/misc.py"
click node_documents "https://github.com/letox4/osinthunter/blob/main/app/modules/documents.py"
click node_deep "https://github.com/letox4/osinthunter/blob/main/app/modules/deep.py"
click node_enrich "https://github.com/letox4/osinthunter/blob/main/app/modules/enrich.py"
click node_analysis "https://github.com/letox4/osinthunter/blob/main/app/analysis.py"
click node_exif "https://github.com/letox4/osinthunter/blob/main/app/exif.py"
click node_models "https://github.com/letox4/osinthunter/blob/main/app/models.py"
click node_database "https://github.com/letox4/osinthunter/blob/main/app/db.py"
click node_config "https://github.com/letox4/osinthunter/blob/main/app/config.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_web_ui,node_api toneBlue
class node_engine,node_module_contract toneAmber
class node_username,node_email,node_phone,node_people,node_websearch,node_domain,node_ip,node_chile,node_chile_data,node_misc,node_documents,node_deep,node_enrich toneMint
class node_analysis,node_exif toneRose
class node_models,node_database,node_config,node_investigator toneIndigo
```

## Components

### Investigation UI

- [Browser UI](https://github.com/letox4/osinthunter/blob/main/web/app.js): `web/app.js`
- [FastAPI service](https://github.com/letox4/osinthunter/blob/main/app/main.py): `app/main.py`

### Scan runtime

- [Scan engine](https://github.com/letox4/osinthunter/blob/main/app/engine.py): `app/engine.py`
- [Module registry](https://github.com/letox4/osinthunter/blob/main/app/modules/base.py): `app/modules/base.py`

### OSINT sources

- [Username scans](https://github.com/letox4/osinthunter/blob/main/app/modules/username.py): `app/modules/username.py`
- [Email scans](https://github.com/letox4/osinthunter/blob/main/app/modules/email.py): `app/modules/email.py`
- [Phone scans](https://github.com/letox4/osinthunter/blob/main/app/modules/phone.py): `app/modules/phone.py`
- [Person sources](https://github.com/letox4/osinthunter/blob/main/app/modules/people.py): `app/modules/people.py`
- [Web search](https://github.com/letox4/osinthunter/blob/main/app/modules/websearch.py): `app/modules/websearch.py`
- [Domain scans](https://github.com/letox4/osinthunter/blob/main/app/modules/domain.py): `app/modules/domain.py`
- [IP scans](https://github.com/letox4/osinthunter/blob/main/app/modules/ip.py): `app/modules/ip.py`
- [Chile sources](https://github.com/letox4/osinthunter/blob/main/app/modules/chile.py): `app/modules/chile.py`
- [Chile datasets](https://github.com/letox4/osinthunter/blob/main/app/modules/chile_data.py): `app/modules/chile_data.py`
- [Other sources](https://github.com/letox4/osinthunter/blob/main/app/modules/misc.py): `app/modules/misc.py`
- [Document metadata](https://github.com/letox4/osinthunter/blob/main/app/modules/documents.py): `app/modules/documents.py`
- [Deep scans](https://github.com/letox4/osinthunter/blob/main/app/modules/deep.py): `app/modules/deep.py`
- [Auto enrichment](https://github.com/letox4/osinthunter/blob/main/app/modules/enrich.py): `app/modules/enrich.py`

### Case analysis

- [Identity analysis](https://github.com/letox4/osinthunter/blob/main/app/analysis.py): `app/analysis.py`
- [EXIF extraction](https://github.com/letox4/osinthunter/blob/main/app/exif.py): `app/exif.py`

### Local state

- [Entity modeling](https://github.com/letox4/osinthunter/blob/main/app/models.py): `app/models.py`
- [Case graph store](https://github.com/letox4/osinthunter/blob/main/app/db.py): `app/db.py`
- [Settings and keys](https://github.com/letox4/osinthunter/blob/main/app/config.py): `app/config.py`

### Other components

- **Investigator**

## Connections

- Investigator → Browser UI: uses (evidence: `README.md`)
- Browser UI → FastAPI service: requests
- FastAPI service → Scan engine: starts scans (evidence: `app/main.py`)
- FastAPI service → Case graph store: manages cases (evidence: `app/main.py`)
- FastAPI service → Entity modeling: validates entities (evidence: `app/main.py`)
- FastAPI service → EXIF extraction: uses (evidence: `app/main.py`)
- Scan engine → Case graph store: writes findings (evidence: `app/engine.py`)
- Scan engine → Identity analysis: runs analysis (evidence: `app/engine.py`)
- Scan engine → Module registry: loads registry (evidence: `app/modules/base.py`)
- Scan engine → Username scans: dispatches
- Scan engine → Email scans: dispatches
- Scan engine → Phone scans: dispatches
- Scan engine → Person sources: dispatches
- Scan engine → Web search: dispatches
- Scan engine → Domain scans: dispatches
- Scan engine → IP scans: dispatches
- Scan engine → Chile sources: dispatches
- Scan engine → Chile datasets: dispatches
- Scan engine → Other sources: dispatches
- Scan engine → Document metadata: dispatches
- Scan engine → Deep scans: dispatches
- Scan engine → Auto enrichment: dispatches
- Identity analysis → Case graph store: reads graph (evidence: `app/analysis.py`)
- Identity analysis → Settings and keys: uses settings (evidence: `app/analysis.py`)
- Case graph store → Entity modeling: uses entity types (evidence: `app/db.py`)
- Case graph store → Settings and keys: reads data path (evidence: `app/db.py`)
