Skip to content

SiddharthKumar268/Vyaapti

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌐 RTGS Risk-Chain Analyzer

╔══════════════════════════════════════════════════════════════════════╗
β•‘                                                                      β•‘
β•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—                               β•‘
β•‘     β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ•”β•β•β•β•β•                               β•‘
β•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•   β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—                               β•‘
β•‘     β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—   β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β•šβ•β•β•β•β–ˆβ–ˆβ•‘                               β•‘
β•‘     β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘   β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘                               β•‘
β•‘     β•šβ•β•  β•šβ•β•   β•šβ•β•    β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β•β•                               β•‘
β•‘                                                                      β•‘
β•‘          πŸ” Real-Time Gross Settlement Risk Analysis                 β•‘
β•‘                 🧠 AI-Powered β€’ πŸš€ Cloud-Native                     β•‘
β•‘                                                                      β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

MIT License Node.js Apache Spark Cassandra DataStax Astra


🎯 Problem Statement

graph TD
    A[Traditional Banking Systems] -->|Limited Visibility| B[Money Laundering]
    A -->|Manual Review| C[Delayed Detection]
    A -->|Isolated Analysis| D[Missed Patterns]
    B --> E[Financial Crime]
    C --> E
    D --> E
    E -->|Estimated Loss| F[$2 Trillion Annually]
    
    style A fill:#f5f5f5,stroke:#333,stroke-width:2px
    style E fill:#000,stroke:#333,stroke-width:3px,color:#fff
    style F fill:#666,stroke:#333,stroke-width:2px,color:#fff
Loading

Our Solution: Real-Time Graph-Based Detection


🌟 System Overview

graph TB
    subgraph Input["πŸ“₯ Data Sources"]
        T1[RTGS Transactions]
        T2[Account Information]
        T3[Historical Data]
    end
    
    subgraph Processing["βš™οΈ Processing Layer"]
        S1[Apache Spark Jobs]
        S2[Graph Analytics]
        S3[ML Clustering]
        S4[Risk Scoring]
    end
    
    subgraph Storage["πŸ’Ύ Data Storage"]
        DB[DataStax Astra DB<br/>Mumbai Region]
    end
    
    subgraph Backend["πŸ”§ Backend Services"]
        API[Node.js REST API]
        Auth[Authentication]
        Logic[Business Logic]
    end
    
    subgraph Frontend["πŸ–₯️ User Interface"]
        D[Dashboard]
        C[Chains View]
        A[Account Analysis]
        G[Graph Visualization]
    end
    
    Input --> Processing
    Processing --> Storage
    Storage --> Backend
    Backend --> Frontend
    
    style Input fill:#f9f9f9,stroke:#333,stroke-width:2px
    style Processing fill:#e8e8e8,stroke:#333,stroke-width:2px
    style Storage fill:#d4d4d4,stroke:#333,stroke-width:3px
    style Backend fill:#c0c0c0,stroke:#333,stroke-width:2px
    style Frontend fill:#a8a8a8,stroke:#333,stroke-width:2px
Loading

πŸ”— Chain Detection Process

flowchart LR
    A[Transaction Stream] --> B{Pattern Analysis}
    B -->|Multi-hop| C[Chain Detection]
    B -->|Single| D[Normal Flow]
    C --> E{Circular?}
    E -->|Yes| F[HIGH RISK]
    E -->|No| G{Layering?}
    G -->|Yes| H[MEDIUM RISK]
    G -->|No| I{Rapid?}
    I -->|Yes| J[SUSPICIOUS]
    I -->|No| K[LOW RISK]
    
    F --> L[Alert System]
    H --> L
    J --> L
    K --> M[Archive]
    D --> M
    
    style A fill:#f5f5f5,stroke:#333,stroke-width:2px
    style F fill:#000,stroke:#333,stroke-width:3px,color:#fff
    style H fill:#666,stroke:#333,stroke-width:2px,color:#fff
    style J fill:#999,stroke:#333,stroke-width:2px
    style L fill:#333,stroke:#000,stroke-width:3px,color:#fff
Loading

πŸ—οΈ System Architecture

