# sushmi12307/ai-powered-criminal-network-analysis-system architecture

> Architecture diagram of the GitHub repository sushmi12307/ai-powered-criminal-network-analysis-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sushmi12307/ai-powered-criminal-network-analysis-system
- Repository: https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system

## Overview

This is a forensic criminal-network analysis console. Investigators upload CDR, bank, or FIR evidence; the backend hashes and parses it into POLE entities held in memory, then exposes graph, timeline, path, XAI, and investigation-chat capabilities through REST APIs for frontend exploration. The graph preserves those distinct stages and the dashboard, stratified visualization, integrity, audit, and triage branches. Some links rely on README descriptions or SOURCE INDEX references; unsampled implementation details are not inferred.

Main entry points: [`frontend/src/App.jsx`](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/App.jsx) (Workspace), [`frontend/src/store/useStore.js`](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/store/useStore.js) (UI State), [`backend/src/database/store.js`](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/database/store.js) (POLE & Audit Store), [`frontend/src/api/api.js`](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/api/api.js) (REST Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Investigation Console"]
  node_app_ui["Workspace<br/>[App.jsx]"]
  node_dashboard["Dashboard &amp; Triage<br/>[Dashboard.jsx]"]
  node_graph_view["Network Canvas<br/>[GraphCanvas.jsx]"]
  node_strata["POLE Strata"]
  node_entity_card["Entity Inspection<br/>[POLEEntityCard.jsx]"]
  node_timeline["Timeline View<br/>[TimelineView.jsx]"]
  node_upload_ui["Evidence Upload<br/>[UploadPanel.jsx]"]
  node_chat_ui["Investigation Chat"]
  node_xai_ui["XAI Evidence Modal<br/>[XaiModal.jsx]"]
  node_integrity_badge["Integrity Badge<br/>[IntegrityBadge.jsx]"]
  node_sidebar["Navigation<br/>[Sidebar.jsx]"]
end

subgraph group_api["Backend API"]
  node_api_client["REST Client<br/>[api.js]"]
  node_express["Express Application<br/>[app.js]"]
  node_graph_routes["Graph &amp; Entity API<br/>[graphRoutes.js]"]
  node_upload_routes["Upload &amp; Audit API<br/>[uploadRoutes.js]"]
  node_xai_routes["XAI API<br/>[xaiRoutes.js]"]
  node_chat_routes["Chat API<br/>[chatRoutes.js]"]
end

subgraph group_analysis["Evidence Analysis"]
  node_pole_parser["POLE Parser<br/>[poleParser.js]"]
  node_crypto_vault["Integrity Vault<br/>[cryptoVault.js]"]
  node_xai_engine["Risk Reasoning<br/>[xaiEngine.js]"]
  node_graph_analytics["Graph Analytics<br/>[graphAnalytics.js]"]
  node_memory_store[("POLE &amp; Audit Store<br/>[store.js]")]
end

subgraph group_state["Investigation State"]
  node_store_ui["UI State<br/>[useStore.js]"]
  node_normalizer["POLE Normalizer<br/>[poleNormalizer.js]"]
  node_crypto_ui["Hash Display Helper<br/>[cryptoUtils.js]"]
end

node_investigator(("Investigator"))

node_investigator -->|"uses"| node_app_ui
node_app_ui -->|"renders"| node_dashboard
node_app_ui -->|"renders"| node_graph_view
node_app_ui -->|"renders"| node_strata
node_app_ui -->|"renders"| node_entity_card
node_app_ui -->|"renders"| node_timeline
node_app_ui -->|"renders"| node_upload_ui
node_app_ui -->|"renders"| node_chat_ui
node_app_ui -->|"renders"| node_xai_ui
node_app_ui -->|"renders"| node_sidebar
node_dashboard -->|"reads"| node_store_ui
node_graph_view -->|"reads"| node_store_ui
node_strata -->|"reads"| node_store_ui
node_entity_card -->|"reads"| node_store_ui
node_timeline -->|"reads"| node_store_ui
node_upload_ui -->|"updates"| node_store_ui
node_chat_ui -->|"updates"| node_store_ui
node_xai_ui -->|"reads"| node_store_ui
node_integrity_badge -->|"formats hash"| node_crypto_ui
node_upload_ui -->|"renders"| node_integrity_badge
node_entity_card -->|"renders"| node_integrity_badge
node_xai_ui -->|"formats entities"| node_normalizer
node_store_ui -->|"calls"| node_api_client
node_api_client -->|"requests graph"| node_graph_routes
node_api_client -->|"uploads evidence"| node_upload_routes
node_api_client -->|"requests reasons"| node_xai_routes
node_api_client -->|"submits queries"| node_chat_routes
node_express -->|"mounts"| node_graph_routes
node_express -->|"mounts"| node_upload_routes
node_express -->|"mounts"| node_xai_routes
node_express -->|"mounts"| node_chat_routes
node_upload_routes -->|"registers files"| node_crypto_vault
node_upload_routes -->|"parses files"| node_pole_parser
node_upload_routes -->|"reads audit log"| node_memory_store
node_graph_routes -->|"reads graph"| node_memory_store
node_graph_routes -->|"computes metrics"| node_graph_analytics
node_xai_routes -->|"generates cards"| node_xai_engine
node_xai_routes -->|"reads graph"| node_memory_store
node_chat_routes -->|"uses query analysis"| node_xai_engine
node_chat_routes -->|"uses chat state"| node_memory_store
node_pole_parser -->|"stores entities"| node_memory_store
node_crypto_vault -->|"records ledger"| node_memory_store
node_graph_analytics -->|"reads graph"| node_memory_store
node_xai_engine -->|"reads graph"| node_memory_store

click node_app_ui "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/App.jsx"
click node_dashboard "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/components/Dashboard.jsx"
click node_graph_view "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/components/GraphCanvas.jsx"
click node_strata "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/components/StratifiedGraph.jsx"
click node_entity_card "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/components/POLEEntityCard.jsx"
click node_timeline "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/components/TimelineView.jsx"
click node_upload_ui "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/components/UploadPanel.jsx"
click node_chat_ui "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/components/InvestigationChat.jsx"
click node_xai_ui "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/components/XaiModal.jsx"
click node_integrity_badge "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/components/IntegrityBadge.jsx"
click node_sidebar "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/components/layout/Sidebar.jsx"
click node_store_ui "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/store/useStore.js"
click node_normalizer "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/utils/poleNormalizer.js"
click node_crypto_ui "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/utils/cryptoUtils.js"
click node_api_client "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/api/api.js"
click node_express "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/app.js"
click node_graph_routes "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/routes/graphRoutes.js"
click node_upload_routes "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/routes/uploadRoutes.js"
click node_xai_routes "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/routes/xaiRoutes.js"
click node_chat_routes "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/routes/chatRoutes.js"
click node_pole_parser "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/services/poleParser.js"
click node_crypto_vault "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/services/cryptoVault.js"
click node_xai_engine "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/services/xaiEngine.js"
click node_graph_analytics "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/services/graphAnalytics.js"
click node_memory_store "https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/database/store.js"

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_ui,node_dashboard,node_graph_view,node_strata,node_entity_card,node_timeline,node_upload_ui,node_chat_ui,node_xai_ui,node_integrity_badge,node_sidebar toneBlue
class node_api_client,node_express,node_graph_routes,node_upload_routes,node_xai_routes,node_chat_routes toneAmber
class node_pole_parser,node_crypto_vault,node_xai_engine,node_graph_analytics,node_memory_store toneMint
class node_store_ui,node_normalizer,node_crypto_ui toneRose
class node_investigator toneIndigo
```

## Components

### Investigation Console

- [Workspace](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Dashboard & Triage](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/components/Dashboard.jsx): `frontend/src/components/Dashboard.jsx`
- [Network Canvas](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/components/GraphCanvas.jsx): `frontend/src/components/GraphCanvas.jsx`
- [POLE Strata](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/components/StratifiedGraph.jsx): `frontend/src/components/StratifiedGraph.jsx`
- [Entity Inspection](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/components/POLEEntityCard.jsx): `frontend/src/components/POLEEntityCard.jsx`
- [Timeline View](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/components/TimelineView.jsx): `frontend/src/components/TimelineView.jsx`
- [Evidence Upload](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/components/UploadPanel.jsx): `frontend/src/components/UploadPanel.jsx`
- [Investigation Chat](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/components/InvestigationChat.jsx): `frontend/src/components/InvestigationChat.jsx`
- [XAI Evidence Modal](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/components/XaiModal.jsx): `frontend/src/components/XaiModal.jsx`
- [Integrity Badge](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/components/IntegrityBadge.jsx): `frontend/src/components/IntegrityBadge.jsx`
- [Navigation](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/components/layout/Sidebar.jsx): `frontend/src/components/layout/Sidebar.jsx`

### Backend API

- [REST Client](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/api/api.js): `frontend/src/api/api.js`
- [Express Application](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/app.js): `backend/src/app.js`
- [Graph & Entity API](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/routes/graphRoutes.js): `backend/src/routes/graphRoutes.js`
- [Upload & Audit API](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/routes/uploadRoutes.js): `backend/src/routes/uploadRoutes.js`
- [XAI API](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/routes/xaiRoutes.js): `backend/src/routes/xaiRoutes.js`
- [Chat API](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/routes/chatRoutes.js): `backend/src/routes/chatRoutes.js`

### Evidence Analysis

- [POLE Parser](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/services/poleParser.js): `backend/src/services/poleParser.js`
- [Integrity Vault](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/services/cryptoVault.js): `backend/src/services/cryptoVault.js`
- [Risk Reasoning](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/services/xaiEngine.js): `backend/src/services/xaiEngine.js`
- [Graph Analytics](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/services/graphAnalytics.js): `backend/src/services/graphAnalytics.js`
- [POLE & Audit Store](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/backend/src/database/store.js): `backend/src/database/store.js`

### Investigation State

- [UI State](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/store/useStore.js): `frontend/src/store/useStore.js`
- [POLE Normalizer](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/utils/poleNormalizer.js): `frontend/src/utils/poleNormalizer.js`
- [Hash Display Helper](https://github.com/sushmi12307/ai-powered-criminal-network-analysis-system/blob/main/frontend/src/utils/cryptoUtils.js): `frontend/src/utils/cryptoUtils.js`

### Other components

- **Investigator**

## Connections

- Investigator → Workspace: uses (evidence: `README.md`)
- Workspace → Dashboard & Triage: renders (evidence: `frontend/src/App.jsx`)
- Workspace → Network Canvas: renders (evidence: `frontend/src/App.jsx`)
- Workspace → POLE Strata: renders (evidence: `frontend/src/App.jsx`)
- Workspace → Entity Inspection: renders (evidence: `frontend/src/App.jsx`)
- Workspace → Timeline View: renders (evidence: `frontend/src/App.jsx`)
- Workspace → Evidence Upload: renders (evidence: `frontend/src/App.jsx`)
- Workspace → Investigation Chat: renders (evidence: `frontend/src/App.jsx`)
- Workspace → XAI Evidence Modal: renders (evidence: `frontend/src/App.jsx`)
- Workspace → Navigation: renders (evidence: `frontend/src/App.jsx`)
- Dashboard & Triage → UI State: reads (evidence: `frontend/src/components/Dashboard.jsx`)
- Network Canvas → UI State: reads (evidence: `frontend/src/components/GraphCanvas.jsx`)
- POLE Strata → UI State: reads (evidence: `frontend/src/components/StratifiedGraph.jsx`)
- Entity Inspection → UI State: reads (evidence: `frontend/src/components/POLEEntityCard.jsx`)
- Timeline View → UI State: reads (evidence: `frontend/src/components/TimelineView.jsx`)
- Evidence Upload → UI State: updates (evidence: `frontend/src/components/UploadPanel.jsx`)
- Investigation Chat → UI State: updates (evidence: `frontend/src/components/InvestigationChat.jsx`)
- XAI Evidence Modal → UI State: reads (evidence: `frontend/src/components/XaiModal.jsx`)
- Integrity Badge → Hash Display Helper: formats hash (evidence: `frontend/src/components/IntegrityBadge.jsx`)
- Evidence Upload → Integrity Badge: renders (evidence: `frontend/src/components/UploadPanel.jsx`)
- Entity Inspection → Integrity Badge: renders (evidence: `frontend/src/components/POLEEntityCard.jsx`)
- XAI Evidence Modal → POLE Normalizer: formats entities (evidence: `frontend/src/components/XaiModal.jsx`)
- UI State → REST Client: calls (evidence: `frontend/src/store/useStore.js`)
- REST Client → Graph & Entity API: requests graph (evidence: `frontend/src/api/api.js`)
- REST Client → Upload & Audit API: uploads evidence (evidence: `frontend/src/api/api.js`)
- REST Client → XAI API: requests reasons (evidence: `frontend/src/api/api.js`)
- REST Client → Chat API: submits queries (evidence: `frontend/src/api/api.js`)
- Express Application → Graph & Entity API: mounts (evidence: `backend/src/app.js`)
- Express Application → Upload & Audit API: mounts (evidence: `backend/src/app.js`)
- Express Application → XAI API: mounts (evidence: `backend/src/app.js`)
- Express Application → Chat API: mounts (evidence: `backend/src/app.js`)
- Upload & Audit API → Integrity Vault: registers files (evidence: `backend/src/routes/uploadRoutes.js`)
- Upload & Audit API → POLE Parser: parses files (evidence: `backend/src/routes/uploadRoutes.js`)
- Upload & Audit API → POLE & Audit Store: reads audit log (evidence: `backend/src/routes/uploadRoutes.js`)
- Graph & Entity API → POLE & Audit Store: reads graph (evidence: `backend/src/routes/graphRoutes.js`)
- Graph & Entity API → Graph Analytics: computes metrics (evidence: `backend/src/routes/graphRoutes.js`)
- XAI API → Risk Reasoning: generates cards (evidence: `backend/src/routes/xaiRoutes.js`)
- XAI API → POLE & Audit Store: reads graph (evidence: `backend/src/routes/xaiRoutes.js`)
- Chat API → Risk Reasoning: uses query analysis (evidence: `backend/src/routes/chatRoutes.js`)
- Chat API → POLE & Audit Store: uses chat state (evidence: `backend/src/routes/chatRoutes.js`)
- POLE Parser → POLE & Audit Store: stores entities (evidence: `backend/src/services/poleParser.js`)
- Integrity Vault → POLE & Audit Store: records ledger (evidence: `backend/src/services/cryptoVault.js`)
- Graph Analytics → POLE & Audit Store: reads graph (evidence: `backend/src/services/graphAnalytics.js`)
- Risk Reasoning → POLE & Audit Store: reads graph (evidence: `backend/src/services/xaiEngine.js`)
