# maypencs/tracefind architecture

> Architecture diagram of the GitHub repository maypencs/tracefind, 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/maypencs/tracefind
- Repository: https://github.com/maypencs/tracefind

## Overview

tracefind is a web and CLI OSINT tool for username, email-breach, and domain-security checks. The main web flow sends a user’s query through API routes to scanners and breach providers; results are normalized, gated where needed, saved to local history, and presented as exposure reports. The README documents streaming username results, optional breach providers, password k-anonymity, and domain ownership checks. Arrows are limited to relationships visible in excerpts or explicitly documented; several unsampled integrations are therefore omitted.

Main entry points: [`backend/tracefind/app.py`](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/app.py) (Web API), [`frontend/src/App.jsx`](https://github.com/maypencs/tracefind/blob/main/frontend/src/App.jsx) (Web app), [`backend/tracefind/domain/scanner.py`](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/domain/scanner.py) (Domain scanner), [`backend/tracefind/domain/router.py`](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/domain/router.py) (Domain API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_webui["Web app<br/>[App.jsx]"]
  node_reportui["Report panel"]
  node_domainui["Domain view<br/>[DomainScan.jsx]"]
  node_historyui["History view<br/>[ScanHistory.jsx]"]
  node_verifyui["Email verification view<br/>[VerifyEmail.jsx]"]
end

subgraph group_api["API and access"]
  node_apiapp["Web API<br/>[app.py]"]
  node_publicmode["Public-site controls<br/>[public.py]"]
end

subgraph group_scanning["Scanning and lookups"]
  node_username["Username sweep<br/>[probe.py]"]
  node_sitecatalog["Site rules<br/>[sites.py]"]
  node_breach["Breach lookup<br/>[breach.py]"]
  node_hibpcatalog["Breach catalogue<br/>[hibp_catalog.py]"]
  node_domainroutes["Domain API<br/>[router.py]"]
  node_domainscan["Domain scanner<br/>[scanner.py]"]
  node_emailchecks["Email-auth checks<br/>[email_auth.py]"]
  node_ownership["Ownership checks<br/>[ownership.py]"]
  node_domainprobes["Web probes<br/>[probes.py]"]
  node_passwords["Pwned Passwords service"]
  node_breachproviders["Optional breach providers"]
end

subgraph group_state["Verification and history"]
  node_verifyroutes["Verification routes<br/>[router.py]"]
  node_verifyservice["Verification service<br/>[service.py]"]
  node_mailer["Verification mailer<br/>[mailer.py]"]
  node_historyroutes["History routes<br/>[router.py]"]
  node_historystore[("Scan history store<br/>[store.py]")]
end

subgraph group_reports["Exposure reports"]
  node_reportmodels["Scan and report models<br/>[models.py]"]
  node_scoring["Finding scorer<br/>[scoring.py]"]
  node_diff["Scan comparison<br/>[diff.py]"]
  node_reportroutes["Report routes<br/>[router.py]"]
  node_renderer["HTML and PDF renderer<br/>[render.py]"]
end

node_user(("Investigator"))

node_user -->|"uses"| node_webui
node_webui -->|"submits scans"| node_apiapp
node_apiapp -->|"streams lookup"| node_username
node_username -->|"checks rules"| node_sitecatalog
node_webui -->|"renders report"| node_reportui
node_webui -->|"renders domain tab"| node_domainui
node_webui -->|"renders history"| node_historyui
node_webui -->|"renders verification"| node_verifyui
node_apiapp -->|"mounts routes"| node_domainroutes
node_apiapp -->|"mounts routes"| node_historyroutes
node_apiapp -->|"mounts routes"| node_verifyroutes
node_apiapp -->|"mounts routes"| node_reportroutes
node_apiapp -->|"handles lookup"| node_breach
node_apiapp -->|"applies access rules"| node_publicmode
node_breach -->|"uses catalogue"| node_hibpcatalog
node_breach -.->|"queries optionally"| node_breachproviders
node_webui -->|"checks password"| node_passwords
node_passwords -->|"sends hash prefix"| node_apiapp
node_domainui -->|"requests scan"| node_domainroutes
node_domainroutes -->|"runs scan"| node_domainscan
node_domainscan -->|"runs DNS checks"| node_emailchecks
node_domainscan -->|"checks ownership"| node_ownership
node_domainscan -->|"runs web probes"| node_domainprobes
node_domainroutes -->|"saves scan"| node_historystore
node_verifyroutes -->|"requests verification"| node_verifyservice
node_verifyservice -->|"sends code"| node_mailer
node_verifyroutes -->|"gates history access"| node_historystore
node_historyroutes -->|"reads scans"| node_historystore
node_historyroutes -->|"compares scans"| node_diff
node_historystore -->|"stores normalized scans"| node_reportmodels
node_reportroutes -->|"builds findings"| node_scoring
node_scoring -->|"returns report"| node_reportmodels
node_reportroutes -->|"renders downloads"| node_renderer
node_reportui -->|"requests exports"| node_reportroutes

click node_webui "https://github.com/maypencs/tracefind/blob/main/frontend/src/App.jsx"
click node_reportui "https://github.com/maypencs/tracefind/blob/main/frontend/src/components/ExposureReportPanel.jsx"
click node_domainui "https://github.com/maypencs/tracefind/blob/main/frontend/src/components/DomainScan.jsx"
click node_historyui "https://github.com/maypencs/tracefind/blob/main/frontend/src/components/ScanHistory.jsx"
click node_verifyui "https://github.com/maypencs/tracefind/blob/main/frontend/src/components/VerifyEmail.jsx"
click node_apiapp "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/app.py"
click node_publicmode "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/public.py"
click node_username "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/probe.py"
click node_sitecatalog "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/sites.py"
click node_breach "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/breach.py"
click node_hibpcatalog "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/hibp_catalog.py"
click node_domainroutes "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/domain/router.py"
click node_domainscan "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/domain/scanner.py"
click node_emailchecks "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/domain/email_auth.py"
click node_ownership "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/domain/ownership.py"
click node_domainprobes "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/domain/probes.py"
click node_verifyroutes "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/verify/router.py"
click node_verifyservice "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/verify/service.py"
click node_mailer "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/verify/mailer.py"
click node_historyroutes "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/history/router.py"
click node_historystore "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/history/store.py"
click node_reportmodels "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/report/models.py"
click node_scoring "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/report/scoring.py"
click node_diff "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/report/diff.py"
click node_reportroutes "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/report/router.py"
click node_renderer "https://github.com/maypencs/tracefind/blob/main/backend/tracefind/report/render.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_webui,node_reportui,node_domainui,node_historyui,node_verifyui toneBlue
class node_apiapp,node_publicmode toneAmber
class node_username,node_sitecatalog,node_breach,node_hibpcatalog,node_domainroutes,node_domainscan,node_emailchecks,node_ownership,node_domainprobes,node_passwords,node_breachproviders toneMint
class node_verifyroutes,node_verifyservice,node_mailer,node_historyroutes,node_historystore toneRose
class node_reportmodels,node_scoring,node_diff,node_reportroutes,node_renderer,node_user toneIndigo
```

## Components

### User interface

- [Web app](https://github.com/maypencs/tracefind/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Report panel](https://github.com/maypencs/tracefind/blob/main/frontend/src/components/ExposureReportPanel.jsx): `frontend/src/components/ExposureReportPanel.jsx`
- [Domain view](https://github.com/maypencs/tracefind/blob/main/frontend/src/components/DomainScan.jsx): `frontend/src/components/DomainScan.jsx`
- [History view](https://github.com/maypencs/tracefind/blob/main/frontend/src/components/ScanHistory.jsx): `frontend/src/components/ScanHistory.jsx`
- [Email verification view](https://github.com/maypencs/tracefind/blob/main/frontend/src/components/VerifyEmail.jsx): `frontend/src/components/VerifyEmail.jsx`

### API and access

- [Web API](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/app.py): `backend/tracefind/app.py`
- [Public-site controls](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/public.py): `backend/tracefind/public.py`

### Scanning and lookups

- [Username sweep](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/probe.py): `backend/tracefind/probe.py`
- [Site rules](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/sites.py): `backend/tracefind/sites.py`
- [Breach lookup](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/breach.py): `backend/tracefind/breach.py`
- [Breach catalogue](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/hibp_catalog.py): `backend/tracefind/hibp_catalog.py`
- [Domain API](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/domain/router.py): `backend/tracefind/domain/router.py`
- [Domain scanner](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/domain/scanner.py): `backend/tracefind/domain/scanner.py`
- [Email-auth checks](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/domain/email_auth.py): `backend/tracefind/domain/email_auth.py`
- [Ownership checks](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/domain/ownership.py): `backend/tracefind/domain/ownership.py`
- [Web probes](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/domain/probes.py): `backend/tracefind/domain/probes.py`
- **Pwned Passwords service**
- **Optional breach providers**

### Verification and history

- [Verification routes](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/verify/router.py): `backend/tracefind/verify/router.py`
- [Verification service](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/verify/service.py): `backend/tracefind/verify/service.py`
- [Verification mailer](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/verify/mailer.py): `backend/tracefind/verify/mailer.py`
- [History routes](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/history/router.py): `backend/tracefind/history/router.py`
- [Scan history store](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/history/store.py): `backend/tracefind/history/store.py`

### Exposure reports

- [Scan and report models](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/report/models.py): `backend/tracefind/report/models.py`
- [Finding scorer](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/report/scoring.py): `backend/tracefind/report/scoring.py`
- [Scan comparison](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/report/diff.py): `backend/tracefind/report/diff.py`
- [Report routes](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/report/router.py): `backend/tracefind/report/router.py`
- [HTML and PDF renderer](https://github.com/maypencs/tracefind/blob/main/backend/tracefind/report/render.py): `backend/tracefind/report/render.py`

### Other components

- **Investigator**

## Connections

- Investigator → Web app: uses
- Web app → Web API: submits scans
- Web API → Username sweep: streams lookup (evidence: `backend/tracefind/app.py`)
- Username sweep → Site rules: checks rules (evidence: `backend/tracefind/__main__.py`)
- Web app → Report panel: renders report (evidence: `frontend/src/App.jsx`)
- Web app → Domain view: renders domain tab (evidence: `frontend/src/App.jsx`)
- Web app → History view: renders history (evidence: `frontend/src/App.jsx`)
- Web app → Email verification view: renders verification (evidence: `frontend/src/App.jsx`)
- Web API → Domain API: mounts routes (evidence: `backend/tracefind/app.py`)
- Web API → History routes: mounts routes (evidence: `backend/tracefind/app.py`)
- Web API → Verification routes: mounts routes (evidence: `backend/tracefind/app.py`)
- Web API → Report routes: mounts routes (evidence: `backend/tracefind/app.py`)
- Web API → Breach lookup: handles lookup (evidence: `backend/tracefind/app.py`)
- Web API → Public-site controls: applies access rules (evidence: `backend/tracefind/app.py`)
- Breach lookup → Breach catalogue: uses catalogue (evidence: `backend/tracefind/breach.py`)
- Breach lookup → Optional breach providers: queries optionally
- Web app → Pwned Passwords service: checks password
- Pwned Passwords service → Web API: sends hash prefix (evidence: `backend/tracefind/app.py`)
- Domain view → Domain API: requests scan
- Domain API → Domain scanner: runs scan (evidence: `backend/tracefind/domain/router.py`)
- Domain scanner → Email-auth checks: runs DNS checks (evidence: `backend/tracefind/domain/scanner.py`)
- Domain scanner → Ownership checks: checks ownership (evidence: `backend/tracefind/domain/scanner.py`)
- Domain scanner → Web probes: runs web probes (evidence: `backend/tracefind/domain/scanner.py`)
- Domain API → Scan history store: saves scan (evidence: `backend/tracefind/domain/router.py`)
- Verification routes → Verification service: requests verification (evidence: `backend/tracefind/verify/router.py`)
- Verification service → Verification mailer: sends code (evidence: `backend/tracefind/verify/service.py`)
- Verification routes → Scan history store: gates history access (evidence: `backend/tracefind/history/router.py`)
- History routes → Scan history store: reads scans (evidence: `backend/tracefind/history/router.py`)
- History routes → Scan comparison: compares scans (evidence: `backend/tracefind/history/router.py`)
- Scan history store → Scan and report models: stores normalized scans (evidence: `backend/tracefind/history/store.py`)
- Report routes → Finding scorer: builds findings (evidence: `backend/tracefind/report/router.py`)
- Finding scorer → Scan and report models: returns report (evidence: `backend/tracefind/report/scoring.py`)
- Report routes → HTML and PDF renderer: renders downloads (evidence: `backend/tracefind/report/router.py`)
- Report panel → Report routes: requests exports (evidence: `frontend/src/components/ExposureReportPanel.jsx`)