graph TB
    subgraph Frontend["Frontend Layer"]
        UI1[index.html<br/>Dashboard]
        UI2[chains.html<br/>Risk Chains]
        UI3[account.html<br/>Account Profile]
        UI4[graph.html<br/>Network Graph]
        CSS[style.css<br/>Glassmorphism UI]
        JS[JavaScript ES6+<br/>Chart.js + vis-network]
    end
    
    subgraph API["API Gateway"]
        REST[Express.js Server<br/>Port 3000]
        CORS[CORS Handler]
        ROUTES[Route Controllers]
    end
    
    subgraph Database["DataStax Astra DB"]
        KS[Keyspace: rtgs_risk]
        T1[chains table]
        T2[accounts table]
        T3[risk_features table]
        T4[clustering_results table]
        T5[audit_log table]
    end
    
    subgraph Spark["Apache Spark Cluster"]
        J1[Ingestion Job]
        J2[Feature Engineering]
        J3[ML Clustering]
        J4[Chain Detection]
        J5[Risk Scoring]
    end
    
    Frontend --> API
    API --> Database
    Spark --> Database
    
    style Frontend fill:#f5f5f5,stroke:#333,stroke-width:2px
    style API fill:#e0e0e0,stroke:#333,stroke-width:2px
    style Database fill:#c0c0c0,stroke:#333,stroke-width:3px
    style Spark fill:#a0a0a0,stroke:#333,stroke-width:2px
Loading

πŸ“Š Data Flow Architecture

sequenceDiagram
    participant User
    participant Frontend
    participant API
    participant Cache
    participant Astra DB
    participant Spark

    User->>Frontend: Request Dashboard
    Frontend->>API: GET /api/summary
    API->>Cache: Check Cache
    
    alt Cache Hit
        Cache-->>API: Return Cached Data
    else Cache Miss
        API->>Astra DB: Query Statistics
        Astra DB-->>API: Return Data
        API->>Cache: Update Cache
    end
    
    API-->>Frontend: JSON Response
    Frontend-->>User: Render Dashboard
    
    Note over Spark,Astra DB: Background Processing
    Spark->>Astra DB: Batch Write<br/>Detected Chains
    
    User->>Frontend: Search Account
    Frontend->>API: GET /api/account/:id
    API->>Astra DB: Query Account Data
    Astra DB-->>API: Account + Chains
    API-->>Frontend: JSON Response
    Frontend-->>User: Display Profile
Loading

🧠 Risk Scoring Algorithm

graph TD
    START[Transaction Chain Input] --> F1[Factor 1:<br/>Circular Pattern<br/>Weight: 30%]
    START --> F2[Factor 2:<br/>Rapid Succession<br/>Weight: 25%]
    START --> F3[Factor 3:<br/>Layering Complexity<br/>Weight: 20%]
    START --> F4[Factor 4:<br/>Structuring Pattern<br/>Weight: 15%]
    START --> F5[Factor 5:<br/>Time Compression<br/>Weight: 10%]
    
    F1 --> C1{Circular?}
    C1 -->|Yes| S1[Score: 30]
    C1 -->|No| S1B[Score: 0]
    
    F2 --> C2{<1 hour?}
    C2 -->|Yes| S2[Score: 25]
    C2 -->|No| S2B[Score: 0]
    
    F3 --> C3{5+ Hops?}
    C3 -->|Yes| S3[Score: 20]
    C3 -->|No| S3B[Score: 0]
    
    F4 --> C4{Below Threshold?}
    C4 -->|Yes| S4[Score: 15]
    C4 -->|No| S4B[Score: 0]
    
    F5 --> C5{High Frequency?}
    C5 -->|Yes| S5[Score: 10]
    C5 -->|No| S5B[Score: 0]
    
    S1 --> SUM[Weighted Sum]
    S1B --> SUM
    S2 --> SUM
    S2B --> SUM
    S3 --> SUM
    S3B --> SUM
    S4 --> SUM
    S4B --> SUM
    S5 --> SUM
    S5B --> SUM
    
    SUM --> RISK{Risk Score}
    RISK -->|0-40| LOW[LOW RISK]
    RISK -->|41-70| MED[MEDIUM RISK]
    RISK -->|71-90| HIGH[HIGH RISK]
    RISK -->|91-100| CRIT[CRITICAL]
    
    style START fill:#f5f5f5,stroke:#333,stroke-width:2px
    style SUM fill:#e0e0e0,stroke:#333,stroke-width:2px
    style CRIT fill:#000,stroke:#333,stroke-width:3px,color:#fff
    style HIGH fill:#666,stroke:#333,stroke-width:2px,color:#fff
    style MED fill:#999,stroke:#333,stroke-width:2px
    style LOW fill:#ccc,stroke:#333,stroke-width:2px
