# heaven-swastik/cyberflow_sih architecture

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

- Interactive diagram: https://gitdiagram.com/heaven-swastik/cyberflow_sih
- Repository: https://github.com/heaven-swastik/cyberflow_sih

## Overview

CyberFlow is a cyber-financial crime intelligence and intervention platform. Investigators and complainants use the React command center to submit or review a case; the backend routes complaint intake into the AI pipeline, which validates transactions, builds a relationship graph, engineers features, predicts fraud state/action/risk and cashout zones, ranks candidate ATMs, and produces explainable alerts with a tamper-evident hash trail. The UI presents cases through graph, map, evidence, and action views. Pipeline stages follow the README and sampled orchestration; unsampled integration details are not inferred.

Main entry points: [`ai-engine/pipeline.py`](https://github.com/heaven-swastik/cyberflow_sih/blob/main/ai-engine/pipeline.py) (Case Pipeline), [`frontend/src/api/index.js`](https://github.com/heaven-swastik/cyberflow_sih/blob/main/frontend/src/api/index.js) (API Client), [`backend/server.js`](https://github.com/heaven-swastik/cyberflow_sih/blob/main/backend/server.js) (Express API), [`frontend/src/components/ComplaintPortal.jsx`](https://github.com/heaven-swastik/cyberflow_sih/blob/main/frontend/src/components/ComplaintPortal.jsx) (Complaint Portal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Command Center"]
  node_portal["Complaint Portal"]
  node_app["Command Center<br/>[App.jsx]"]
  node_case_views["Case Views<br/>[CorrelateStep.jsx]"]
  node_map_view["Threat Heatmap<br/>[MacroHeatmap.jsx]"]
  node_action_view["Intervention View<br/>[ActionStep.jsx]"]
  node_auth["Authentication<br/>[AuthContext.jsx]"]
  node_api_client["API Client<br/>[index.js]"]
end

subgraph group_service["API Service"]
  node_backend["Express API<br/>[server.js]"]
end

subgraph group_analysis["Case Analysis"]
  node_complaint_intake["Complaint Intake"]
  node_pipeline["Case Pipeline<br/>[pipeline.py]"]
  node_validator["Data Validation<br/>[data_validator.py]"]
  node_graph_builder["Transaction Graph<br/>[graph_builder.py]"]
  node_feature_engineer["Feature Engineering"]
end

subgraph group_intelligence["Predictions &amp; Response"]
  node_classifier["ML Classifiers<br/>[classifier.py]"]
  node_path_predictor["Path Prediction<br/>[path_predictor.py]"]
  node_atm_engine["ATM Ranking<br/>[atm_engine.py]"]
  node_blockchain["Alert Hash Trail<br/>[blockchain.py]"]
end

node_complainant(("Complainant"))
node_investigator(("Investigator"))
node_bank{{"Bank Operations"}}
node_law_enforcement{{"LEA Dispatch"}}

node_complainant -->|"files complaint"| node_portal
node_portal -->|"submits intake"| node_api_client
node_investigator -->|"reviews cases"| node_app
node_app -->|"requests case data"| node_api_client
node_auth -->|"authenticates"| node_backend
node_api_client -->|"calls API"| node_backend
node_backend -->|"runs intake"| node_complaint_intake
node_complaint_intake -->|"processes case"| node_pipeline
node_pipeline -->|"validates data"| node_validator
node_pipeline -->|"builds topology"| node_graph_builder
node_pipeline -->|"extracts features"| node_feature_engineer
node_pipeline -->|"predicts case"| node_classifier
node_pipeline -->|"predicts trajectory"| node_path_predictor
node_pipeline -->|"ranks ATMs"| node_atm_engine
node_pipeline -->|"hashes alerts"| node_blockchain
node_api_client -->|"supplies case data"| node_case_views
node_api_client -->|"supplies map data"| node_map_view
node_api_client -->|"supplies action data"| node_action_view
node_action_view -->|"requests alert"| node_api_client
node_backend -.->|"freeze requests"| node_bank
node_backend -.->|"dispatches intelligence"| node_law_enforcement

click node_portal "https://github.com/heaven-swastik/cyberflow_sih/blob/main/frontend/src/components/ComplaintPortal.jsx"
click node_app "https://github.com/heaven-swastik/cyberflow_sih/blob/main/frontend/src/App.jsx"
click node_case_views "https://github.com/heaven-swastik/cyberflow_sih/blob/main/frontend/src/components/CorrelateStep.jsx"
click node_map_view "https://github.com/heaven-swastik/cyberflow_sih/blob/main/frontend/src/components/MacroHeatmap.jsx"
click node_action_view "https://github.com/heaven-swastik/cyberflow_sih/blob/main/frontend/src/components/ActionStep.jsx"
click node_auth "https://github.com/heaven-swastik/cyberflow_sih/blob/main/frontend/src/contexts/AuthContext.jsx"
click node_api_client "https://github.com/heaven-swastik/cyberflow_sih/blob/main/frontend/src/api/index.js"
click node_backend "https://github.com/heaven-swastik/cyberflow_sih/blob/main/backend/server.js"
click node_complaint_intake "https://github.com/heaven-swastik/cyberflow_sih/blob/main/ai-engine/complaint_intake.py"
click node_pipeline "https://github.com/heaven-swastik/cyberflow_sih/blob/main/ai-engine/pipeline.py"
click node_validator "https://github.com/heaven-swastik/cyberflow_sih/blob/main/ai-engine/data_validator.py"
click node_graph_builder "https://github.com/heaven-swastik/cyberflow_sih/blob/main/ai-engine/graph_builder.py"
click node_feature_engineer "https://github.com/heaven-swastik/cyberflow_sih/blob/main/ai-engine/feature_engineer.py"
click node_classifier "https://github.com/heaven-swastik/cyberflow_sih/blob/main/ai-engine/classifier.py"
click node_path_predictor "https://github.com/heaven-swastik/cyberflow_sih/blob/main/ai-engine/path_predictor.py"
click node_atm_engine "https://github.com/heaven-swastik/cyberflow_sih/blob/main/ai-engine/atm_engine.py"
click node_blockchain "https://github.com/heaven-swastik/cyberflow_sih/blob/main/ai-engine/blockchain.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_portal,node_app,node_case_views,node_map_view,node_action_view,node_auth,node_api_client toneBlue
class node_backend toneAmber
class node_complaint_intake,node_pipeline,node_validator,node_graph_builder,node_feature_engineer toneMint
class node_classifier,node_path_predictor,node_atm_engine,node_blockchain toneRose
class node_complainant,node_investigator,node_bank,node_law_enforcement toneIndigo
```

## Components

### Command Center

- [Complaint Portal](https://github.com/heaven-swastik/cyberflow_sih/blob/main/frontend/src/components/ComplaintPortal.jsx): `frontend/src/components/ComplaintPortal.jsx`
- [Command Center](https://github.com/heaven-swastik/cyberflow_sih/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Case Views](https://github.com/heaven-swastik/cyberflow_sih/blob/main/frontend/src/components/CorrelateStep.jsx): `frontend/src/components/CorrelateStep.jsx`
- [Threat Heatmap](https://github.com/heaven-swastik/cyberflow_sih/blob/main/frontend/src/components/MacroHeatmap.jsx): `frontend/src/components/MacroHeatmap.jsx`
- [Intervention View](https://github.com/heaven-swastik/cyberflow_sih/blob/main/frontend/src/components/ActionStep.jsx): `frontend/src/components/ActionStep.jsx`
- [Authentication](https://github.com/heaven-swastik/cyberflow_sih/blob/main/frontend/src/contexts/AuthContext.jsx): `frontend/src/contexts/AuthContext.jsx`
- [API Client](https://github.com/heaven-swastik/cyberflow_sih/blob/main/frontend/src/api/index.js): `frontend/src/api/index.js`

### API Service

- [Express API](https://github.com/heaven-swastik/cyberflow_sih/blob/main/backend/server.js): `backend/server.js`

### Case Analysis

- [Complaint Intake](https://github.com/heaven-swastik/cyberflow_sih/blob/main/ai-engine/complaint_intake.py): `ai-engine/complaint_intake.py`
- [Case Pipeline](https://github.com/heaven-swastik/cyberflow_sih/blob/main/ai-engine/pipeline.py): `ai-engine/pipeline.py`
- [Data Validation](https://github.com/heaven-swastik/cyberflow_sih/blob/main/ai-engine/data_validator.py): `ai-engine/data_validator.py`
- [Transaction Graph](https://github.com/heaven-swastik/cyberflow_sih/blob/main/ai-engine/graph_builder.py): `ai-engine/graph_builder.py`
- [Feature Engineering](https://github.com/heaven-swastik/cyberflow_sih/blob/main/ai-engine/feature_engineer.py): `ai-engine/feature_engineer.py`

### Predictions & Response

- [ML Classifiers](https://github.com/heaven-swastik/cyberflow_sih/blob/main/ai-engine/classifier.py): `ai-engine/classifier.py`
- [Path Prediction](https://github.com/heaven-swastik/cyberflow_sih/blob/main/ai-engine/path_predictor.py): `ai-engine/path_predictor.py`
- [ATM Ranking](https://github.com/heaven-swastik/cyberflow_sih/blob/main/ai-engine/atm_engine.py): `ai-engine/atm_engine.py`
- [Alert Hash Trail](https://github.com/heaven-swastik/cyberflow_sih/blob/main/ai-engine/blockchain.py): `ai-engine/blockchain.py`

### Other components

- **Complainant**
- **Investigator**
- **Bank Operations**
- **LEA Dispatch**

## Connections

- Complainant → Complaint Portal: files complaint
- Complaint Portal → API Client: submits intake
- Investigator → Command Center: reviews cases
- Command Center → API Client: requests case data
- Authentication → Express API: authenticates
- API Client → Express API: calls API
- Express API → Complaint Intake: runs intake
- Complaint Intake → Case Pipeline: processes case
- Case Pipeline → Data Validation: validates data
- Case Pipeline → Transaction Graph: builds topology
- Case Pipeline → Feature Engineering: extracts features
- Case Pipeline → ML Classifiers: predicts case
- Case Pipeline → Path Prediction: predicts trajectory
- Case Pipeline → ATM Ranking: ranks ATMs
- Case Pipeline → Alert Hash Trail: hashes alerts
- API Client → Case Views: supplies case data
- API Client → Threat Heatmap: supplies map data
- API Client → Intervention View: supplies action data
- Intervention View → API Client: requests alert
- Express API → Bank Operations: freeze requests
- Express API → LEA Dispatch: dispatches intelligence
