# timetraveler2o/shurakshanet-ai-paltform-for-cybercrime- architecture

> Architecture diagram of the GitHub repository timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-
- Repository: https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-

## Overview

##### Project Type and Purpose
- SurakshaNet is a React-based, single-page web application (SPA) built with TypeScript and Vite. It serves as a unified AI-powered dashboard for the Chandigarh Police Cybercrime Unit, integrating seven distinct investigative modules (fraud detection, deepfake analysis, facial recognition simulation, legal assistant chatbot, surveillance-analysis simulation, voice-phishing detection, and email-phishing detection).
- There is no custom backend in this codebase; all AI processing is delegated to the Google Gemini API via client-side service wrappers.

##### File-Structure Analysis
- Top-level files: App.tsx (root SPA entry), index.html/ index.tsx (Vite bootstrap), vite.config.ts, tailwind.config.cjs, tsconfig.json.
- /components: shared UI components (buttons, cards, headers, spinners, forms, notification system).
- /components/<moduleName>: module-specific UI implementations.
- /views: feature routing layer (one view per module: DhanRakshakView.tsx, SatyaDarpanView.tsx, etc.).
- /services: business-logic wrappers that package input, call the Google Gemini AI API (geminiService.ts), and parse responses for each module (e.g. dhanrakshakService.ts).
- /styles, /utils, /constants, /types: global styles, helper functions, shared constants, and TypeScript types.

