CrisisCore is an end-to-end, real-time disaster management and emergency logistics platform. Built upon an 8-stage closed-loop operational pipeline and an Admin 3-Channel Communication Hub, the system connects distressed citizens, multi-depot relief warehouses, emergency dispatchers, and field rescue teams under sub-15ms event latency.
CrisisCore structures emergency operations into eight synchronized, deterministic stages:
flowchart TD
S1["1. Admin Dashboard<br/>(Master Fleet, Multi-Depot Inventory & Mission Control)"]
S1 --> S2["2. Resource Manager<br/>(Water, Food, Trauma Kits, Ambulances, Rescue Squads)"]
S1 --> S3["3. Incident Manager<br/>(Structured Triage, Casualty Counts & Resource Needs)"]
S2 --> S4["4. AI Resource Allocation Engine<br/>(Random Forest Priority Scoring, Hungarian Matcher, PuLP ILP)"]
S3 --> S4
S4 --> S5["5. Human-in-the-Loop Approval<br/>(Admin Reviews, Modifies Supplies, Adjusts Stops, Approves/Rejects)"]
S5 --> S6["6. Mission Dispatch System<br/>(Locks Depot Stock, Generates Orders & Dispatches over WebSockets)"]
S6 --> S7["7. Responder Application<br/>(Sequential 3-to-4 Stop Itinerary, Digital Delivery Handover)"]
S7 --> S8["8. Live Tracking & Monitoring<br/>(Real-Time GPS Telemetry, Stock Decrementing, Reallocation Trigger)"]
S8 -.->|Dynamic Disruption Reallocation| S4
To prevent radio congestion and data leaks during acute crises, operational communications are split into three isolated Socket.IO channels:
graph TD
Admin(("π‘οΈ Admin Command"))
Admin <-->|"Channel 1: Supply Ledger & Restocking"| RM["π¦ Resource Manager"]
Admin <-->|"Channel 2: Casualty Intake & Triage Priority"| IM["π¨ Incident Manager"]
Admin <-->|"Channel 3: Tactical Dispatch & Field Orders"| Resp["π Field Responders"]
- Tracks physical consumable stock across regional depots:
- Drinking Water (Litres)
- Emergency Food Rations (Meal packs)
- Medical Trauma Kits (ALS/BLS kits)
- Emergency Ambulances (Type-A Rapid Response)
- Search & Rescue Squads (Trained teams)
- Heavy Disaster Equipment (Sump pumps, cutting rigs)
- Instant warehouse replenishment module with real-time database persistence.
- Ingests emergency distress calls via citizen portal (
sos.htmland in-app#civilianView). - Captures exact casualty numbers, emergency category (
MEDICAL,FIRE,COLLAPSE,FLOOD,SECURITY,HAZMAT), situational notes, and structured Resource Needs. - Sub-second NLP priority scoring assigns calibrated urgency tiers (
CRITICAL,HIGH,MEDIUM,LOW).
-
Machine Learning Priority Model (
ml/priority_model.py):- Calibrated Random Forest Classifier trained on multi-modal emergency datasets with TF-IDF NLP n-gram embeddings and standardized casualty indicators.
- Generates continuous urgency scores (
$0.00$ to$1.00$ ), class probabilities, and human-readable decision factors.
-
Multi-Depot Proximity Matcher (
ml/resource_matcher.py):- Automatically matches incident demands with the nearest regional depots via Haversine distance, detects supply deficits, and calculates fulfillment ratios.
-
Hungarian Bipartite Dispatcher (
ml/optimizer.py):- Solves optimal 1-to-1 responder-to-incident pairing via
scipy.optimize.linear_sum_assignmentconsidering transit distance, urgency penalty, and vehicle specialization.
- Solves optimal 1-to-1 responder-to-incident pairing via
-
Integer Linear Programming (ILP) Solver (
ml/optimizer.py):- Uses
pulp(CBC solver) to solve multi-commodity cargo distribution subject to vehicle payload weight constraints and depot stock bounds.
- Uses
-
Sequential Route Planner (
ml/router.py):- Generates 3-to-4 stop itineraries: Depot Pickup
$\rightarrow$ Incident Scene Delivery$\rightarrow$ Hospital/Base Return with leg distances (km) and estimated travel times (mins).
- Generates 3-to-4 stop itineraries: Depot Pickup
- AI recommendations are presented in an interactive review modal (
#humanApprovalModal). - The Admin holds full modification authority:
- Adjust allocated supply quantities up or down.
- Reassign the dispatched responder unit.
- Inspect the sequential stop order and mission itinerary.
- One-click Approve & Dispatch or Reject.
- Touch-friendly mobile interface for paramedics and rescue crews.
- Step-by-step sequential stop tracking with single-tap Confirm Delivery at Stop.
- Closed-Loop Stock Decrementing: Confirmed deliveries permanently deduct allocated supplies from the SQLite database in real time.
- Dynamic Reallocation: Single-tap vehicle breakdown trigger that automatically releases the incident and dispatches an alternate unit.
- Packaged with Capacitor 8.5 for high-performance native WebView execution.
- Features an off-canvas slide-out drawer menu (
#sidebarBackdrop) and a thumb-accessible 5-tab bottom navigation bar (Command,Map,SOS,Units,Menu). - Native hardware GPS integration with cross-platform network bridging (
http://10.0.2.2:3001on emulator / LAN IP on physical phones).
| Component | Selected Technology | Alternative Considered | Why Selected? Why NOT Alternative? |
|---|---|---|---|
| Frontend Core | HTML5 + Vanilla JS (ES6) + Vite | React / Next.js | Sub-millisecond DOM updates, zero virtual DOM reconciliation overhead, instant load on low-powered mobile devices in disaster zones. React bundles add 300KB+ runtime overhead. |
| Design System | Custom High-Contrast CSS (#0a0f1d) |
Tailwind CSS / Bootstrap | Tactical dark theme engineered specifically for emergency legibility; zero utility class bloat, GPU-accelerated drawer animations. |
| Backend Gateway | Node.js + Express.js | Python Django / Spring Boot | Non-blocking asynchronous event loop handles concurrent real-time I/O effortlessly. Single language across stack allows shared validation schemas. |
| Real-Time Layer | Socket.IO (Engine.IO v4) | Raw WebSockets | Built-in rooms and namespaces (channel:1, channel:2, channel:3), automated reconnection, and transparent HTTP long-polling fallback. |
| Database & ORM | Prisma ORM + SQLite / PostgreSQL | MongoDB / Raw SQL | Strict relational integrity between Users, Incidents, Allocations, and Delivery Confirmation logs. Type-safe queries prevent schema drift during rapid concurrent dispatches. |
| AI / ML Engine | Python 3.12 + FastAPI + Scikit-Learn | Pure LLM Prompting | Sub-5ms deterministic inference without API token costs or hallucination risk; calibrated probability distributions and feature importance metrics. |
| Optimization Solver | PuLP (CBC) + SciPy Linear Assignment | Manual Greedy Dispatch | Mathematical guarantees of minimal travel distance and maximum demand satisfaction under vehicle payload constraints. |
| Mobile Runtime | Capacitor 8.5 (Android Bridge) | Flutter / React Native | 100% codebase reuse with zero UI drift, direct access to Android hardware GPS, single-command Gradle compilation. |
| Tactical Mapping | Leaflet.js + CartoDB Dark Matter | Google Maps API | 100% open-source, zero API cost/rate limits, offline tile caching support, and ultra-lightweight (<40KB) footprint. |
CrisisCore/
βββ index.html # Master Command Center (Admin, Resource Manager, Incident Manager, Responders)
βββ sos.html # Standalone Citizen SOS Emergency Intake Portal
βββ package.json # Scripts: dev, build, server, ml:train, ml:start, android:sync
βββ capacitor.config.json # Android native WebView and cleartext HTTP bridge config
βββ src/
β βββ main.js # Frontend controllers (Human-in-the-Loop modal, 3 channels, inventory ledger)
β βββ sos.js # Public SOS intake & live GPS streaming
β βββ apiConfig.js # Dynamic cross-platform network & emulator routing
β βββ style.css # Tactical dark-theme design tokens & responsive drawer layouts
βββ android/ # Native Android Studio Gradle Project (Capacitor)
β βββ app/src/main/ # AndroidManifest.xml (GPS permissions, cleartext HTTP config)
βββ server/ # Express + Socket.IO Backend Server
β βββ src/
β β βββ index.js # Gateway entry & WebSocket room setup
β β βββ routes/ # REST routes: /incidents, /resources, /assignments, /chat, /auth
β β βββ services/
β β β βββ mlClient.js # Bridge client connecting Express to Python FastAPI microservice
β β βββ ws/
β β βββ socketHandler.js # Real-time event broadcaster & channel room multiplexer
β βββ prisma/
β βββ schema.prisma # Relational database models (multi-depot stock, multi-stop missions)
β βββ seed.js # Comprehensive multi-role disaster demo seed data
βββ ml/ # Machine Learning & Algorithmic Optimization Subsystem
β βββ app.py # FastAPI microservice (/evaluate, /optimize, /route, /health)
β βββ dataset.py # Multi-modal emergency disaster dataset generator
β βββ train_priority_model.py # Model trainer & benchmark (Random Forest, Gradient Boosting, Logistic)
β βββ priority_model.py # Production inference & calibrated urgency scoring
β βββ resource_matcher.py # Multi-depot proximity relief inventory matcher
β βββ optimizer.py # Hungarian Bipartite Matcher & PuLP ILP solver
β βββ router.py # Sequential multi-stop mission route planner
β βββ requirements.txt # Python dependencies (scikit-learn, pulp, fastapi, uvicorn)
β βββ models/
β βββ priority_classifier.joblib # Serialized production pipeline
β βββ metrics.json # Benchmark results and classification reports
βββ screenshots/ # Verified interface screenshots for presentations & reports
- Node.js: v18+ (v20+ recommended)
- Python: v3.10+ (v3.12 recommended)
- Android Studio (Optional, for Android APK compilation)
# Clone the repository
git clone https://github.com/RghavSrdhtra/CrisisCore.git
cd CrisisCore
# Install root dependencies
npm install
# Install backend dependencies
cd server
npm install
# Push database schema & seed demo data
npm run prisma:push
npm run prisma:seed
cd ..
# Install Python ML dependencies
pip install -r ml/requirements.txtOpen three terminal tabs to run the full stack:
Terminal 1 β Python AI & Optimization Microservice (Port 8000):
npm run ml:start
# Running on http://127.0.0.1:8000Terminal 2 β Node.js Express Gateway & WebSockets (Port 3001):
npm run server
# Running on http://localhost:3001Terminal 3 β Frontend Web Console (Port 5173):
npm run dev
# Running on http://localhost:5173# Synchronize frontend build with Android assets
npm run android:sync
# Open project in Android Studio
npm run android:openRun on any connected physical Android device or Android Virtual Device (AVD). The app automatically bridges to your local PC backend via http://10.0.2.2:3001.
| Persona | Role | Default Email | Password | Primary Console |
|---|---|---|---|---|
| Marcus Wright | ADMIN |
admin@crisiscore.dev |
admin123 |
Master Command Center, Human-in-the-Loop Approval, 3-Channel Comms |
| Dev Sharma | COORDINATOR |
coord@crisiscore.dev |
coord123 |
Tactical Triage, Incident Dispatch, Live Map Telemetry |
| Sarah Jenkins | RESOURCE_MANAGER |
resource@crisiscore.dev |
resource123 |
Multi-Depot Inventory Ledger, Quick Stock Replenishment |
| Priya Patel | INCIDENT_MANAGER |
incident@crisiscore.dev |
incident123 |
Live Incident Feed, Severity Overrides, Resource Demands |
| Carlos Vance | RESPONDER |
responder@crisiscore.dev |
resp123 |
Responder Terminal (MEDIC-01), Stop Itinerary, Delivery Confirmation |
| Jane Doe | CIVILIAN |
civilian@crisiscore.dev |
civilian123 |
SOS Emergency Portal, Voluntary GPS Sharing, 4-Stage Tracker |
Run the automated end-to-end integration test:
python scratch/test_e2e_integration.pyThis script executes all 8 stages sequentially:
- Queries live depot inventory in SQLite.
- Submits an SOS distress signal with text descriptions and requested supplies.
- Triggers the Python Random Forest model for NLP priority evaluation.
- Invokes Hungarian matching and PuLP ILP to pair the optimal vehicle and depot stock.
- Generates a 3-stop sequential mission itinerary.
- Executes Admin approval to lock inventory and issue WebSocket dispatches.
- Simulates responder arrival at the scene and confirms delivery.
- Verifies that warehouse stock is permanently decremented in real time.
This project is licensed under the MIT License β see the LICENSE file for details.