# dhanush2006d/tor-traffic-correlation-analysis-system architecture

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

- Interactive diagram: https://gitdiagram.com/dhanush2006d/tor-traffic-correlation-analysis-system
- Repository: https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system

## Overview

This is a TOR traffic correlation and digital-forensics application. Analysts generate demo traffic or upload PCAP data, inspect sessions and nodes, run probabilistic correlation, enrich cases with OSINT/threat intelligence, and review or export reports. The frontend calls a FastAPI backend; backend routers orchestrate analysis services and persist records in SQLite. The graph preserves the major UI and backend capabilities documented by the source index. Some subsystem links are omitted where unsampled code does not establish the relationship.

Main entry points: [`frontend/src/services/api.js`](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/frontend/src/services/api.js) (API client), [`backend/main.py`](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/main.py) (FastAPI application), [`frontend/src/App.jsx`](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/frontend/src/App.jsx) (Application routes), [`backend/database.py`](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/database.py) (Forensics database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Analyst interface"]
  node_app["Application routes<br/>[App.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_nodes_ui["TOR nodes view<br/>[Nodes.jsx]"]
  node_timeline["Session timeline<br/>[Timeline.jsx]"]
  node_analysis_ui["Analysis view<br/>[Analysis.jsx]"]
  node_case_ui["Case workspace<br/>[CaseWorkspace.jsx]"]
  node_osint_ui["OSINT workspace<br/>[OSINTWorkspace.jsx]"]
  node_reports_ui["Reports view<br/>[Reports.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["API orchestration"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_sessions["Session ingestion<br/>[sessions.py]"]
  node_node_routes["Node management<br/>[nodes.py]"]
  node_analysis_routes["Analysis endpoint<br/>[analysis.py]"]
  node_osint_routes["OSINT endpoint<br/>[osint.py]"]
  node_threat_routes["Threat intelligence<br/>[threat_intel.py]"]
  node_report_routes["Report endpoint<br/>[reports.py]"]
  node_stats_routes["Statistics endpoint<br/>[stats.py]"]
end

subgraph group_analysis["Forensic services"]
  node_pcap["PCAP analyzer<br/>[pcap_analyzer.py]"]
  node_demo["Demo traffic simulator<br/>[tor_simulator.py]"]
  node_correlation["Correlation engine"]
  node_assistant["Analyst AI<br/>[ai_assistant.py]"]
  node_osint_engine["OSINT analyzer<br/>[osint_engine.py]"]
  node_osint_scanner["Indicator scanner<br/>[osint_scanner.py]"]
  node_report_gen["Report generator"]
end

subgraph group_data["Case data"]
  node_database[("Forensics database<br/>[database.py]")]
  node_schemas["Domain schemas<br/>[schemas.py]"]
end

node_analyst(("Analyst"))

node_analyst -->|"uses"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_nodes_ui
node_app -->|"routes to"| node_timeline
node_app -->|"routes to"| node_analysis_ui
node_app -->|"routes to"| node_case_ui
node_app -->|"routes to"| node_osint_ui
node_app -->|"routes to"| node_reports_ui
node_dashboard -->|"requests data"| node_api_client
node_nodes_ui -->|"requests nodes"| node_api_client
node_timeline -->|"requests sessions"| node_api_client
node_analysis_ui -->|"uploads and analyzes"| node_api_client
node_case_ui -->|"requests case data"| node_api_client
node_osint_ui -->|"requests scans"| node_api_client
node_reports_ui -->|"requests reports"| node_api_client
node_api_client -->|"calls session API"| node_sessions
node_api_client -->|"calls analysis API"| node_analysis_routes
node_api_client -->|"calls node API"| node_node_routes
node_api_client -->|"calls OSINT API"| node_osint_routes
node_api_client -->|"calls intel API"| node_threat_routes
node_api_client -->|"calls reports API"| node_report_routes
node_api_client -->|"calls stats API"| node_stats_routes
node_api_app -->|"registers router"| node_sessions
node_api_app -->|"registers router"| node_node_routes
node_api_app -->|"registers router"| node_analysis_routes
node_api_app -->|"registers router"| node_osint_routes
node_api_app -->|"registers router"| node_threat_routes
node_api_app -->|"registers router"| node_report_routes
node_api_app -->|"registers router"| node_stats_routes
node_sessions -->|"analyzes uploads"| node_pcap
node_sessions -->|"generates demo traffic"| node_demo
node_sessions -->|"stores sessions and packets"| node_database
node_node_routes -->|"generates nodes"| node_demo
node_node_routes -->|"reads and writes nodes"| node_database
node_node_routes -->|"uses models"| node_schemas
node_analysis_routes -->|"calculates correlation"| node_correlation
node_analysis_routes -->|"generates narrative"| node_assistant
node_analysis_routes -->|"loads and saves analysis"| node_database
node_osint_routes -->|"analyzes indicators"| node_osint_engine
node_threat_routes -->|"scans indicators"| node_osint_scanner
node_threat_routes -->|"stores intel"| node_database
node_report_routes -->|"generates reports"| node_report_gen
node_report_routes -->|"reads and writes reports"| node_database
node_stats_routes -->|"queries statistics"| node_database
node_api_app -->|"initializes store"| node_database

click node_app "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/frontend/src/App.jsx"
click node_dashboard "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/frontend/src/pages/Dashboard.jsx"
click node_nodes_ui "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/frontend/src/pages/Nodes.jsx"
click node_timeline "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/frontend/src/pages/Timeline.jsx"
click node_analysis_ui "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/frontend/src/pages/Analysis.jsx"
click node_case_ui "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/frontend/src/pages/CaseWorkspace.jsx"
click node_osint_ui "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/frontend/src/components/osint/OSINTWorkspace.jsx"
click node_reports_ui "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/frontend/src/pages/Reports.jsx"
click node_api_client "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/frontend/src/services/api.js"
click node_api_app "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/main.py"
click node_sessions "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/routers/sessions.py"
click node_node_routes "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/routers/nodes.py"
click node_analysis_routes "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/routers/analysis.py"
click node_osint_routes "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/routers/osint.py"
click node_threat_routes "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/routers/threat_intel.py"
click node_report_routes "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/routers/reports.py"
click node_stats_routes "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/routers/stats.py"
click node_pcap "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/services/pcap_analyzer.py"
click node_demo "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/services/tor_simulator.py"
click node_correlation "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/services/correlation_engine.py"
click node_assistant "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/services/ai_assistant.py"
click node_osint_engine "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/services/osint_engine.py"
click node_osint_scanner "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/services/osint_scanner.py"
click node_report_gen "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/services/report_generator.py"
click node_database "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/database.py"
click node_schemas "https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/models/schemas.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_app,node_dashboard,node_nodes_ui,node_timeline,node_analysis_ui,node_case_ui,node_osint_ui,node_reports_ui,node_api_client toneBlue
class node_api_app,node_sessions,node_node_routes,node_analysis_routes,node_osint_routes,node_threat_routes,node_report_routes,node_stats_routes toneAmber
class node_pcap,node_demo,node_correlation,node_assistant,node_osint_engine,node_osint_scanner,node_report_gen toneMint
class node_database,node_schemas toneRose
class node_analyst toneIndigo
```

## Components

### Analyst interface

- [Application routes](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Dashboard](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [TOR nodes view](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/frontend/src/pages/Nodes.jsx): `frontend/src/pages/Nodes.jsx`
- [Session timeline](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/frontend/src/pages/Timeline.jsx): `frontend/src/pages/Timeline.jsx`
- [Analysis view](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/frontend/src/pages/Analysis.jsx): `frontend/src/pages/Analysis.jsx`
- [Case workspace](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/frontend/src/pages/CaseWorkspace.jsx): `frontend/src/pages/CaseWorkspace.jsx`
- [OSINT workspace](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/frontend/src/components/osint/OSINTWorkspace.jsx): `frontend/src/components/osint/OSINTWorkspace.jsx`
- [Reports view](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/frontend/src/pages/Reports.jsx): `frontend/src/pages/Reports.jsx`
- [API client](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### API orchestration

- [FastAPI application](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/main.py): `backend/main.py`
- [Session ingestion](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/routers/sessions.py): `backend/routers/sessions.py`
- [Node management](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/routers/nodes.py): `backend/routers/nodes.py`
- [Analysis endpoint](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/routers/analysis.py): `backend/routers/analysis.py`
- [OSINT endpoint](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/routers/osint.py): `backend/routers/osint.py`
- [Threat intelligence](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/routers/threat_intel.py): `backend/routers/threat_intel.py`
- [Report endpoint](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/routers/reports.py): `backend/routers/reports.py`
- [Statistics endpoint](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/routers/stats.py): `backend/routers/stats.py`

### Forensic services

- [PCAP analyzer](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/services/pcap_analyzer.py): `backend/services/pcap_analyzer.py`
- [Demo traffic simulator](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/services/tor_simulator.py): `backend/services/tor_simulator.py`
- [Correlation engine](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/services/correlation_engine.py): `backend/services/correlation_engine.py`
- [Analyst AI](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/services/ai_assistant.py): `backend/services/ai_assistant.py`
- [OSINT analyzer](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/services/osint_engine.py): `backend/services/osint_engine.py`
- [Indicator scanner](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/services/osint_scanner.py): `backend/services/osint_scanner.py`
- [Report generator](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/services/report_generator.py): `backend/services/report_generator.py`

### Case data

- [Forensics database](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/database.py): `backend/database.py`
- [Domain schemas](https://github.com/dhanush2006d/tor-traffic-correlation-analysis-system/blob/main/backend/models/schemas.py): `backend/models/schemas.py`

### Other components

- **Analyst**

## Connections

- Analyst → Application routes: uses (evidence: `frontend/src/App.jsx`)
- Application routes → Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → TOR nodes view: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Session timeline: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Analysis view: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Case workspace: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → OSINT workspace: routes to (evidence: `frontend/src/App.jsx`)
- Application routes → Reports view: routes to (evidence: `frontend/src/App.jsx`)
- Dashboard → API client: requests data (evidence: `frontend/src/pages/Dashboard.jsx`)
- TOR nodes view → API client: requests nodes (evidence: `frontend/src/pages/Nodes.jsx`)
- Session timeline → API client: requests sessions (evidence: `frontend/src/pages/Timeline.jsx`)
- Analysis view → API client: uploads and analyzes (evidence: `frontend/src/pages/Analysis.jsx`)
- Case workspace → API client: requests case data (evidence: `frontend/src/pages/CaseWorkspace.jsx`)
- OSINT workspace → API client: requests scans (evidence: `frontend/src/components/osint/OSINTWorkspace.jsx`)
- Reports view → API client: requests reports (evidence: `frontend/src/pages/Reports.jsx`)
- API client → Session ingestion: calls session API (evidence: `frontend/src/services/api.js`)
- API client → Analysis endpoint: calls analysis API (evidence: `frontend/src/services/api.js`)
- API client → Node management: calls node API (evidence: `frontend/src/services/api.js`)
- API client → OSINT endpoint: calls OSINT API (evidence: `frontend/src/services/api.js`)
- API client → Threat intelligence: calls intel API (evidence: `frontend/src/services/api.js`)
- API client → Report endpoint: calls reports API (evidence: `frontend/src/services/api.js`)
- API client → Statistics endpoint: calls stats API (evidence: `frontend/src/services/api.js`)
- FastAPI application → Session ingestion: registers router (evidence: `backend/main.py`)
- FastAPI application → Node management: registers router (evidence: `backend/main.py`)
- FastAPI application → Analysis endpoint: registers router (evidence: `backend/main.py`)
- FastAPI application → OSINT endpoint: registers router (evidence: `backend/main.py`)
- FastAPI application → Threat intelligence: registers router (evidence: `backend/main.py`)
- FastAPI application → Report endpoint: registers router (evidence: `backend/main.py`)
- FastAPI application → Statistics endpoint: registers router (evidence: `backend/main.py`)
- Session ingestion → PCAP analyzer: analyzes uploads (evidence: `backend/routers/sessions.py`)
- Session ingestion → Demo traffic simulator: generates demo traffic (evidence: `backend/routers/sessions.py`)
- Session ingestion → Forensics database: stores sessions and packets (evidence: `backend/routers/sessions.py`)
- Node management → Demo traffic simulator: generates nodes (evidence: `backend/routers/nodes.py`)
- Node management → Forensics database: reads and writes nodes (evidence: `backend/routers/nodes.py`)
- Node management → Domain schemas: uses models (evidence: `backend/routers/nodes.py`)
- Analysis endpoint → Correlation engine: calculates correlation (evidence: `backend/routers/analysis.py`)
- Analysis endpoint → Analyst AI: generates narrative (evidence: `backend/routers/analysis.py`)
- Analysis endpoint → Forensics database: loads and saves analysis (evidence: `backend/routers/analysis.py`)
- OSINT endpoint → OSINT analyzer: analyzes indicators (evidence: `backend/routers/osint.py`)
- Threat intelligence → Indicator scanner: scans indicators (evidence: `backend/routers/threat_intel.py`)
- Threat intelligence → Forensics database: stores intel (evidence: `backend/routers/threat_intel.py`)
- Report endpoint → Report generator: generates reports (evidence: `backend/routers/reports.py`)
- Report endpoint → Forensics database: reads and writes reports (evidence: `backend/routers/reports.py`)
- Statistics endpoint → Forensics database: queries statistics (evidence: `backend/routers/stats.py`)
- FastAPI application → Forensics database: initializes store (evidence: `backend/main.py`)