Loading

πŸ”„ Transaction Chain Example

graph LR
    A[Account A<br/>Origin<br/>β‚Ή50 Cr] -->|2 min<br/>β‚Ή48 Cr| B[Account B<br/>Layer 1]
    B -->|5 min<br/>β‚Ή46 Cr| C[Account C<br/>Layer 2]
    C -->|8 min<br/>β‚Ή44 Cr| D[Account D<br/>Layer 3]
    D -->|12 min<br/>β‚Ή42 Cr| E[Account E<br/>Layer 4]
    E -->|15 min<br/>β‚Ή40 Cr| A
    
    style A fill:#000,stroke:#333,stroke-width:3px,color:#fff
    style B fill:#666,stroke:#333,stroke-width:2px,color:#fff
    style C fill:#888,stroke:#333,stroke-width:2px,color:#fff
    style D fill:#aaa,stroke:#333,stroke-width:2px
    style E fill:#ccc,stroke:#333,stroke-width:2px
Loading

🚨 ALERT: Circular Pattern Detected
Risk Score: 94.5% | Total Time: 15 minutes | Loss: β‚Ή10 Cr


πŸš€ Installation Guide

graph TD
    START[Start Installation] --> CLONE[Clone Repository]
    CLONE --> ASTRA[Setup Astra DB]
    ASTRA --> BUNDLE[Download Secure Bundle]
    BUNDLE --> TOKEN[Generate Token]
    TOKEN --> DEPS[Install Dependencies]
    DEPS --> ENV[Configure Environment]
    ENV --> SCHEMA[Initialize Schema]
    SCHEMA --> DATA[Insert Sample Data]
    DATA --> TEST[Test Connection]
    TEST --> BACKEND[Start Backend Server]
    BACKEND --> FRONTEND[Start Frontend Server]
    FRONTEND --> SUCCESS[πŸŽ‰ Application Running]
    
    style START fill:#f5f5f5,stroke:#333,stroke-width:2px
    style SUCCESS fill:#000,stroke:#333,stroke-width:3px,color:#fff
Loading

Step-by-Step Commands

# 1. Clone Repository
git clone https://github.com/yourusername/rtgs-analyzer.git
cd rtgs-analyzer

# 2. Backend Setup
cd backend
npm install

# 3. Configure Environment
cat > .env << EOF
PORT=3000
ASTRA_CLIENT_ID=your_client_id
ASTRA_CLIENT_SECRET=your_client_secret
ASTRA_KEYSPACE=rtgs_risk
SECURE_CONNECT_BUNDLE=./secure-connect-vyaapti.zip
EOF

# 4. Test Connection
node test-astra-connection.js

# 5. Start Backend
node server.js

# 6. Start Frontend (New Terminal)
cd frontend
python3 -m http.server 8080

πŸ“‘ API Endpoints

graph LR
    API[REST API<br/>localhost:3000] --> SUMMARY[/api/summary<br/>Dashboard Stats]
    API --> CHAINS[/api/chains<br/>All Chains]
    API --> CHAIN[/api/chain/:id<br/>Chain Details]
    API --> ACCOUNT[/api/account/:id<br/>Account Profile]
    API --> TOP[/api/accounts/top<br/>Top Risky Accounts]
    API --> CHARTS[/api/charts/data<br/>Chart Data]
    
    style API fill:#000,stroke:#333,stroke-width:3px,color:#fff
    style SUMMARY fill:#e0e0e0,stroke:#333,stroke-width:2px
    style CHAINS fill:#e0e0e0,stroke:#333,stroke-width:2px
    style CHAIN fill:#e0e0e0,stroke:#333,stroke-width:2px
    style ACCOUNT fill:#e0e0e0,stroke:#333,stroke-width:2px
    style TOP fill:#e0e0e0,stroke:#333,stroke-width:2px
    style CHARTS fill:#e0e0e0,stroke:#333,stroke-width:2px