##### README Insights
- Confirms a front-end SPA that calls Google Gemini AI for each feature.
- No database or persistent storage—data flows from user inputs → service calls → AI responses → UI display.
- Ethical guidelines and simulation disclaimers are informational only and not reflected in additional infrastructure.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Entry
    subgraph "Client (Browser)" 
        direction TB
        A1["index.html"]:::client
        A2["index.tsx"]:::client
        A3["App.tsx"]:::client
    end

    %% Presentation Layer
    subgraph "Presentation Layer" 
        direction TB

        subgraph "Shared UI Components" 
            direction TB
            UI1["components/"]:::shared
            UI2["ModuleCard"]:::shared
            UI3["ElegantButton"]:::shared
            UI4["NotificationSystem"]:::shared
            UI5["LoadingSpinner"]:::shared
        end

        subgraph "Views (Feature Routing)" 
            direction TB
            V1["DhanRakshakView"]:::view
            V2["SatyaDarpanView"]:::view
            V3["NetraTraceView"]:::view
            V4["SahayakCopBotView"]:::view
            V5["NigraniAIView"]:::view
            V6["VaaniShieldView"]:::view
            V7["KavachMailGuardView"]:::view
            V8["ReportsView"]:::view
            V9["SettingsView"]:::view
            V10["AnalyticsView"]:::view
        end
    end

    %% Feature Modules Components
    subgraph "Feature Modules" 
        direction TB

        subgraph "DhanRakshak Module" 
            direction TB
            D1["TransactionInputForm"]:::module
            D2["AnalysisResultDisplay"]:::module
            D3["LoadingSpinner"]:::module
            D4["dhanrakshakService"]:::service
        end

        subgraph "SatyaDarpan Module" 
            direction TB
            S1["MediaUploadForm"]:::module
            S2["DeepfakeResultDisplay"]:::module
            S3["LoadingSpinner"]:::module
            S4["satyadarpanService"]:::service
        end

        subgraph "NetraTrace Module (Simulation only)" 
            direction TB
            N1["ProbeImageUploadForm"]:::module
            N2["MatchResultsDisplay"]:::module
            N3["LoadingSpinner"]:::module
            N4["netratraceService"]:::service
        end

        subgraph "SahayakCopBot Module" 
            direction TB
            B1["ChatInputForm"]:::module
            B2["ChatWindow"]:::module
            B3["ChatMessageBubble"]:::module
            B4["LoadingSpinner"]:::module
            B5["sahayakcopbotService"]:::service
        end

        subgraph "NigraniAI Module (Simulation only)" 
            direction TB
            NI1["ImageUploadAndQueryForm"]:::module
            NI2["AnalysisDisplay"]:::module
            NI3["LoadingSpinner"]:::module
            NI4["nigraniaiService"]:::service
        end

        subgraph "VaaniShield Module" 
            direction TB
            VSh1["AudioUploadForm"]:::module
            VSh2["ScamAnalysisDisplay"]:::module
            VSh3["LoadingSpinner"]:::module
            VSh4["vaanishieldService"]:::service
        end

        subgraph "KavachMailGuard Module" 
            direction TB
            K1["EmailInputForm"]:::module
            K2["AnalysisResultDisplay"]:::module
            K3["RecentAnalyses"]:::module
            K4["kavachmailguardService"]:::service
        end
    end

    %% Service Layer
    subgraph "Service Layer" 
        direction TB
        G1["geminiService"]:::service
    end

    %% Shared Utilities & Types
    subgraph "Shared Utilities & Types" 
        direction TB
        U1["utils/"]:::util
        U2["constants.ts"]:::util
        U3["types.ts"]:::util
        U4["src/types/global.d.ts"]:::util
    end

    %% External AI API
    G2["Google Gemini API"]:::external

    %% Build & Deployment
    subgraph "Build & Deployment" 
        direction TB
        C1["vite.config.ts"]:::config
        C2["tailwind.config.cjs"]:::config
        C3["postcss.config.cjs"]:::config
        C4["tsconfig.json"]:::config
        C5["index.css"]:::config
    end

    %% Data Flow
    A3 -->|"renders"| UI1
    UI1 -->|"used by"| V1
    UI1 --> V2
    UI1 --> V3
    UI1 --> V4
    UI1 --> V5
    UI1 --> V6
    UI1 --> V7
    V1 -->|"onSubmit analyzeTransaction()"| D4
    D4 -->|"calls composePrompt()"| G1
    G1 -->|"HTTP request"| G2
    G2 -->|"response"| G1
    G1 -->|"returns typed result"| D4
    D4 -->|"parsed result"| V1
    V1 -->|"display"| D2

    %% Generic arrows for other modules
    V2 --> S4
    S4 --> G1
    G1 --> G2
    G1 --> S4
    V3 --> N4
    N4 --> G1
    G1 --> N4
    V4 --> B5
    B5 --> G1
    G1 --> B5
    V5 --> NI4
    NI4 --> G1
    G1 --> NI4
    V6 --> VSh4
    VSh4 --> G1
    G1 --> VSh4
    V7 --> K4
    K4 --> G1
    G1 --> K4

    %% Shared utilities usage
    D4 --> U1
    S4 --> U2
    N4 --> U1
    B5 --> U3
    NI4 --> U1
    VSh4 --> U2
    K4 --> U3

    %% Build & Deployment integration
    A2 --> C1
    A3 --> C2
    A2 --> C3
    A3 --> C4
    A3 --> C5

    %% Click Events
    click A1 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/index.html"
    click A2 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/index.tsx"
    click A3 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/App.tsx"
    click UI1 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/tree/main/components/"
    click UI2 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/components/ui/ModuleCard.tsx"
    click UI3 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/components/ElegantButton.tsx"
    click UI4 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/components/NotificationSystem.tsx"
    click UI5 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/components/LoadingSpinner.tsx"
    click V1 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/views/DhanRakshakView.tsx"
    click V2 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/views/SatyaDarpanView.tsx"
    click V3 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/views/NetraTraceView.tsx"
    click V4 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/views/SahayakCopBotView.tsx"
    click V5 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/views/NigraniAIView.tsx"
    click V6 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/views/VaaniShieldView.tsx"
    click V7 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/views/KavachMailGuardView.tsx"
    click V8 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/views/ReportsView.tsx"
    click V9 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/views/SettingsView.tsx"
    click V10 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/views/AnalyticsView.tsx"
    click D1 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/components/dhanrakshak/TransactionInputForm.tsx"
    click D2 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/components/dhanrakshak/AnalysisResultDisplay.tsx"
    click D3 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/components/dhanrakshak/LoadingSpinner.tsx"
    click D4 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/services/dhanrakshakService.ts"
    click G1 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/services/geminiService.ts"
    click U1 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/utils/scrollUtils.ts"
    click U2 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/constants.ts"
    click U3 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/types.ts"
    click U4 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/src/types/global.d.ts"
    click C1 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/vite.config.ts"
    click C2 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/tailwind.config.cjs"
    click C3 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/postcss.config.cjs"
    click C4 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/tsconfig.json"
    click C5 "https://github.com/timetraveler2o/shurakshanet-ai-paltform-for-cybercrime-/blob/main/index.css"

    %% Styles
    classDef client fill:#CCE5FF,stroke:#3399FF,color:#000
    classDef shared fill:#E0F7FA,stroke:#26A69A,color:#000
    classDef view fill:#BBDEFB,stroke:#1E88E5,color:#000
    classDef module fill:#C8E6C9,stroke:#43A047,color:#000
    classDef service fill:#AED581,stroke:#7CB342,color:#000
    classDef util fill:#E0E0E0,stroke:#9E9E9E,color:#000
    classDef external fill:#FFE0B2,stroke:#FB8C00,color:#000
    classDef config fill:#F5F5F5,stroke:#BDBDBD,color:#000
```
