# akshitm755-byte/bitcoinforensics architecture

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

- Interactive diagram: https://gitdiagram.com/akshitm755-byte/bitcoinforensics
- Repository: https://github.com/akshitm755-byte/bitcoinforensics

## Overview

ABI is a blockchain AML investigation platform: it streams or loads transaction graphs, scores suspicious activity, and turns alerts into evidence-backed reports and PDF dossiers shown in an investigator dashboard. The graph preserves the documented Pub/Sub reporting path, OSINT/RAG and executive-summary capabilities, and the principal runtime layers. Some subsystem relationships come from README documentation because their source was not excerpted; uncertain links are omitted rather than inferred.

Main entry points: [`module3_reporting_agents/src/server.py`](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module3_reporting_agents/src/server.py) (Reporting Service), [`module4_runtime_ui/backend_api/main.py`](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module4_runtime_ui/backend_api/main.py) (Runtime API), [`module4_runtime_ui/frontend_ui/src/App.jsx`](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module4_runtime_ui/frontend_ui/src/App.jsx) (Dashboard App), [`module2_detection_gnn/src/server.py`](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module2_detection_gnn/src/server.py) (Scoring API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Data Ingestion"]
  node_stream["AMLSim Stream<br/>[amlsim_stream.py]"]
  node_elliptic["Elliptic++ Loader"]
  node_features["Feature Builder<br/>[features.py]"]
end

subgraph group_detection["Graph Detection"]
  node_detector_api["Scoring API<br/>[server.py]"]
  node_graph_store[("Incremental Graph<br/>[graph_store.py]")]
  node_gnn["Temporal GNN<br/>[torch_model.py]"]
end

subgraph group_reporting["Forensic Reporting"]
  node_pubsub["Alert Queue"]
  node_report_api["Reporting Service<br/>[server.py]"]
  node_evidence["Evidence Builder"]
  node_explainer["GNN Explainer<br/>[explainer.py]"]
  node_osint["OSINT Scraper<br/>[osint_scraper.py]"]
  node_retrieval["Case Retrieval<br/>[retrieval.py]"]
  node_orchestrator["Report Orchestrator<br/>[orchestrator.py]"]
  node_pdf["PDF Dossiers<br/>[pdf_exporter.py]"]
  node_vault[("GCS Vault")]
end

subgraph group_experience["Investigator Experience"]
  node_runtime_api["Runtime API<br/>[main.py]"]
  node_app["Dashboard App<br/>[App.jsx]"]
  node_live_graph["Live Graph"]
  node_feature_insight["Feature Insights"]
  node_dossier_viewer["Dossier Viewer<br/>[DossierViewer.jsx]"]
end

subgraph group_shared["Shared Contracts"]
  node_contracts["Domain Schemas<br/>[schemas.py]"]
end

node_investigator(("Investigator"))
node_gemini{{"Gemini Service"}}

node_investigator -->|"uses"| node_app
node_app -->|"requests API"| node_runtime_api
node_runtime_api -->|"advances stream"| node_stream
node_runtime_api -.->|"scores events"| node_detector_api
node_stream -->|"emits events"| node_contracts
node_elliptic -->|"builds features"| node_features
node_graph_store -->|"computes features"| node_features
node_detector_api -->|"updates graph"| node_graph_store
node_detector_api -->|"scores subgraph"| node_gnn
node_runtime_api -->|"publishes alerts"| node_pubsub
node_pubsub -->|"pushes alert"| node_report_api
node_report_api -->|"builds evidence"| node_evidence
node_evidence -->|"uses explanations"| node_explainer
node_evidence -->|"fetches precedents"| node_osint
node_report_api -->|"generates report"| node_orchestrator
node_report_api -->|"exports dossier"| node_pdf
node_orchestrator -->|"drafts claims"| node_gemini
node_report_api -->|"persists reports"| node_vault
node_pdf -->|"persists dossiers"| node_vault
node_runtime_api -->|"reads reports"| node_vault
node_app -->|"renders graph"| node_live_graph
node_app -->|"renders dossier"| node_dossier_viewer
node_live_graph -->|"renders insights"| node_feature_insight

click node_contracts "https://github.com/akshitm755-byte/bitcoinforensics/blob/main/contracts/schemas.py"
click node_stream "https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module1_data_pipeline/src/amlsim_stream.py"
click node_elliptic "https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module1_data_pipeline/src/elliptic_gcs_loader.py"
click node_features "https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module1_data_pipeline/src/features.py"
click node_detector_api "https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module2_detection_gnn/src/server.py"
click node_graph_store "https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module2_detection_gnn/src/graph_store.py"
click node_gnn "https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module2_detection_gnn/src/torch_model.py"
click node_runtime_api "https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module4_runtime_ui/backend_api/main.py"
click node_report_api "https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module3_reporting_agents/src/server.py"
click node_evidence "https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module3_reporting_agents/src/evidence_builder.py"
click node_explainer "https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module3_reporting_agents/src/explainer.py"
click node_osint "https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module3_reporting_agents/src/osint_scraper.py"
click node_retrieval "https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module3_reporting_agents/src/retrieval.py"
click node_orchestrator "https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module3_reporting_agents/src/orchestrator.py"
click node_pdf "https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module3_reporting_agents/src/pdf_exporter.py"
click node_app "https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module4_runtime_ui/frontend_ui/src/App.jsx"
click node_live_graph "https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module4_runtime_ui/frontend_ui/src/components/LiveExpandingGraph.jsx"
click node_feature_insight "https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module4_runtime_ui/frontend_ui/src/components/FeatureInsightWindow.jsx"
click node_dossier_viewer "https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module4_runtime_ui/frontend_ui/src/components/DossierViewer.jsx"

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_stream,node_elliptic,node_features toneBlue
class node_detector_api,node_graph_store,node_gnn toneAmber
class node_pubsub,node_report_api,node_evidence,node_explainer,node_osint,node_retrieval,node_orchestrator,node_pdf,node_vault toneMint
class node_runtime_api,node_app,node_live_graph,node_feature_insight,node_dossier_viewer toneRose
class node_contracts,node_investigator,node_gemini toneIndigo
```

## Components

### Data Ingestion

- [AMLSim Stream](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module1_data_pipeline/src/amlsim_stream.py): `module1_data_pipeline/src/amlsim_stream.py`
- [Elliptic++ Loader](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module1_data_pipeline/src/elliptic_gcs_loader.py): `module1_data_pipeline/src/elliptic_gcs_loader.py`
- [Feature Builder](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module1_data_pipeline/src/features.py): `module1_data_pipeline/src/features.py`

### Graph Detection

- [Scoring API](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module2_detection_gnn/src/server.py): `module2_detection_gnn/src/server.py`
- [Incremental Graph](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module2_detection_gnn/src/graph_store.py): `module2_detection_gnn/src/graph_store.py`
- [Temporal GNN](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module2_detection_gnn/src/torch_model.py): `module2_detection_gnn/src/torch_model.py`

### Forensic Reporting

- **Alert Queue**
- [Reporting Service](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module3_reporting_agents/src/server.py): `module3_reporting_agents/src/server.py`
- [Evidence Builder](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module3_reporting_agents/src/evidence_builder.py): `module3_reporting_agents/src/evidence_builder.py`
- [GNN Explainer](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module3_reporting_agents/src/explainer.py): `module3_reporting_agents/src/explainer.py`
- [OSINT Scraper](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module3_reporting_agents/src/osint_scraper.py): `module3_reporting_agents/src/osint_scraper.py`
- [Case Retrieval](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module3_reporting_agents/src/retrieval.py): `module3_reporting_agents/src/retrieval.py`
- [Report Orchestrator](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module3_reporting_agents/src/orchestrator.py): `module3_reporting_agents/src/orchestrator.py`
- [PDF Dossiers](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module3_reporting_agents/src/pdf_exporter.py): `module3_reporting_agents/src/pdf_exporter.py`
- **GCS Vault**

### Investigator Experience

- [Runtime API](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module4_runtime_ui/backend_api/main.py): `module4_runtime_ui/backend_api/main.py`
- [Dashboard App](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module4_runtime_ui/frontend_ui/src/App.jsx): `module4_runtime_ui/frontend_ui/src/App.jsx`
- [Live Graph](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module4_runtime_ui/frontend_ui/src/components/LiveExpandingGraph.jsx): `module4_runtime_ui/frontend_ui/src/components/LiveExpandingGraph.jsx`
- [Feature Insights](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module4_runtime_ui/frontend_ui/src/components/FeatureInsightWindow.jsx): `module4_runtime_ui/frontend_ui/src/components/FeatureInsightWindow.jsx`
- [Dossier Viewer](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/module4_runtime_ui/frontend_ui/src/components/DossierViewer.jsx): `module4_runtime_ui/frontend_ui/src/components/DossierViewer.jsx`

### Shared Contracts

- [Domain Schemas](https://github.com/akshitm755-byte/bitcoinforensics/blob/main/contracts/schemas.py): `contracts/schemas.py`

### Other components

- **Investigator**
- **Gemini Service**

## Connections

- Investigator → Dashboard App: uses (evidence: `README.md`)
- Dashboard App → Runtime API: requests API (evidence: `module4_runtime_ui/frontend_ui/src/App.jsx`)
- Runtime API → AMLSim Stream: advances stream (evidence: `module4_runtime_ui/backend_api/main.py`)
- Runtime API → Scoring API: scores events
- AMLSim Stream → Domain Schemas: emits events (evidence: `module1_data_pipeline/src/amlsim_stream.py`)
- Elliptic++ Loader → Feature Builder: builds features (evidence: `module1_data_pipeline/src/elliptic_gcs_loader.py`)
- Incremental Graph → Feature Builder: computes features (evidence: `module2_detection_gnn/src/graph_store.py`)
- Scoring API → Incremental Graph: updates graph (evidence: `module2_detection_gnn/src/server.py`)
- Scoring API → Temporal GNN: scores subgraph (evidence: `module2_detection_gnn/src/server.py`)
- Runtime API → Alert Queue: publishes alerts (evidence: `README.md`)
- Alert Queue → Reporting Service: pushes alert (evidence: `README.md`)
- Reporting Service → Evidence Builder: builds evidence (evidence: `module3_reporting_agents/src/server.py`)
- Evidence Builder → GNN Explainer: uses explanations (evidence: `module3_reporting_agents/src/evidence_builder.py`)
- Evidence Builder → OSINT Scraper: fetches precedents (evidence: `module3_reporting_agents/src/evidence_builder.py`)
- Reporting Service → Report Orchestrator: generates report (evidence: `module3_reporting_agents/src/server.py`)
- Reporting Service → PDF Dossiers: exports dossier (evidence: `module3_reporting_agents/src/server.py`)
- Report Orchestrator → Gemini Service: drafts claims (evidence: `README.md`)
- Reporting Service → GCS Vault: persists reports (evidence: `README.md`)
- PDF Dossiers → GCS Vault: persists dossiers (evidence: `README.md`)
- Runtime API → GCS Vault: reads reports (evidence: `module4_runtime_ui/backend_api/main.py`)
- Dashboard App → Live Graph: renders graph (evidence: `module4_runtime_ui/frontend_ui/src/App.jsx`)
- Dashboard App → Dossier Viewer: renders dossier (evidence: `module4_runtime_ui/frontend_ui/src/App.jsx`)
- Live Graph → Feature Insights: renders insights (evidence: `module4_runtime_ui/frontend_ui/src/components/LiveExpandingGraph.jsx`)
