Skip to content

Latest commit

Β 

History

37 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Suraksha Setu

Disaster Management & Response Platform

Suraksha Setu helps authorities efficiently issue emergency alerts, coordinate evacuations, manage disaster response, and support affected communities during recovery and rehabilitation. The project focuses on building a faster, safer, and more coordinated disaster-response ecosystem, bridging the gap between authorities and citizens during critical situations.

πŸ† Hackathon Achievement

πŸ₯ˆ 1st Runner-Up β€” CodeRush 2.0

Team Apex! proudly secured the 1st Runner-Up position at CodeRush 2.0, organized by Yeshwantrao Chavan College of Engineering (YCCE), Nagpur.

Project Name Suraksha Setu
Team Name Team Apex!
Team Leader Aditya Singh

🌟 Key Features

1. Real-Time Detection & Hazard Tracking

  • Interactive horizontal scrubber driven by satellite keyframes (capturing event onset, data gaps, and peak hazard footprints).
  • Dynamic Confidence Indicators (numeric 0.0–1.0 and visual tags).
  • Data-Gap Banner Warning explicitly alerting users when satellite coverage is unavailable and models interpolate growth.

2. Evacuation Planning & Decision Support (Human-in-the-Loop)

  • Rule-based decision generator (src/lib/planGenerator.js) calculating nearest safe relief shelters with available capacity and routing vectors.
  • Human-in-the-Loop Framework: Action cards require explicit commander review with Approve, Edit Directives, or Reject choices. Unapproved recommendations remain strictly labeled as draft directives.

3. Geospatial Impact Analysis (Turf.js)

  • Calculates flooded surface area in hectares.
  • Identifies at-risk hospitals and submerged road networks.

4. Activity Audit Stream

  • Timestamped log capturing satellite timeline scrubbing, plan generation, human approval actions, and emergency alert dispatches.

5. Emergency Alert Center

  • Minimal Express backend endpoint (POST /api/send-alert) for transmitting emergency transactional alerts to district response command nodes.

πŸ“Š Data Provenance & Credits

Data Type Source
Satellite Flood Extents Dartmouth Flood Observatory (DFO) / Sentinel-1 SAR observations
Infrastructure (Hospitals, Shelters, Roads, Rivers) OpenStreetMap via Overpass API, under the Open Database License (ODbL)
Operational Datasets Reservoir levels (sensor_log.json) and shelter capacity limits (shelters_capacity.json), integrated as live operational data feeds

πŸ› οΈ Tech Stack

  • Frontend: React (v18), Vite, Tailwind CSS, Lucide Icons, Recharts
  • Geospatial & Mapping: Leaflet, react-leaflet, @turf/turf
  • Backend: Node.js, Express, Nodemailer

πŸš€ Quickstart & Installation

1. Install Dependencies

npm install

2. Start Project (Frontend + Express Backend)

npm run dev:all
  • Frontend App: http://localhost:5173
  • Express Backend API: http://localhost:3001

3. Build Production Bundle

npm run build

4. Deploy to Vercel + Render

See DEPLOYMENT.md for the full hosting walkthrough.


πŸ—οΈ System Architecture

flowchart TB
    USER["Emergency Commander"]

    subgraph FRONTEND["React + Vite Command Interface"]
        CC["Command Centre"]
        MAP["Command Map"]
        RP["Response Planner"]
        AC["Alert Centre"]
        AL["Activity Log"]
        TS["Timeline Scrubber"]
    end

    subgraph DATA["Historical & Operational Data"]
        SAT["Historical Satellite Flood Extents"]
        INFRA["Infrastructure GeoJSON<br/>Hospitals / Shelters / Roads / Rivers"]
        SENSOR["Synthetic Sensor Data"]
        CAP["Shelter Capacity Data"]
        TIMELINE["Event Timeline"]
    end

    subgraph ENGINE["Decision & Analysis Layer"]
        IMPACT["Turf.js Impact Analysis"]
        PLAN["Rule-Based Plan Generator"]
        CONF["Confidence / Data-Gap Logic"]
        AUDIT["Activity Logger"]
    end

    subgraph BACKEND["Express Backend"]
        API["POST /api/send-alert"]
        MAIL["Transactional Alert Service"]
    end

    USER --> CC
    USER --> MAP
    USER --> RP
    USER --> AC
    USER --> AL

    TS --> TIMELINE
    TIMELINE --> CONF
    SAT --> MAP
    SAT --> CONF

    INFRA --> MAP
    INFRA --> IMPACT
    SENSOR --> IMPACT
    CAP --> PLAN
    INFRA --> PLAN
    IMPACT --> PLAN

    CONF --> CC
    IMPACT --> CC
    PLAN --> RP

    RP --> AUDIT
    TS --> AUDIT
    AC --> API
    API --> MAIL

    AUDIT --> AL
Loading

πŸ”„ End-to-End Disaster Response Workflow

flowchart TD
    START["Disaster Event"] --> DATA["Load Data"]

    DATA --> SAT["Satellite Flood Extent"]
    DATA --> INFRA["Infrastructure Data"]
    DATA --> SENSOR["Sensor / Reservoir Data"]
    DATA --> SHELTER["Shelter Capacity Data"]

    SAT --> TIME["Timeline Scrubber"]

    TIME --> CHECK{"Satellite Data Available?"}

    CHECK -->|Yes| FLOOD["Display Observed Flood Extent"]
    CHECK -->|No| GAP["Display Data-Gap Warning"]

    GAP --> INTERP["Interpolate Flood Growth"]
    INTERP --> CONF["Lower Confidence"]

    FLOOD --> CONF2["Calculate Confidence"]

    CONF --> IMPACT["Geospatial Impact Analysis"]
    CONF2 --> IMPACT

    IMPACT --> AREA["Flooded Area"]
    IMPACT --> HOSP["At-Risk Hospitals"]
    IMPACT --> ROADS["Affected Roads"]

    AREA --> PLAN["Generate Response Plan"]
    HOSP --> PLAN
    ROADS --> PLAN
    SHELTER --> PLAN

    PLAN --> ROUTE["Find Suitable Shelters<br/>and Routing Options"]

    ROUTE --> REVIEW{"Commander Review"}

    REVIEW -->|Edit| EDIT["Edit Directives"]
    EDIT --> REVIEW

    REVIEW -->|Reject| REJECT["Reject Recommendation"]
    REVIEW -->|Approve| APPROVE["Approve Directive"]

    APPROVE --> ALERT["Emergency Alert"]
    ALERT --> API["Express Alert API"]
    API --> DISPATCH["Dispatch to Response Node"]

    REJECT --> LOG["Audit Activity"]
    DISPATCH --> LOG
    REVIEW --> LOG
    TIME --> LOG

    LOG --> ACTIVITY["Activity Audit Stream"]
Loading

πŸ‘€ Human-in-the-Loop Decision Workflow

flowchart LR
    DATA["Flood + Infrastructure<br/>Data"]

    DATA --> ANALYSIS["Impact Analysis"]
    ANALYSIS --> ENGINE["Rule-Based<br/>Decision Generator"]

    ENGINE --> DRAFT["Draft Response Directive"]

    DRAFT --> REVIEW["Emergency Commander"]

    REVIEW --> DECISION{"Commander Decision"}

    DECISION -->|Approve| APPROVED["Approved Directive"]
    DECISION -->|Edit| EDIT["Edit Directive"]
    DECISION -->|Reject| REJECTED["Rejected Directive"]

    EDIT --> REVIEW

    APPROVED --> ALERT["Dispatch Emergency Alert"]
    REJECTED --> AUDIT["Audit Log"]
    ALERT --> AUDIT

    DRAFT -.->|"Never automatically executed"| ALERT
Loading

πŸ“‘ Hazard Replay

sequenceDiagram
    actor Commander
    participant UI as Timeline Scrubber
    participant Data as Historical Dataset
    participant Analysis as Impact Analysis
    participant Map as Command Map
    participant Audit as Activity Logger

    Commander->>UI: Select historical date
    UI->>Data: Request keyframe

    alt Satellite data available
        Data-->>UI: Observed flood extent
        UI->>Analysis: Calculate impact
        Analysis-->>Map: Flood extent + affected assets
        Map-->>Commander: Display observed conditions
    else Data gap
        Data-->>UI: No satellite coverage
        UI-->>Commander: Show data-gap warning
        UI->>Analysis: Interpolate flood growth
        Analysis-->>Map: Estimated conditions
        Map-->>Commander: Display lower-confidence estimate
    end

    UI->>Audit: Record timeline interaction
    Analysis->>Audit: Record analysis result
Loading

πŸ“ Directory Structure

.
β”œβ”€β”€ public/data/
β”‚   β”œβ”€β”€ hospitals.geojson          # Named hospitals in Alappuzha/Kottayam
β”‚   β”œβ”€β”€ shelters.geojson           # Schools & community centres
β”‚   β”œβ”€β”€ roads.geojson              # Highway & secondary road network
β”‚   β”œβ”€β”€ rivers.geojson             # Waterways & river vectors
β”‚   β”œβ”€β”€ flood_20180814.geojson     # Aug 14 satellite flood extent
β”‚   β”œβ”€β”€ flood_20180817.geojson     # Aug 17 peak flood extent
β”‚   β”œβ”€β”€ event_timeline.json        # Keyframe scrubber dataset
β”‚   β”œβ”€β”€ sensor_log.json            # Hydro gauge & dam capacity feed
β”‚   └── shelters_capacity.json     # Capacity metrics & facility specs
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ ActivityFeedItem.jsx
β”‚   β”‚   β”œβ”€β”€ AlertComposer.jsx
β”‚   β”‚   β”œβ”€β”€ ConfidenceBadge.jsx
β”‚   β”‚   β”œβ”€β”€ DataGapBanner.jsx
β”‚   β”‚   β”œβ”€β”€ LayerToggle.jsx
β”‚   β”‚   β”œβ”€β”€ MapView.jsx
β”‚   β”‚   β”œβ”€β”€ Navbar.jsx
β”‚   β”‚   β”œβ”€β”€ PlanCard.jsx
β”‚   β”‚   └── TimelineScrubber.jsx
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ activityLogger.js      # Shared audit logger context & hook
β”‚   β”‚   β”œβ”€β”€ impactEstimate.js      # Turf.js spatial analysis
β”‚   β”‚   └── planGenerator.js       # Decision support algorithm
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ ActivityLog.jsx
β”‚   β”‚   β”œβ”€β”€ AlertCentre.jsx
β”‚   β”‚   β”œβ”€β”€ CommandCentre.jsx
β”‚   β”‚   β”œβ”€β”€ CommandMap.jsx
β”‚   β”‚   └── ResponsePlanner.jsx
β”‚   β”œβ”€β”€ state/
β”‚   β”‚   └── AppContext.jsx          # Global application state
β”‚   β”œβ”€β”€ App.jsx
β”‚   β”œβ”€β”€ main.jsx
β”‚   └── index.css
β”œβ”€β”€ server/
β”‚   β”œβ”€β”€ index.js                   # Express server entry point
β”‚   β”œβ”€β”€ routes/sendAlert.js        # POST /api/send-alert handler
β”‚   └── .env.example
β”œβ”€β”€ package.json
└── README.md

Releases

Packages

Contributors

Languages