# yojimbo1of1bd/osintai architecture

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

- Interactive diagram: https://gitdiagram.com/yojimbo1of1bd/osintai
- Repository: https://github.com/yojimbo1of1bd/osintai

## Overview

Lodestar is a local web app for disciplined, passive OSINT casework. A researcher records sourced findings in a case, then can enrich that record with username checks, image metadata, and manually documented relationships; local triage and export help review and submit results. Case status governs actions such as scans and script runs. The graph follows documented capabilities where route implementations were not sampled; those links are marked optional or reflect README-level evidence.

Main entry points: [`app/database.py`](https://github.com/yojimbo1of1bd/osintai/blob/main/app/database.py) (SQLite database), [`app/main.py`](https://github.com/yojimbo1of1bd/osintai/blob/main/app/main.py) (FastAPI app), [`app/correlator.py`](https://github.com/yojimbo1of1bd/osintai/blob/main/app/correlator.py) (Username correlator), [`app/routes/cases.py`](https://github.com/yojimbo1of1bd/osintai/blob/main/app/routes/cases.py) (Case manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Local web app"]
  node_app["FastAPI app<br/>[main.py]"]
end

subgraph group_casework["Casework"]
  node_cases["Case manager<br/>[cases.py]"]
  node_findings["Finding logger<br/>[findings.py]"]
  node_relationships["Relationship mapper<br/>[relationships.py]"]
  node_models["Case data models<br/>[models.py]"]
  node_database[("SQLite database<br/>[database.py]")]
  node_dbfile[("Case database file")]
end

subgraph group_enrichment["Evidence enrichment"]
  node_images["Image importer<br/>[images.py]"]
  node_correlator["Username correlator<br/>[correlator.py]"]
  node_maigret["Maigret"]
  node_exif["ExifRead"]
end

subgraph group_review["Review and safeguards"]
  node_triage["LLM triage<br/>[triage.py]"]
  node_ollama["Ollama"]
  node_exporter["Case exporter<br/>[exporter.py]"]
  node_scripts["Custom script runner<br/>[scripts.py]"]
  node_scriptfiles["User scripts"]
  node_encryption["Field encryption<br/>[encryption.py]"]
end

node_researcher(("Researcher"))

node_researcher -->|"uses locally"| node_app
node_app -->|"dispatches routes"| node_cases
node_app -->|"dispatches routes"| node_findings
node_app -->|"dispatches routes"| node_relationships
node_app -->|"dispatches routes"| node_images
node_app -->|"dispatches routes"| node_triage
node_app -->|"dispatches routes"| node_exporter
node_app -->|"dispatches routes"| node_scripts
node_app -->|"initializes"| node_database
node_cases -->|"reads and writes"| node_database
node_cases -->|"cancels scans"| node_correlator
node_findings -->|"reads and writes"| node_database
node_findings -->|"starts scans"| node_correlator
node_correlator -->|"searches handles"| node_maigret
node_correlator -->|"stores matches"| node_database
node_relationships -->|"reads and writes"| node_database
node_images -->|"extracts metadata"| node_exif
node_images -->|"stores image record"| node_database
node_triage -.->|"reads case findings"| node_database
node_triage -.->|"requests summary"| node_ollama
node_exporter -->|"reads case data"| node_database
node_scripts -->|"checks case status"| node_database
node_scripts -->|"runs selected script"| node_scriptfiles
node_models -->|"uses encrypted fields"| node_encryption
node_database -->|"creates tables"| node_models
node_database -->|"persists data"| node_dbfile

click node_app "https://github.com/yojimbo1of1bd/osintai/blob/main/app/main.py"
click node_cases "https://github.com/yojimbo1of1bd/osintai/blob/main/app/routes/cases.py"
click node_findings "https://github.com/yojimbo1of1bd/osintai/blob/main/app/routes/findings.py"
click node_relationships "https://github.com/yojimbo1of1bd/osintai/blob/main/app/routes/relationships.py"
click node_images "https://github.com/yojimbo1of1bd/osintai/blob/main/app/routes/images.py"
click node_correlator "https://github.com/yojimbo1of1bd/osintai/blob/main/app/correlator.py"
click node_triage "https://github.com/yojimbo1of1bd/osintai/blob/main/app/routes/triage.py"
click node_exporter "https://github.com/yojimbo1of1bd/osintai/blob/main/app/routes/exporter.py"
click node_scripts "https://github.com/yojimbo1of1bd/osintai/blob/main/app/routes/scripts.py"
click node_scriptfiles "https://github.com/yojimbo1of1bd/osintai/tree/main/scripts"
click node_encryption "https://github.com/yojimbo1of1bd/osintai/blob/main/app/encryption.py"
click node_models "https://github.com/yojimbo1of1bd/osintai/blob/main/app/models.py"
click node_database "https://github.com/yojimbo1of1bd/osintai/blob/main/app/database.py"
click node_dbfile "https://github.com/yojimbo1of1bd/osintai/tree/main/data"

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_app toneBlue
class node_cases,node_findings,node_relationships,node_models,node_database,node_dbfile toneAmber
class node_images,node_correlator,node_maigret,node_exif toneMint
class node_triage,node_ollama,node_exporter,node_scripts,node_scriptfiles,node_encryption toneRose
class node_researcher toneIndigo
```

## Components

### Local web app

- [FastAPI app](https://github.com/yojimbo1of1bd/osintai/blob/main/app/main.py): `app/main.py`

### Casework

- [Case manager](https://github.com/yojimbo1of1bd/osintai/blob/main/app/routes/cases.py): `app/routes/cases.py`
- [Finding logger](https://github.com/yojimbo1of1bd/osintai/blob/main/app/routes/findings.py): `app/routes/findings.py`
- [Relationship mapper](https://github.com/yojimbo1of1bd/osintai/blob/main/app/routes/relationships.py): `app/routes/relationships.py`
- [Case data models](https://github.com/yojimbo1of1bd/osintai/blob/main/app/models.py): `app/models.py`
- [SQLite database](https://github.com/yojimbo1of1bd/osintai/blob/main/app/database.py): `app/database.py`
- [Case database file](https://github.com/yojimbo1of1bd/osintai/tree/main/data): `data`

### Evidence enrichment

- [Image importer](https://github.com/yojimbo1of1bd/osintai/blob/main/app/routes/images.py): `app/routes/images.py`
- [Username correlator](https://github.com/yojimbo1of1bd/osintai/blob/main/app/correlator.py): `app/correlator.py`
- **Maigret**
- **ExifRead**

### Review and safeguards

- [LLM triage](https://github.com/yojimbo1of1bd/osintai/blob/main/app/routes/triage.py): `app/routes/triage.py`
- **Ollama**
- [Case exporter](https://github.com/yojimbo1of1bd/osintai/blob/main/app/routes/exporter.py): `app/routes/exporter.py`
- [Custom script runner](https://github.com/yojimbo1of1bd/osintai/blob/main/app/routes/scripts.py): `app/routes/scripts.py`
- [User scripts](https://github.com/yojimbo1of1bd/osintai/tree/main/scripts): `scripts`
- [Field encryption](https://github.com/yojimbo1of1bd/osintai/blob/main/app/encryption.py): `app/encryption.py`

### Other components

- **Researcher**

## Connections

- Researcher → FastAPI app: uses locally
- FastAPI app → Case manager: dispatches routes
- FastAPI app → Finding logger: dispatches routes
- FastAPI app → Relationship mapper: dispatches routes
- FastAPI app → Image importer: dispatches routes
- FastAPI app → LLM triage: dispatches routes
- FastAPI app → Case exporter: dispatches routes
- FastAPI app → Custom script runner: dispatches routes
- FastAPI app → SQLite database: initializes
- Case manager → SQLite database: reads and writes
- Case manager → Username correlator: cancels scans
- Finding logger → SQLite database: reads and writes
- Finding logger → Username correlator: starts scans
- Username correlator → Maigret: searches handles
- Username correlator → SQLite database: stores matches
- Relationship mapper → SQLite database: reads and writes
- Image importer → ExifRead: extracts metadata
- Image importer → SQLite database: stores image record
- LLM triage → SQLite database: reads case findings
- LLM triage → Ollama: requests summary
- Case exporter → SQLite database: reads case data
- Custom script runner → SQLite database: checks case status
- Custom script runner → User scripts: runs selected script
- Case data models → Field encryption: uses encrypted fields
- SQLite database → Case data models: creates tables
- SQLite database → Case database file: persists data