Loading

Request/Response Flow

sequenceDiagram
    participant C as Client
    participant API as Express API
    participant DB as Astra DB
    
    C->>API: GET /api/chains?risk_level=high
    API->>API: Validate Parameters
    API->>DB: SELECT * FROM chains<br/>WHERE risk_score > 70
    DB-->>API: ResultSet[10 chains]
    API->>API: Transform Data
    API-->>C: JSON Response<br/>{chains: [...], count: 10}
    
    Note over C,DB: Response Time: ~89ms
Loading

πŸ—„οΈ Database Schema

erDiagram
    CHAINS ||--o{ ACCOUNT_CHAINS : contains
    ACCOUNTS ||--o{ ACCOUNT_CHAINS : participates
    ACCOUNTS ||--o{ RISK_FEATURES : has
    ACCOUNTS ||--o{ CLUSTERING_RESULTS : belongs_to
    
    CHAINS {
        uuid chain_id PK
        float risk_score
        int hop_count
        decimal total_value
        timestamp detected_at
        boolean is_circular
    }
    
    ACCOUNTS {
        text account_id PK
        float suspicion_index
        int cluster_id
        decimal total_inflow
        decimal total_outflow
        timestamp last_activity
    }
    
    ACCOUNT_CHAINS {
        text account_id PK
        uuid chain_id PK
        int position_in_chain
        decimal amount_transferred
    }
    
    RISK_FEATURES {
        text account_id PK
        float velocity_score
        float frequency_score
        float amount_variance
        int network_degree
    }
    
    CLUSTERING_RESULTS {
        int cluster_id PK
        text account_id PK
        float distance_to_centroid
        timestamp clustered_at
    }
Loading

πŸ”§ Spark Job Pipeline

graph TD
    RAW[Raw Transaction CSV] --> ING[Ingestion Job<br/>ingest_transactions.py]
    ING --> CLEAN[Cleaned Data in Astra]
    CLEAN --> FEAT[Feature Engineering<br/>extract_features.py]
    FEAT --> FEATURES[risk_features table]
    FEATURES --> CLUSTER[Clustering Job<br/>cluster_accounts.py]
    CLUSTER --> GROUPS[clustering_results table]
    FEATURES --> CHAIN[Chain Detection<br/>detect_chains.py]
    CHAIN --> CHAINS[chains table]
    CHAINS --> RISK[Risk Scoring<br/>calculate_risk.py]
    RISK --> FINAL[Updated Risk Scores]
    
    style RAW fill:#f5f5f5,stroke:#333,stroke-width:2px
    style FINAL fill:#000,stroke:#333,stroke-width:3px,color:#fff
Loading

Job Execution Flow

sequenceDiagram
    participant Admin
    participant Spark
    participant Astra DB
    participant Alert System
    
    Admin->>Spark: spark-submit detect_chains.py
    Spark->>Astra DB: Read transactions_processed
    Astra DB-->>Spark: Transaction Data
    
    Note over Spark: Graph Analysis<br/>NetworkX Processing
    
    Spark->>Spark: Build Transaction Graph
    Spark->>Spark: Detect Circular Paths
    Spark->>Spark: Calculate Risk Scores
    
    Spark->>Astra DB: Write to chains table
    Astra DB-->>Spark: Confirm Write
    
    alt High Risk Detected
        Spark->>Alert System: Trigger Alert
        Alert System-->>Admin: Email Notification
    end
    
    Spark-->>Admin: Job Complete<br/>15 chains detected
Loading

🎨 User Interface Flow

graph TD
    LANDING[Landing Page] --> DASHBOARD[πŸ“Š Dashboard]
    DASHBOARD --> CHAINS_VIEW[πŸ”— Chains View]
    DASHBOARD --> ACCOUNT_VIEW[πŸ‘€ Account Analysis]
    DASHBOARD --> GRAPH_VIEW[πŸ•ΈοΈ Network Graph]
    
    CHAINS_VIEW --> FILTER[Filter by Risk Level]
    CHAINS_VIEW --> SORT[Sort by Date/Risk/Value]
    CHAINS_VIEW --> DETAIL[Chain Detail View]
    DETAIL --> GRAPH_VIEW
    
    ACCOUNT_VIEW --> SEARCH[Search by Account ID]
    ACCOUNT_VIEW --> METRICS[View Metrics]
    ACCOUNT_VIEW --> HISTORY[Transaction History]
    METRICS --> RELATED_CHAINS[Related Chains]
    RELATED_CHAINS --> CHAINS_VIEW
    
    GRAPH_VIEW --> INTERACTIVE[Interactive Controls]
    INTERACTIVE --> ZOOM[Zoom & Pan]
    INTERACTIVE --> NODE_CLICK[Click Node Details]
    INTERACTIVE --> EXPORT[Export PNG]
    
    style LANDING fill:#000,stroke:#333,stroke-width:3px,color:#fff
    style DASHBOARD fill:#333,stroke:#333,stroke-width:2px,color:#fff
    style CHAINS_VIEW fill:#666,stroke:#333,stroke-width:2px,color:#fff
    style ACCOUNT_VIEW fill:#666,stroke:#333,stroke-width:2px,color:#fff
    style GRAPH_VIEW fill:#666,stroke:#333,stroke-width:2px,color:#fff
Loading

πŸ“ˆ Performance Metrics

graph TB
    subgraph Throughput["⚑ Processing Throughput"]
        T1[10,000 TPS<br/>Peak Load]
        T2[8,000 TPS<br/>Average Load]
        T3[5,000 TPS<br/>Normal Load]
    end
    
    subgraph Latency["⏱️ Response Times"]
        L1[45ms<br/>/api/summary]
        L2[89ms<br/>/api/chains]
        L3[67ms<br/>/api/account]
        L4[112ms<br/>/api/chain/:id]
    end
    
    subgraph Scale["πŸ“Š Scalability"]
        S1[100M+<br/>Transactions]
        S2[1,000+<br/>Concurrent Users]
        S3[99.9%<br/>Uptime]
        S4[95.2%<br/>Accuracy]
    end
    
    style T1 fill:#000,stroke:#333,stroke-width:2px,color:#fff
    style L1 fill:#666,stroke:#333,stroke-width:2px,color:#fff
    style S1 fill:#999,stroke:#333,stroke-width:2px
Loading

πŸ” Security Architecture

graph TB
    USER[User Browser] --> HTTPS[HTTPS/TLS Layer]
    HTTPS --> AUTH[Authentication]
    AUTH --> RBAC[Role-Based Access Control]
    RBAC --> API[API Gateway]
    API --> VALID[Request Validation]
    VALID --> RATE[Rate Limiting]
    RATE --> BACKEND[Backend Logic]
    BACKEND --> ENCRYPT[Data Encryption]
    ENCRYPT --> ASTRA[Astra DB<br/>Secure Connection]
    
    AUDIT[Audit Logger] --> LOG_DB[(Audit Logs)]
    BACKEND --> AUDIT
    
    style HTTPS fill:#000,stroke:#333,stroke-width:3px,color:#fff
    style AUTH fill:#333,stroke:#333,stroke-width:2px,color:#fff
    style ENCRYPT fill:#666,stroke:#333,stroke-width:2px,color:#fff
Loading

🎯 Machine Learning Pipeline

graph LR
    DATA[Transaction Data] --> PREPROCESS[Preprocessing<br/>Cleaning & Normalization]
    PREPROCESS --> EXTRACT[Feature Extraction<br/>30+ Features]
    EXTRACT --> CLUSTER[K-Means Clustering<br/>k=5 clusters]
    CLUSTER --> LABEL[Labeled Accounts]
    LABEL --> RISK[Risk Score Calculation]
    RISK --> OUTPUT[Classified Chains]
    
    EXTRACT --> FEATURES[Features:<br/>- Velocity<br/>- Frequency<br/>- Amount Variance<br/>- Network Degree<br/>- Time Patterns]
    
    style DATA fill:#f5f5f5,stroke:#333,stroke-width:2px
    style OUTPUT fill:#000,stroke:#333,stroke-width:3px,color:#fff
    style FEATURES fill:#e0e0e0,stroke:#333,stroke-width:2px
Loading

πŸ“¦ Deployment Architecture

graph TB
    subgraph Production["🌐 Production Environment"]
        LB[Load Balancer<br/>Nginx]
        APP1[Node.js Instance 1<br/>Port 3000]
        APP2[Node.js Instance 2<br/>Port 3001]
        APP3[Node.js Instance 3<br/>Port 3002]
    end
    
    subgraph Cloud["☁️ DataStax Astra"]
        ASTRA[Astra DB Cluster<br/>Mumbai Region<br/>3 Replicas]
    end
    
    subgraph Processing["βš™οΈ Spark Cluster"]
        MASTER[Spark Master]
        WORKER1[Worker Node 1]
        WORKER2[Worker Node 2]
        WORKER3[Worker Node 3]
    end
    
    subgraph Monitoring["πŸ“Š Monitoring"]
        LOGS[Centralized Logging]
        METRICS[Metrics Collection]
        ALERTS[Alert Manager]
    end
    
    LB --> APP1
    LB --> APP2
    LB --> APP3
    APP1 --> ASTRA
    APP2 --> ASTRA
    APP3 --> ASTRA
    
    MASTER --> WORKER1
    MASTER --> WORKER2
    MASTER --> WORKER3
    WORKER1 --> ASTRA
    WORKER2 --> ASTRA
    WORKER3 --> ASTRA
    
    APP1 --> LOGS
    APP2 --> LOGS
    APP3 --> LOGS
    ASTRA --> METRICS
    Processing --> METRICS
    METRICS --> ALERTS
    
    style LB fill:#000,stroke:#333,stroke-width:3px,color:#fff
    style ASTRA fill:#333,stroke:#333,stroke-width:3px,color:#fff
Loading

πŸ”„ CI/CD Pipeline

graph LR
    COMMIT[Git Commit] --> TRIGGER[GitHub Actions]
    TRIGGER --> TEST[Run Tests<br/>Jest + Mocha]
    TEST --> LINT[Code Linting<br/>ESLint]
    LINT --> BUILD[Build Application]
    BUILD --> SECURITY[Security Scan<br/>npm audit]
    SECURITY --> DEPLOY_STAGE[Deploy to Staging]
    DEPLOY_STAGE --> SMOKE[Smoke Tests]
    SMOKE --> APPROVE{Manual Approval}
    APPROVE -->|Yes| DEPLOY_PROD[Deploy to Production]
    APPROVE -->|No| ROLLBACK[Rollback]
    DEPLOY_PROD --> MONITOR[Monitor Metrics]
    
    style COMMIT fill:#f5f5f5,stroke:#333,stroke-width:2px
    style DEPLOY_PROD fill:#000,stroke:#333,stroke-width:3px,color:#fff
Loading

πŸ“Š Data Visualization Components

graph TB
    subgraph Charts["πŸ“ˆ Dashboard Charts"]
        C1[Risk Distribution<br/>Pie Chart]
        C2[Volume Trends<br/>Line Chart]
        C3[Top Accounts<br/>Bar Chart]
        C4[Activity Feed<br/>Timeline]
    end
    
    subgraph Network["πŸ•ΈοΈ Network Graph"]
        N1[vis-network.js<br/>Interactive Graph]
        N2[Node Clustering]
        N3[Edge Weights]
        N4[Physics Simulation]
    end
    
    subgraph Tables["πŸ“‹ Data Tables"]
        T1[Chains Listing<br/>Sortable]
        T2[Account Details<br/>Paginated]
        T3[Transaction History<br/>Filterable]
    end
    
    API[REST API] --> Charts
    API --> Network
    API --> Tables
    
    style API fill:#000,stroke:#333,stroke-width:3px,color:#fff
Loading

πŸ›‘οΈ Error Handling Flow

graph TD
    REQUEST[API Request] --> VALIDATE{Valid?}
    VALIDATE -->|No| ERROR_400[400 Bad Request]
    VALIDATE -->|Yes| AUTH{Authenticated?}
    AUTH -->|No| ERROR_401[401 Unauthorized]
    AUTH -->|Yes| RATE{Rate Limit OK?}
    RATE -->|No| ERROR_429[429 Too Many Requests]
    RATE -->|Yes| PROCESS[Process Request]
    PROCESS --> DB{DB Connection?}
    DB -->|Fail| ERROR_503[503 Service Unavailable]
    DB -->|Success| QUERY{Query Success?}
    QUERY -->|Fail| ERROR_500[500 Internal Error]
    QUERY -->|Success| RESPONSE[200 OK]
    
    ERROR_400 --> LOG[Log Error]
    ERROR_401 --> LOG
    ERROR_429 --> LOG
    ERROR_500 --> LOG
    ERROR_503 --> LOG
    LOG --> CLIENT[Return to Client]
    RESPONSE --> CLIENT
    
    style REQUEST fill:#f5f5f5,stroke:#333,stroke-width:2px
    style RESPONSE fill:#000,stroke:#333,stroke-width:3px,color:#fff
    style LOG fill:#666,stroke:#333,stroke-width:2px,color:#fff
Loading

πŸ“š Project Structure

RTGS-RiskChain/
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ index.html                 # Dashboard home page
β”‚   β”œβ”€β”€ chains.html                # Risk chains listing
β”‚   β”œβ”€β”€ account.html               # Account analysis
β”‚   β”œβ”€β”€ graph.html                 # Network visualization
β”‚   β”œβ”€β”€ style.css                  # Glassmorphic styling
β”‚   └── scripts/
β”‚       β”œβ”€β”€ main.js                # Dashboard logic
β”‚       β”œβ”€β”€ chains.js              # Chains page logic
β”‚       β”œβ”€β”€ account.js             # Account page logic
β”‚       └── graph.js               # Graph visualization
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ server.js                  # Express API server
β”‚   β”œβ”€β”€ .env                       # Environment configuration
β”‚   β”œβ”€β”€ test-astra-connection.js   # Connection testing
β”‚   β”œβ”€β”€ package.json               # Dependencies
β”‚   β”œβ”€β”€ secure-connect-vyaapti.zip # Astra secure bundle
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ summary.js             # Dashboard routes
β”‚   β”‚   β”œβ”€β”€ chains.js              # Chain routes
β”‚   β”‚   └── accounts.js            # Account routes
β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”œβ”€β”€ chainController.js     # Chain business logic
β”‚   β”‚   └── accountController.js   # Account business logic
β”‚   └── utils/
β”‚       β”œβ”€β”€ cassandra.js           # DB connection utilities
β”‚       └── validator.js           # Input validation
β”‚
β”œβ”€β”€ spark-jobs/
β”‚   β”œβ”€β”€ ingestion/
β”‚   β”‚   └── ingest_transactions.py # Data ingestion
β”‚   β”œβ”€β”€ features/
β”‚   β”‚   └── extract_features.py    # Feature engineering
β”‚   β”œβ”€β”€ clustering/
β”‚   β”‚   └── cluster_accounts.py    # ML clustering
β”‚   β”œβ”€β”€ chain-builder/
β”‚   β”‚   └── detect_chains_astra.py # Chain detection
β”‚   └── risk-scoring/
β”‚       └── calculate_risk.py      # Risk calculation
β”‚
β”œβ”€β”€ cassandra/
β”‚   └── schema-astra.cql           # Database schema
β”‚
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ diagrams/                  # Architecture diagrams
β”‚   β”œβ”€β”€ report/                    # Technical documentation
β”‚   └── patent/                    # Patent application
β”‚
└── README.md                      # This file

πŸŽ“ Use Cases

mindmap
  root((RTGS Analyzer))
    Banking Sector
      AML Compliance
      Fraud Detection
      Transaction Monitoring
      Regulatory Reporting
    Financial Institutions
      Risk Management
      Customer Due Diligence
      Suspicious Activity Reports
      Internal Auditing
    Regulatory Bodies
      SEBI Oversight
      RBI Monitoring
      Compliance Checks
      Investigation Support
    Fintech Companies
      Payment Gateways
      Digital Wallets
      Peer-to-Peer Platforms
Loading

About

Advanced Transaction Chain RTGS Risk-Chain Analyzer

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors