# harshada2576/sih2026 architecture

> Architecture diagram of the GitHub repository harshada2576/sih2026, 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/harshada2576/sih2026
- Repository: https://github.com/harshada2576/sih2026

## Overview

CyberShield is a real-time fraud-interception platform: transaction streams are assembled into account networks, scored for mule behavior, and used to predict likely cash-out terminals; investigators then review and act on cases through a native Android app. The README documents the streaming and notification capabilities; sampled source confirms the API/engine, notification, and Android connectivity roles. Details of unsampled pipeline and detection internals are represented only where the README supports them.

Main entry points: [`CyberShield/app/src/main/java/com/i4c/cybershield/MainViewModel.kt`](https://github.com/harshada2576/sih2026/blob/main/CyberShield/app/src/main/java/com/i4c/cybershield/MainViewModel.kt) (App State), [`detection/scorer.py`](https://github.com/harshada2576/sih2026/blob/main/detection/scorer.py) (Rule Scorer), [`pipeline/case_orchestrator.py`](https://github.com/harshada2576/sih2026/blob/main/pipeline/case_orchestrator.py) (Case Orchestrator), [`api/engine.py`](https://github.com/harshada2576/sih2026/blob/main/api/engine.py) (Case Engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_stream["Stream and Graph"]
  node_producer["Transaction Producer<br/>[producer.py]"]
  node_transactions["Transactions Topic"]
  node_consumer["Graph Consumer<br/>[consumer.py]"]
  node_graph[("Sliding Graph Store<br/>[graph_store.py]")]
  node_signals["Graph Signals Topic"]
end

subgraph group_risk["Detection and Response"]
  node_scorer["Rule Scorer<br/>[scorer.py]"]
  node_rules["Fraud Rules"]
  node_ranking["Terminal Ranking"]
  node_dispatcher["Alert Dispatcher"]
  node_alerts["Risk Alerts Topic"]
  node_intervention["Auto Intervention"]
end

subgraph group_case["Investigation Services"]
  node_orchestrator["Case Orchestrator"]
  node_fundtrace["Fund Traceability"]
  node_geointel["Withdrawal Geo Intel"]
  node_notifications["Notification Service"]
  node_persistence[("Operational Store<br/>[persistence.py]")]
  node_audit[("Tamper-Evident Ledger<br/>[merkle_ledger.py]")]
end

subgraph group_backend["Backend API"]
  node_api["REST and WebSocket API<br/>[server.py]"]
  node_engine["Case Engine<br/>[engine.py]"]
end

subgraph group_mobile["Android Client"]
  node_activity["Android Entry<br/>[MainActivity.kt]"]
  node_nav["App Navigation<br/>[NavGraph.kt]"]
  node_viewmodel["App State<br/>[MainViewModel.kt]"]
  node_network["Network Discovery"]
  node_api_client["API Client<br/>[CyberShieldApi.kt]"]
  node_screens["Case and Radar Screens<br/>[MainScreen.kt]"]
  node_detail["Case Detail"]
  node_radar["Terminal Radar<br/>[RadarMapScreen.kt]"]
  node_activity_screen["Audit Activity<br/>[ActivityScreen.kt]"]
end

node_txn_source(("Transaction Sources"))
node_bank["Bank Services"]
node_mobile_user(("Investigator"))

node_txn_source -->|"provides transactions"| node_producer
node_producer -->|"publishes"| node_transactions
node_transactions -->|"consumed by"| node_consumer
node_consumer -->|"updates graph"| node_graph
node_consumer -->|"publishes signals"| node_signals
node_signals -->|"consumed by"| node_scorer
node_scorer -->|"evaluates"| node_rules
node_scorer -->|"ranks terminals"| node_ranking
node_scorer -->|"dispatches alerts"| node_dispatcher
node_dispatcher -->|"publishes"| node_alerts
node_scorer -->|"triggers controls"| node_intervention
node_orchestrator -->|"coordinates tracing"| node_fundtrace
node_orchestrator -->|"coordinates geo checks"| node_geointel
node_orchestrator -->|"dispatches milestones"| node_notifications
node_notifications -->|"stores deliveries"| node_persistence
node_orchestrator -->|"persists cases"| node_persistence
node_engine -->|"builds graph"| node_graph
node_engine -->|"sends notifications"| node_notifications
node_engine -->|"records actions"| node_audit
node_engine -.->|"requests account action"| node_bank
node_alerts -->|"alert input"| node_api
node_api -->|"processes cases"| node_engine
node_api -->|"triggers notifications"| node_notifications
node_api -->|"routes interventions"| node_orchestrator
node_mobile_user -->|"uses app"| node_activity
node_activity -->|"opens navigation"| node_nav
node_nav -->|"routes to"| node_screens
node_screens -->|"requests state"| node_viewmodel
node_viewmodel -->|"resolves connection"| node_network
node_viewmodel -->|"requests data"| node_api_client
node_api_client -->|"calls backend"| node_api
node_viewmodel -->|"supplies case data"| node_detail
node_viewmodel -->|"supplies terminal data"| node_radar
node_viewmodel -->|"supplies audit data"| node_activity_screen

click node_producer "https://github.com/harshada2576/sih2026/blob/main/data-generator/producer.py"
click node_consumer "https://github.com/harshada2576/sih2026/blob/main/pipeline/consumer.py"
click node_graph "https://github.com/harshada2576/sih2026/blob/main/pipeline/graph_store.py"
click node_scorer "https://github.com/harshada2576/sih2026/blob/main/detection/scorer.py"
click node_rules "https://github.com/harshada2576/sih2026/tree/main/detection/rules"
click node_ranking "https://github.com/harshada2576/sih2026/blob/main/detection/terminal_ranking.py"
click node_dispatcher "https://github.com/harshada2576/sih2026/blob/main/detection/alert_dispatcher.py"
click node_intervention "https://github.com/harshada2576/sih2026/blob/main/detection/auto_intervention.py"
click node_orchestrator "https://github.com/harshada2576/sih2026/blob/main/pipeline/case_orchestrator.py"
click node_fundtrace "https://github.com/harshada2576/sih2026/blob/main/pipeline/fund_traceability.py"
click node_geointel "https://github.com/harshada2576/sih2026/blob/main/pipeline/geo_intelligence.py"
click node_notifications "https://github.com/harshada2576/sih2026/blob/main/pipeline/notification_service.py"
click node_persistence "https://github.com/harshada2576/sih2026/blob/main/shared/persistence.py"
click node_audit "https://github.com/harshada2576/sih2026/blob/main/audit/merkle_ledger.py"
click node_api "https://github.com/harshada2576/sih2026/blob/main/api/server.py"
click node_engine "https://github.com/harshada2576/sih2026/blob/main/api/engine.py"
click node_activity "https://github.com/harshada2576/sih2026/blob/main/CyberShield/app/src/main/java/com/i4c/cybershield/MainActivity.kt"
click node_nav "https://github.com/harshada2576/sih2026/blob/main/CyberShield/app/src/main/java/com/i4c/cybershield/ui/navigation/NavGraph.kt"
click node_viewmodel "https://github.com/harshada2576/sih2026/blob/main/CyberShield/app/src/main/java/com/i4c/cybershield/MainViewModel.kt"
click node_network "https://github.com/harshada2576/sih2026/blob/main/CyberShield/app/src/main/java/com/i4c/cybershield/net/NetworkConnectionManager.kt"
click node_api_client "https://github.com/harshada2576/sih2026/blob/main/CyberShield/app/src/main/java/com/i4c/cybershield/data/CyberShieldApi.kt"
click node_screens "https://github.com/harshada2576/sih2026/blob/main/CyberShield/app/src/main/java/com/i4c/cybershield/ui/screens/MainScreen.kt"
click node_detail "https://github.com/harshada2576/sih2026/blob/main/CyberShield/app/src/main/java/com/i4c/cybershield/ui/investigation/CaseDetailScreen.kt"
click node_radar "https://github.com/harshada2576/sih2026/blob/main/CyberShield/app/src/main/java/com/i4c/cybershield/ui/radar/RadarMapScreen.kt"
click node_activity_screen "https://github.com/harshada2576/sih2026/blob/main/CyberShield/app/src/main/java/com/i4c/cybershield/ui/activity/ActivityScreen.kt"

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_producer,node_transactions,node_consumer,node_graph,node_signals toneBlue
class node_scorer,node_rules,node_ranking,node_dispatcher,node_alerts,node_intervention toneAmber
class node_orchestrator,node_fundtrace,node_geointel,node_notifications,node_persistence,node_audit toneMint
class node_api,node_engine toneRose
class node_activity,node_nav,node_viewmodel,node_network,node_api_client,node_screens,node_detail,node_radar,node_activity_screen,node_txn_source,node_bank,node_mobile_user toneIndigo
```

## Components

### Stream and Graph

- [Transaction Producer](https://github.com/harshada2576/sih2026/blob/main/data-generator/producer.py): `data-generator/producer.py`
- **Transactions Topic**
- [Graph Consumer](https://github.com/harshada2576/sih2026/blob/main/pipeline/consumer.py): `pipeline/consumer.py`
- [Sliding Graph Store](https://github.com/harshada2576/sih2026/blob/main/pipeline/graph_store.py): `pipeline/graph_store.py`
- **Graph Signals Topic**

### Detection and Response

- [Rule Scorer](https://github.com/harshada2576/sih2026/blob/main/detection/scorer.py): `detection/scorer.py`
- [Fraud Rules](https://github.com/harshada2576/sih2026/tree/main/detection/rules): `detection/rules`
- [Terminal Ranking](https://github.com/harshada2576/sih2026/blob/main/detection/terminal_ranking.py): `detection/terminal_ranking.py`
- [Alert Dispatcher](https://github.com/harshada2576/sih2026/blob/main/detection/alert_dispatcher.py): `detection/alert_dispatcher.py`
- **Risk Alerts Topic**
- [Auto Intervention](https://github.com/harshada2576/sih2026/blob/main/detection/auto_intervention.py): `detection/auto_intervention.py`

### Investigation Services

- [Case Orchestrator](https://github.com/harshada2576/sih2026/blob/main/pipeline/case_orchestrator.py): `pipeline/case_orchestrator.py`
- [Fund Traceability](https://github.com/harshada2576/sih2026/blob/main/pipeline/fund_traceability.py): `pipeline/fund_traceability.py`
- [Withdrawal Geo Intel](https://github.com/harshada2576/sih2026/blob/main/pipeline/geo_intelligence.py): `pipeline/geo_intelligence.py`
- [Notification Service](https://github.com/harshada2576/sih2026/blob/main/pipeline/notification_service.py): `pipeline/notification_service.py`
- [Operational Store](https://github.com/harshada2576/sih2026/blob/main/shared/persistence.py): `shared/persistence.py`
- [Tamper-Evident Ledger](https://github.com/harshada2576/sih2026/blob/main/audit/merkle_ledger.py): `audit/merkle_ledger.py`

### Backend API

- [REST and WebSocket API](https://github.com/harshada2576/sih2026/blob/main/api/server.py): `api/server.py`
- [Case Engine](https://github.com/harshada2576/sih2026/blob/main/api/engine.py): `api/engine.py`

### Android Client

- [Android Entry](https://github.com/harshada2576/sih2026/blob/main/CyberShield/app/src/main/java/com/i4c/cybershield/MainActivity.kt): `CyberShield/app/src/main/java/com/i4c/cybershield/MainActivity.kt`
- [App Navigation](https://github.com/harshada2576/sih2026/blob/main/CyberShield/app/src/main/java/com/i4c/cybershield/ui/navigation/NavGraph.kt): `CyberShield/app/src/main/java/com/i4c/cybershield/ui/navigation/NavGraph.kt`
- [App State](https://github.com/harshada2576/sih2026/blob/main/CyberShield/app/src/main/java/com/i4c/cybershield/MainViewModel.kt): `CyberShield/app/src/main/java/com/i4c/cybershield/MainViewModel.kt`
- [Network Discovery](https://github.com/harshada2576/sih2026/blob/main/CyberShield/app/src/main/java/com/i4c/cybershield/net/NetworkConnectionManager.kt): `CyberShield/app/src/main/java/com/i4c/cybershield/net/NetworkConnectionManager.kt`
- [API Client](https://github.com/harshada2576/sih2026/blob/main/CyberShield/app/src/main/java/com/i4c/cybershield/data/CyberShieldApi.kt): `CyberShield/app/src/main/java/com/i4c/cybershield/data/CyberShieldApi.kt`
- [Case and Radar Screens](https://github.com/harshada2576/sih2026/blob/main/CyberShield/app/src/main/java/com/i4c/cybershield/ui/screens/MainScreen.kt): `CyberShield/app/src/main/java/com/i4c/cybershield/ui/screens/MainScreen.kt`
- [Case Detail](https://github.com/harshada2576/sih2026/blob/main/CyberShield/app/src/main/java/com/i4c/cybershield/ui/investigation/CaseDetailScreen.kt): `CyberShield/app/src/main/java/com/i4c/cybershield/ui/investigation/CaseDetailScreen.kt`
- [Terminal Radar](https://github.com/harshada2576/sih2026/blob/main/CyberShield/app/src/main/java/com/i4c/cybershield/ui/radar/RadarMapScreen.kt): `CyberShield/app/src/main/java/com/i4c/cybershield/ui/radar/RadarMapScreen.kt`
- [Audit Activity](https://github.com/harshada2576/sih2026/blob/main/CyberShield/app/src/main/java/com/i4c/cybershield/ui/activity/ActivityScreen.kt): `CyberShield/app/src/main/java/com/i4c/cybershield/ui/activity/ActivityScreen.kt`

### Other components

- **Transaction Sources**
- **Bank Services**
- **Investigator**

## Connections

- Transaction Sources → Transaction Producer: provides transactions
- Transaction Producer → Transactions Topic: publishes
- Transactions Topic → Graph Consumer: consumed by
- Graph Consumer → Sliding Graph Store: updates graph
- Graph Consumer → Graph Signals Topic: publishes signals
- Graph Signals Topic → Rule Scorer: consumed by
- Rule Scorer → Fraud Rules: evaluates
- Rule Scorer → Terminal Ranking: ranks terminals
- Rule Scorer → Alert Dispatcher: dispatches alerts
- Alert Dispatcher → Risk Alerts Topic: publishes
- Rule Scorer → Auto Intervention: triggers controls
- Case Orchestrator → Fund Traceability: coordinates tracing
- Case Orchestrator → Withdrawal Geo Intel: coordinates geo checks
- Case Orchestrator → Notification Service: dispatches milestones
- Notification Service → Operational Store: stores deliveries
- Case Orchestrator → Operational Store: persists cases
- Case Engine → Sliding Graph Store: builds graph
- Case Engine → Notification Service: sends notifications
- Case Engine → Tamper-Evident Ledger: records actions
- Case Engine → Bank Services: requests account action
- Risk Alerts Topic → REST and WebSocket API: alert input
- REST and WebSocket API → Case Engine: processes cases
- REST and WebSocket API → Notification Service: triggers notifications
- REST and WebSocket API → Case Orchestrator: routes interventions
- Investigator → Android Entry: uses app
- Android Entry → App Navigation: opens navigation
- App Navigation → Case and Radar Screens: routes to
- Case and Radar Screens → App State: requests state
- App State → Network Discovery: resolves connection
- App State → API Client: requests data
- API Client → REST and WebSocket API: calls backend
- App State → Case Detail: supplies case data
- App State → Terminal Radar: supplies terminal data
- App State → Audit Activity: supplies audit data
