# surya1259f/adfip architecture

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

- Interactive diagram: https://gitdiagram.com/surya1259f/adfip
- Repository: https://github.com/surya1259f/adfip

## Overview

ADFIR is a desktop digital-forensics investigation platform. Investigators create cases and supply evidence; the documented workflow preserves and hashes evidence, plans deterministic tool work, runs specialist analysis, correlates and verifies findings, adds LLM reasoning, and produces a court-ready report for investigator review. The graph follows that documented product flow and highlights the API, persistence, and desktop UI layers. Several service and endpoint implementations were not sampled, so their connections are shown only where the README or inspected references support them.

Main entry points: [`backend/app/api/v1/endpoints`](https://github.com/surya1259f/adfip/tree/master/backend/app/api/v1/endpoints) (Case and evidence API), [`investigation/orchestrator/orchestrator.py`](https://github.com/surya1259f/adfip/blob/master/investigation/orchestrator/orchestrator.py) (Execution orchestrator), [`forensic_tools/registry.py`](https://github.com/surya1259f/adfip/blob/master/forensic_tools/registry.py) (Forensic tool registry), [`backend/app/api/v1/endpoints/review.py`](https://github.com/surya1259f/adfip/blob/master/backend/app/api/v1/endpoints/review.py) (Investigator review)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop interface"]
  node_desktop_app["Desktop app<br/>[App.tsx]"]
  node_ui_pages["Investigation views"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_api_data["API and case data"]
  node_api_router["API router<br/>[router.py]"]
  node_case_api["Case and evidence API"]
  node_database[("Case database<br/>[database.py]")]
  node_models["Case records<br/>[models.py]"]
end

subgraph group_forensics["Evidence and forensics"]
  node_acquisition["Evidence acquisition<br/>[acquisition.py]"]
  node_integrity_custody["Integrity and custody<br/>[integrity.py]"]
  node_specialist_agents["Specialist agents"]
  node_forensic_tools["Forensic tool registry<br/>[registry.py]"]
end

subgraph group_analysis["Analysis and reporting"]
  node_planner["Investigation planner<br/>[planner.py]"]
  node_orchestrator["Execution orchestrator<br/>[orchestrator.py]"]
  node_correlation["Finding correlation<br/>[engine.py]"]
  node_verification["Finding verification<br/>[engine.py]"]
  node_llm_reasoning["LLM reasoning<br/>[ai_reasoning.py]"]
  node_reporting["Report generation<br/>[generator.py]"]
end

subgraph group_oversight["Review and governance"]
  node_review["Investigator review<br/>[review.py]"]
  node_audit["Audit service<br/>[audit.py]"]
end

node_investigator(("Investigator"))

node_investigator -->|"uses"| node_desktop_app
node_desktop_app -->|"presents"| node_ui_pages
node_ui_pages -->|"requests data"| node_api_client
node_api_client -.->|"calls API"| node_api_router
node_api_router -->|"routes requests"| node_case_api
node_case_api -.->|"accesses data"| node_database
node_database -->|"maps records"| node_models
node_case_api -.->|"acquires evidence"| node_acquisition
node_acquisition -.->|"records integrity"| node_integrity_custody
node_integrity_custody -->|"supplies evidence"| node_planner
node_planner -->|"plans execution"| node_orchestrator
node_orchestrator -->|"dispatches tasks"| node_specialist_agents
node_specialist_agents -->|"uses tools"| node_forensic_tools
node_orchestrator -->|"resolves tools"| node_forensic_tools
node_forensic_tools -.->|"produces tool facts"| node_correlation
node_correlation -.->|"correlates findings"| node_verification
node_verification -->|"supplies verified facts"| node_llm_reasoning
node_llm_reasoning -->|"informs report"| node_reporting
node_reporting -.->|"presents report"| node_review
node_investigator -->|"reviews results"| node_review
node_review -.->|"records decisions"| node_audit

click node_desktop_app "https://github.com/surya1259f/adfip/blob/master/frontend/src/App.tsx"
click node_ui_pages "https://github.com/surya1259f/adfip/tree/master/frontend/src/pages"
click node_api_client "https://github.com/surya1259f/adfip/blob/master/frontend/src/services/api.ts"
click node_api_router "https://github.com/surya1259f/adfip/blob/master/backend/app/api/v1/router.py"
click node_case_api "https://github.com/surya1259f/adfip/tree/master/backend/app/api/v1/endpoints"
click node_database "https://github.com/surya1259f/adfip/blob/master/backend/app/core/database.py"
click node_models "https://github.com/surya1259f/adfip/blob/master/backend/app/models/models.py"
click node_acquisition "https://github.com/surya1259f/adfip/blob/master/backend/app/services/acquisition.py"
click node_integrity_custody "https://github.com/surya1259f/adfip/blob/master/backend/app/services/integrity.py"
click node_planner "https://github.com/surya1259f/adfip/blob/master/investigation/planner/planner.py"
click node_orchestrator "https://github.com/surya1259f/adfip/blob/master/investigation/orchestrator/orchestrator.py"
click node_specialist_agents "https://github.com/surya1259f/adfip/tree/master/agents"
click node_forensic_tools "https://github.com/surya1259f/adfip/blob/master/forensic_tools/registry.py"
click node_correlation "https://github.com/surya1259f/adfip/blob/master/investigation/correlation/engine.py"
click node_verification "https://github.com/surya1259f/adfip/blob/master/investigation/verification/engine.py"
click node_llm_reasoning "https://github.com/surya1259f/adfip/blob/master/backend/app/services/ai_reasoning.py"
click node_reporting "https://github.com/surya1259f/adfip/blob/master/investigation/reporting/generator.py"
click node_review "https://github.com/surya1259f/adfip/blob/master/backend/app/api/v1/endpoints/review.py"
click node_audit "https://github.com/surya1259f/adfip/blob/master/backend/app/services/audit.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_desktop_app,node_ui_pages,node_api_client toneBlue
class node_api_router,node_case_api,node_database,node_models toneAmber
class node_acquisition,node_integrity_custody,node_specialist_agents,node_forensic_tools toneMint
class node_planner,node_orchestrator,node_correlation,node_verification,node_llm_reasoning,node_reporting toneRose
class node_review,node_audit,node_investigator toneIndigo
```

## Components

### Desktop interface

- [Desktop app](https://github.com/surya1259f/adfip/blob/master/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Investigation views](https://github.com/surya1259f/adfip/tree/master/frontend/src/pages): `frontend/src/pages`
- [API client](https://github.com/surya1259f/adfip/blob/master/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### API and case data

- [API router](https://github.com/surya1259f/adfip/blob/master/backend/app/api/v1/router.py): `backend/app/api/v1/router.py`
- [Case and evidence API](https://github.com/surya1259f/adfip/tree/master/backend/app/api/v1/endpoints): `backend/app/api/v1/endpoints`
- [Case database](https://github.com/surya1259f/adfip/blob/master/backend/app/core/database.py): `backend/app/core/database.py`
- [Case records](https://github.com/surya1259f/adfip/blob/master/backend/app/models/models.py): `backend/app/models/models.py`

### Evidence and forensics

- [Evidence acquisition](https://github.com/surya1259f/adfip/blob/master/backend/app/services/acquisition.py): `backend/app/services/acquisition.py`
- [Integrity and custody](https://github.com/surya1259f/adfip/blob/master/backend/app/services/integrity.py): `backend/app/services/integrity.py`
- [Specialist agents](https://github.com/surya1259f/adfip/tree/master/agents): `agents`
- [Forensic tool registry](https://github.com/surya1259f/adfip/blob/master/forensic_tools/registry.py): `forensic_tools/registry.py`

### Analysis and reporting

- [Investigation planner](https://github.com/surya1259f/adfip/blob/master/investigation/planner/planner.py): `investigation/planner/planner.py`
- [Execution orchestrator](https://github.com/surya1259f/adfip/blob/master/investigation/orchestrator/orchestrator.py): `investigation/orchestrator/orchestrator.py`
- [Finding correlation](https://github.com/surya1259f/adfip/blob/master/investigation/correlation/engine.py): `investigation/correlation/engine.py`
- [Finding verification](https://github.com/surya1259f/adfip/blob/master/investigation/verification/engine.py): `investigation/verification/engine.py`
- [LLM reasoning](https://github.com/surya1259f/adfip/blob/master/backend/app/services/ai_reasoning.py): `backend/app/services/ai_reasoning.py`
- [Report generation](https://github.com/surya1259f/adfip/blob/master/investigation/reporting/generator.py): `investigation/reporting/generator.py`

### Review and governance

- [Investigator review](https://github.com/surya1259f/adfip/blob/master/backend/app/api/v1/endpoints/review.py): `backend/app/api/v1/endpoints/review.py`
- [Audit service](https://github.com/surya1259f/adfip/blob/master/backend/app/services/audit.py): `backend/app/services/audit.py`

### Other components

- **Investigator**

## Connections

- Investigator → Desktop app: uses (evidence: `README.md`)
- Desktop app → Investigation views: presents
- Investigation views → API client: requests data (evidence: `frontend/src/pages/InvestigatorReviewPage.tsx`)
- API client → API router: calls API
- API router → Case and evidence API: routes requests (evidence: `backend/app/api/v1/router.py`)
- Case and evidence API → Case database: accesses data (evidence: `backend/app/api/v1/endpoints/review.py`)
- Case database → Case records: maps records (evidence: `backend/app/models/models.py`)
- Case and evidence API → Evidence acquisition: acquires evidence
- Evidence acquisition → Integrity and custody: records integrity
- Integrity and custody → Investigation planner: supplies evidence (evidence: `README.md`)
- Investigation planner → Execution orchestrator: plans execution (evidence: `investigation/orchestrator/orchestrator.py`)
- Execution orchestrator → Specialist agents: dispatches tasks (evidence: `investigation/orchestrator/orchestrator.py`)
- Specialist agents → Forensic tool registry: uses tools (evidence: `agents/disk/disk_agent.py`)
- Execution orchestrator → Forensic tool registry: resolves tools (evidence: `investigation/orchestrator/orchestrator.py`)
- Forensic tool registry → Finding correlation: produces tool facts
- Finding correlation → Finding verification: correlates findings
- Finding verification → LLM reasoning: supplies verified facts (evidence: `README.md`)
- LLM reasoning → Report generation: informs report (evidence: `README.md`)
- Report generation → Investigator review: presents report
- Investigator → Investigator review: reviews results (evidence: `backend/app/api/v1/endpoints/review.py`)
- Investigator review → Audit service: records decisions
