# koushikrayapudi97-dotcom/forensicx architecture

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

- Interactive diagram: https://gitdiagram.com/koushikrayapudi97-dotcom/forensicx
- Repository: https://github.com/koushikrayapudi97-dotcom/forensicx

## Overview

This is a local, authorization-bounded Android forensics dashboard. Investigators create cases, detect an authorized ADB device, perform read-only acquisition or import an existing forensic image, preserve evidence and custody metadata, analyze artifacts, and generate reports. The graph retains the documented analysis, intelligence, malware, adapter, and optional AI branches. Some route-to-service links are supported by the SOURCE INDEX rather than inspected call bodies; unsampled implementation details and uncertain links are omitted.

Main entry points: [`backend/database/database.py`](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/database/database.py) (SQLite persistence), [`backend/main.py`](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/main.py) (API application), [`backend/services/incident_timeline_engine.py`](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/incident_timeline_engine.py) (Incident timeline), [`backend/api/forensic_intelligence_routes.py`](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/api/forensic_intelligence_routes.py) (Forensic intelligence endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Investigation interface"]
  node_dashboard["Dashboard<br/>[app.js]"]
  node_api["API application<br/>[main.py]"]
  node_cases["Case management<br/>[case_routes.py]"]
end

subgraph group_collection["Device and evidence collection"]
  node_device_routes["Device endpoints<br/>[device_routes.py]"]
  node_device_manager["Device management<br/>[device_manager.py]"]
  node_adb["Read-only ADB<br/>[adb_manager.py]"]
  node_mobile_intel["Mobile intelligence"]
  node_acquisition["Controlled acquisition"]
  node_evidence_routes["Evidence endpoints<br/>[evidence_routes.py]"]
  node_image_import["Authorized image import"]
  node_hashing["SHA-256 integrity<br/>[hashing.py]"]
end

subgraph group_analysis["Forensic analysis"]
  node_analysis_routes["Artifact analysis endpoints<br/>[analysis_routes.py]"]
  node_forensic_tools["Filesystem, metadata, search, timeline"]
  node_adapters["Tool adapters<br/>[adapters.py]"]
end

subgraph group_intelligence["Intelligence and reporting"]
  node_forensic_intel_routes["Forensic intelligence endpoints"]
  node_normalization["Evidence normalization"]
  node_correlation["Evidence correlation"]
  node_reliability["Reliability scoring"]
  node_graph_engine["Evidence graph"]
  node_incident_timeline["Incident timeline"]
  node_ai_investigation["Optional AI investigation"]
  node_malware["Malware scanning"]
  node_reports["PDF reporting<br/>[report_manager.py]"]
end

subgraph group_platform["Identity and persistence"]
  node_auth_routes["Authentication routes<br/>[auth_routes.py]"]
  node_auth_service["Authentication service<br/>[auth_service.py]"]
  node_database[("SQLite persistence<br/>[database.py]")]
end

node_investigator(("Investigator"))

node_investigator -->|"uses"| node_dashboard
node_dashboard -.->|"calls API"| node_api
node_api -->|"registers routes"| node_cases
node_api -->|"registers routes"| node_auth_routes
node_api -->|"registers routes"| node_device_routes
node_api -->|"registers routes"| node_evidence_routes
node_api -->|"registers routes"| node_analysis_routes
node_api -->|"registers routes"| node_forensic_intel_routes
node_api -->|"initializes"| node_database
node_auth_routes -->|"delegates to"| node_auth_service
node_auth_service -->|"reads and writes"| node_database
node_cases -->|"reads and writes"| node_database
node_device_routes -->|"uses"| node_device_manager
node_device_routes -->|"uses"| node_mobile_intel
node_device_manager -->|"queries devices"| node_adb
node_device_manager -->|"records state"| node_database
node_acquisition -->|"runs read-only commands"| node_adb
node_acquisition -->|"collects records"| node_mobile_intel
node_acquisition -->|"registers artifacts"| node_database
node_evidence_routes -->|"verifies hashes"| node_hashing
node_evidence_routes -->|"persists evidence"| node_database
node_evidence_routes -->|"imports authorized images"| node_image_import
node_analysis_routes -->|"uses analysis modules"| node_forensic_tools
node_analysis_routes -->|"loads case evidence"| node_database
node_forensic_intel_routes -->|"runs normalization"| node_normalization
node_forensic_intel_routes -->|"runs correlation"| node_correlation
node_forensic_intel_routes -->|"runs scoring"| node_reliability
node_forensic_intel_routes -->|"runs graph"| node_graph_engine
node_forensic_intel_routes -.->|"runs timeline"| node_incident_timeline
node_normalization -->|"reads artifacts"| node_database
node_correlation -->|"uses normalized evidence"| node_normalization
node_correlation -.->|"stores correlations"| node_database
node_reliability -->|"uses correlations"| node_correlation
node_reliability -.->|"stores scores"| node_database
node_graph_engine -->|"uses correlations"| node_correlation
node_graph_engine -->|"uses normalized evidence"| node_normalization
node_graph_engine -->|"stores graph"| node_database
node_incident_timeline -->|"uses correlations"| node_correlation
node_incident_timeline -->|"uses graph data"| node_graph_engine
node_incident_timeline -->|"uses normalized evidence"| node_normalization
node_incident_timeline -->|"uses reliability scores"| node_reliability
node_incident_timeline -->|"stores timeline"| node_database
node_reports -->|"includes timeline"| node_incident_timeline
node_reports -->|"loads report data"| node_database
node_ai_investigation -.->|"grounds analysis"| node_database
node_malware -.->|"analyzes case evidence"| node_database
node_adapters -.->|"reports configuration"| node_investigator

click node_dashboard "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/frontend/app.js"
click node_api "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/main.py"
click node_cases "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/api/case_routes.py"
click node_auth_routes "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/api/auth_routes.py"
click node_auth_service "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/auth_service.py"
click node_database "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/database/database.py"
click node_device_routes "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/api/device_routes.py"
click node_device_manager "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/device_manager.py"
click node_adb "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/adb_manager.py"
click node_mobile_intel "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/mobile_intelligence.py"
click node_acquisition "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/acquisition_manager.py"
click node_evidence_routes "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/api/evidence_routes.py"
click node_image_import "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/authorized_importer.py"
click node_hashing "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/hashing.py"
click node_analysis_routes "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/api/analysis_routes.py"
click node_forensic_tools "https://github.com/koushikrayapudi97-dotcom/forensicx/tree/main/forensic"
click node_forensic_intel_routes "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/api/forensic_intelligence_routes.py"
click node_normalization "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/evidence_normalization_engine.py"
click node_correlation "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/evidence_correlation_engine.py"
click node_reliability "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/evidence_reliability_engine.py"
click node_graph_engine "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/evidence_graph_engine.py"
click node_incident_timeline "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/incident_timeline_engine.py"
click node_ai_investigation "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/ai_investigation_service.py"
click node_malware "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/malware_scanner_service.py"
click node_adapters "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/forensic/adapters.py"
click node_reports "https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/report_manager.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_dashboard,node_api,node_cases toneBlue
class node_device_routes,node_device_manager,node_adb,node_mobile_intel,node_acquisition,node_evidence_routes,node_image_import,node_hashing toneAmber
class node_analysis_routes,node_forensic_tools,node_adapters toneMint
class node_forensic_intel_routes,node_normalization,node_correlation,node_reliability,node_graph_engine,node_incident_timeline,node_ai_investigation,node_malware,node_reports toneRose
class node_auth_routes,node_auth_service,node_database,node_investigator toneIndigo
```

## Components

### Investigation interface

- [Dashboard](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/frontend/app.js): `frontend/app.js`
- [API application](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/main.py): `backend/main.py`
- [Case management](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/api/case_routes.py): `backend/api/case_routes.py`

### Device and evidence collection

- [Device endpoints](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/api/device_routes.py): `backend/api/device_routes.py`
- [Device management](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/device_manager.py): `backend/services/device_manager.py`
- [Read-only ADB](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/adb_manager.py): `backend/services/adb_manager.py`
- [Mobile intelligence](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/mobile_intelligence.py): `backend/services/mobile_intelligence.py`
- [Controlled acquisition](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/acquisition_manager.py): `backend/services/acquisition_manager.py`
- [Evidence endpoints](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/api/evidence_routes.py): `backend/api/evidence_routes.py`
- [Authorized image import](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/authorized_importer.py): `backend/services/authorized_importer.py`
- [SHA-256 integrity](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/hashing.py): `backend/services/hashing.py`

### Forensic analysis

- [Artifact analysis endpoints](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/api/analysis_routes.py): `backend/api/analysis_routes.py`
- [Filesystem, metadata, search, timeline](https://github.com/koushikrayapudi97-dotcom/forensicx/tree/main/forensic): `forensic`
- [Tool adapters](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/forensic/adapters.py): `forensic/adapters.py`

### Intelligence and reporting

- [Forensic intelligence endpoints](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/api/forensic_intelligence_routes.py): `backend/api/forensic_intelligence_routes.py`
- [Evidence normalization](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/evidence_normalization_engine.py): `backend/services/evidence_normalization_engine.py`
- [Evidence correlation](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/evidence_correlation_engine.py): `backend/services/evidence_correlation_engine.py`
- [Reliability scoring](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/evidence_reliability_engine.py): `backend/services/evidence_reliability_engine.py`
- [Evidence graph](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/evidence_graph_engine.py): `backend/services/evidence_graph_engine.py`
- [Incident timeline](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/incident_timeline_engine.py): `backend/services/incident_timeline_engine.py`
- [Optional AI investigation](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/ai_investigation_service.py): `backend/services/ai_investigation_service.py`
- [Malware scanning](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/malware_scanner_service.py): `backend/services/malware_scanner_service.py`
- [PDF reporting](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/report_manager.py): `backend/services/report_manager.py`

### Identity and persistence

- [Authentication routes](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/api/auth_routes.py): `backend/api/auth_routes.py`
- [Authentication service](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/services/auth_service.py): `backend/services/auth_service.py`
- [SQLite persistence](https://github.com/koushikrayapudi97-dotcom/forensicx/blob/main/backend/database/database.py): `backend/database/database.py`

### Other components

- **Investigator**

## Connections

- Investigator → Dashboard: uses (evidence: `README.md`)
- Dashboard → API application: calls API
- API application → Case management: registers routes (evidence: `backend/main.py`)
- API application → Authentication routes: registers routes (evidence: `backend/main.py`)
- API application → Device endpoints: registers routes (evidence: `backend/main.py`)
- API application → Evidence endpoints: registers routes (evidence: `backend/main.py`)
- API application → Artifact analysis endpoints: registers routes (evidence: `backend/main.py`)
- API application → Forensic intelligence endpoints: registers routes (evidence: `backend/main.py`)
- API application → SQLite persistence: initializes (evidence: `backend/main.py`)
- Authentication routes → Authentication service: delegates to (evidence: `backend/api/auth_routes.py`)
- Authentication service → SQLite persistence: reads and writes (evidence: `backend/services/auth_service.py`)
- Case management → SQLite persistence: reads and writes (evidence: `backend/api/case_routes.py`)
- Device endpoints → Device management: uses (evidence: `backend/api/device_routes.py`)
- Device endpoints → Mobile intelligence: uses (evidence: `backend/api/device_routes.py`)
- Device management → Read-only ADB: queries devices (evidence: `backend/services/device_manager.py`)
- Device management → SQLite persistence: records state (evidence: `backend/services/device_manager.py`)
- Controlled acquisition → Read-only ADB: runs read-only commands (evidence: `backend/services/acquisition_manager.py`)
- Controlled acquisition → Mobile intelligence: collects records (evidence: `backend/services/acquisition_manager.py`)
- Controlled acquisition → SQLite persistence: registers artifacts (evidence: `backend/services/acquisition_manager.py`)
- Evidence endpoints → SHA-256 integrity: verifies hashes (evidence: `backend/api/evidence_routes.py`)
- Evidence endpoints → SQLite persistence: persists evidence (evidence: `backend/api/evidence_routes.py`)
- Evidence endpoints → Authorized image import: imports authorized images
- Artifact analysis endpoints → Filesystem, metadata, search, timeline: uses analysis modules (evidence: `backend/api/analysis_routes.py`)
- Artifact analysis endpoints → SQLite persistence: loads case evidence (evidence: `backend/api/analysis_routes.py`)
- Forensic intelligence endpoints → Evidence normalization: runs normalization (evidence: `backend/api/forensic_intelligence_routes.py`)
- Forensic intelligence endpoints → Evidence correlation: runs correlation (evidence: `backend/api/forensic_intelligence_routes.py`)
- Forensic intelligence endpoints → Reliability scoring: runs scoring (evidence: `backend/api/forensic_intelligence_routes.py`)
- Forensic intelligence endpoints → Evidence graph: runs graph (evidence: `backend/api/forensic_intelligence_routes.py`)
- Forensic intelligence endpoints → Incident timeline: runs timeline (evidence: `backend/api/forensic_intelligence_routes.py`)
- Evidence normalization → SQLite persistence: reads artifacts (evidence: `backend/services/evidence_normalization_engine.py`)
- Evidence correlation → Evidence normalization: uses normalized evidence (evidence: `backend/services/evidence_correlation_engine.py`)
- Evidence correlation → SQLite persistence: stores correlations (evidence: `backend/services/evidence_correlation_engine.py`)
- Reliability scoring → Evidence correlation: uses correlations (evidence: `backend/services/evidence_reliability_engine.py`)
- Reliability scoring → SQLite persistence: stores scores (evidence: `backend/services/evidence_reliability_engine.py`)
- Evidence graph → Evidence correlation: uses correlations (evidence: `backend/services/evidence_graph_engine.py`)
- Evidence graph → Evidence normalization: uses normalized evidence (evidence: `backend/services/evidence_graph_engine.py`)
- Evidence graph → SQLite persistence: stores graph (evidence: `backend/services/evidence_graph_engine.py`)
- Incident timeline → Evidence correlation: uses correlations (evidence: `backend/services/incident_timeline_engine.py`)
- Incident timeline → Evidence graph: uses graph data (evidence: `backend/services/incident_timeline_engine.py`)
- Incident timeline → Evidence normalization: uses normalized evidence (evidence: `backend/services/incident_timeline_engine.py`)
- Incident timeline → Reliability scoring: uses reliability scores (evidence: `backend/services/incident_timeline_engine.py`)
- Incident timeline → SQLite persistence: stores timeline (evidence: `backend/services/incident_timeline_engine.py`)
- PDF reporting → Incident timeline: includes timeline (evidence: `backend/services/report_manager.py`)
- PDF reporting → SQLite persistence: loads report data (evidence: `backend/services/report_manager.py`)
- Optional AI investigation → SQLite persistence: grounds analysis
- Malware scanning → SQLite persistence: analyzes case evidence
- Tool adapters → Investigator: reports configuration
