Skip to content

krishnasahoo11156/crisissync

Repository files navigation


CrisisSync
Tagline



Flutter Dart Firebase Gemini AI

Cloud Run Docker Nginx License




The intelligence framework engineered for high-stakes environments where clarity saves lives.
Real-time crisis response • AI-powered triage • Multi-portal coordination • Built for hospitality venues


🚀 Live Demo · 📖 Documentation · 🧠 AI Features · 🛡️ Portals · ⚡ Deploy



🌐 Overview

CrisisSync is a real-time crisis response and emergency coordination platform purpose-built for hospitality venues. It combines AI-powered incident classification, real-time multi-channel synchronization, and role-based command interfaces to transform how hotels, resorts, and event venues respond to emergencies.

Built with the "Aegis Protocol" design system — a dark, atmospheric UI combining rigid technical precision with fluid depth — every pixel is engineered for high-pressure decision-making where seconds matter.

╔══════════════════════════════╗
║     ⚡ PERFORMANCE METRICS   ║
╠══════════════════════════════╣
║  Response Time    < 5 min    ║
║  AI Triage        < 3 sec    ║
║  Sync Latency     < 200ms   ║
║  Uptime Target    99.9%     ║
║  Severity Levels  5-tier     ║
║  Portal Types     3 roles    ║
╚══════════════════════════════╝

✨ Key Highlights

🧠 AI-Powered Real-Time 🛡️ Role-Based 📊 Analytics
Gemini classifies incidents, auto-generates severity scores, situation briefs & response checklists Dual-layer sync via Firebase RTDB + Firestore for sub-second event propagation Three dedicated portals: Guest, Staff, Admin — each with unique capabilities Live dashboards with ADI scores, heatmaps, trend charts & AI-generated reports

🛡️ Access Portals

🟢 Guest Portal

CLEARANCE LEVEL 1

Light-themed public interface


🚨 Emergency SOS — One-tap crisis reporting
📋 Concern Submission — Detailed incident forms
📡 Live Status Tracking — Real-time resolution updates
📜 Report History — Full personal incident log
Resolution Rating — Post-incident feedback

🔴 Staff Portal

CLEARANCE LEVEL 2

Dark-themed tactical interface


📥 Incident Inbox — Real-time assignment feed
🗺️ Live Map View — Google Maps integration
Action Checklists — AI-generated step-by-step
📊 ADI Score Gauge — Dynamic urgency meter
🔔 Push Notifications — FCM instant alerts

🟣 Admin Portal

CLEARANCE LEVEL 3

Full command & control interface


📈 Analytics Dashboard — Charts, trends, metrics
👥 Staff Management — Role-based team control
🏨 Venue Configuration — Section & location mapping
🤖 AI Briefings — Executive summaries on-demand
📋 Incident Oversight — Full triage & escalation


🧠 Gemini AI Intelligence

CrisisSync doesn't just log incidents — it thinks about them.

🔬 Incident Classification Engine

Every incoming report is processed through Gemini AI to extract:

  • crisisType — Fire, Medical, Security, Flood, Power
  • severity — 5-tier graduated scale (1→5)
  • situationBrief — 2-3 sentence tactical summary
  • suggestedAction — Primary recommended response
  • responseRole — Security / Medical / FrontDesk / Manager
  • checklist — 4-step action protocol
  • emotionalState — Calm → Panicked assessment

📊 ADI Score System

Aggregated Danger Index — a composite urgency metric:

╭─────────────────────────────────────╮
│  FACTOR              │  WEIGHT      │
├─────────────────────────────────────┤
│  Severity Level      │  0-40 pts    │
│  Time Elapsed        │  0-25 pts    │
│  Idle Duration       │  0-20 pts    │
│  Responder Count     │  0-15 pts    │
│  Crisis Type Mult.   │  0.9x-1.3x  │
╰─────────────────────────────────────╯
        Total Score: 0-100
  🟢 Safe  🟡 Caution  🔴 Critical
🤖 More AI Capabilities
Feature Description
📝 Post-Incident Reports Auto-generated formal reports for hotel records with timeline, actions, and prevention recommendations
📋 Executive Briefings On-demand AI summaries of all active incidents for management decision-making
📊 Monthly Analytics AI-generated trend analysis, staff performance highlights, and strategic recommendations
🔄 Shift Handover Reports Automated shift-change documentation with pending items and performance data
🔥 Hotspot Analysis Pattern detection across incident locations with cause analysis and prevention insights
🔑 API Key Rotation Automatic key rotation on rate-limit (429) errors across 5-key pool for zero-downtime AI

🏗️ Architecture

┌─────────────────────────────────────────────────────────────────┐
│                        CrisisSync Architecture                  │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  ┌──────────┐    ┌──────────┐    ┌──────────┐                  │
│  │  GUEST   │    │  STAFF   │    │  ADMIN   │    ← Portals     │
│  │  Portal  │    │  Portal  │    │  Portal  │                  │
│  └────┬─────┘    └────┬─────┘    └────┬─────┘                  │
│       │               │               │                         │
│       └───────────────┼───────────────┘                         │
│                       │                                         │
│              ┌────────▼────────┐                                │
│              │   GoRouter +    │  ← Navigation Layer            │
│              │   Provider      │                                │
│              └────────┬────────┘                                │
│                       │                                         │
│       ┌───────────────┼───────────────┐                         │
│       │               │               │                         │
│  ┌────▼─────┐   ┌─────▼────┐   ┌─────▼────┐                   │
│  │ Firebase  │   │ Firebase │   │  Gemini  │   ← Backend       │
│  │   Auth    │   │ Firestore│   │    AI    │                    │
│  └──────────┘   │  + RTDB  │   └──────────┘                    │
│                  └──────────┘                                    │
│                       │                                         │
│              ┌────────▼────────┐                                │
│              │   FCM + Email   │  ← Notifications               │
│              │   Services      │                                │
│              └─────────────────┘                                │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

🔧 Tech Stack

Layer Technology Purpose
Flutter Flutter Web Cross-platform UI framework
Dart Dart 3.x Type-safe language with null safety
Firebase Firebase Auth Role-based authentication (Admin/Staff/Guest)
Firestore Cloud Firestore Persistent incident data & configuration
RTDB Realtime Database Sub-second event synchronization
FCM Cloud Messaging Push notifications & in-app alerts
Gemini Gemini AI Incident classification & report generation
Maps Google Maps Live venue mapping & incident pinpointing
Docker Docker + Nginx Containerized production deployment
GCP Cloud Run Serverless container hosting

🎨 Design System — "The Orchestrated Pulse"

Built for high-stakes decision-making under pressure. Combines rigid, technical precision with fluid, atmospheric depth.

🎭 Color Palette

 VOID BACKGROUNDS
 ██ #0E0E13  void (deepest)
 ██ #131319  surface
 ██ #19191F  surface container
 ██ #1F1F26  elevated
 ██ #25252D  surface highest

 SIGNAL COLORS
 ██ #B6A0FF  Royal Purple (authority)
 ██ #68FADD  Signal Teal (resolution)
 ██ #FF716C  Crisis Red (danger)
 ██ #FFB74D  Amber Alert (warning)

✏️ Typography System

Role Font Usage
Display Space Grotesk Headlines & hero text
Body Manrope Content & UI labels
Mono JetBrains Mono Data, timestamps, IDs

📐 Spacing & Shape

  • Grid: 8px base unit system
  • Radius: 8px buttons · 12px cards · 16px modals
  • Motion: 150ms fast · 300ms normal · 500ms slow

📁 Project Structure

crisissync/
├── 📂 lib/
│   ├── 📂 config/
│   │   ├── 🎨 theme.dart              # Aegis Protocol design system
│   │   ├── 🔀 router.dart             # GoRouter navigation config
│   │   ├── 🔥 firebase_config.dart    # Firebase initialization
│   │   └── 🔐 env.dart                # Environment variables
│   ├── 📂 models/
│   │   ├── 🚨 incident_model.dart     # Core incident data model
│   │   ├── 👤 user_model.dart         # User & role definitions
│   │   ├── 🏨 venue_model.dart        # Venue section mapping
│   │   └── 📊 analytics_model.dart    # Analytics data structures
│   ├── 📂 providers/
│   │   ├── 🔑 auth_provider.dart      # Authentication state
│   │   ├── 📡 incident_provider.dart  # Incident state management
│   │   └── 👥 staff_provider.dart     # Staff data provider
│   ├── 📂 screens/
│   │   ├── 🏠 landing_screen.dart     # Glassmorphism landing page
│   │   ├── 🔐 auth_screen.dart        # Authentication portal
│   │   ├── 📂 admin/                  # Admin command center (6 screens)
│   │   ├── 📂 staff/                  # Staff tactical interface (5 screens)
│   │   └── 📂 guest/                  # Guest portal (5 screens)
│   ├── 📂 services/
│   │   ├── 🤖 gemini_service.dart     # AI classification & reports
│   │   ├── 🔑 auth_service.dart       # Firebase Auth wrapper
│   │   ├── 🚨 incident_service.dart   # Incident CRUD operations
│   │   ├── 📊 analytics_service.dart  # Data aggregation
│   │   ├── 📧 email_service.dart      # Automated email dispatch
│   │   ├── 🔔 fcm_service.dart        # Push notification handler
│   │   ├── 📡 rtdb_service.dart       # Realtime DB sync layer
│   │   ├── 📍 location_service.dart   # Geolocation utilities
│   │   └── 🌱 seed_service.dart       # Demo data seeder
│   └── 📂 widgets/
│       ├── 🃏 glass_card.dart         # Glassmorphism card component
│       ├── 🚨 incident_card.dart      # Incident display card
│       ├── 📊 adi_score_gauge.dart    # ADI circular gauge widget
│       ├── 🏷️ severity_badge.dart     # Color-coded severity tag
│       ├── 🔔 notification_bell.dart  # Animated notification icon
│       └── ⋯  6 more components
├── 🐳 Dockerfile                      # Nginx Alpine container
├── ☁️ cloudbuild.yaml                 # GCP Cloud Build pipeline
├── 🚀 deploy.ps1                      # PowerShell deploy script
├── 🔒 firestore.rules                 # Security rules
└── 📦 pubspec.yaml                    # Dependencies manifest

🔄 Incident Lifecycle

  ┌─────────┐     ┌──────────┐     ┌────────────┐     ┌───────────┐     ┌──────────┐
  │  GUEST   │────▶│  GEMINI  │────▶│   STAFF    │────▶│ RESPONDING│────▶│ RESOLVED │
  │ REPORTS  │     │ CLASSIFIES│    │  ACCEPTS   │     │  ON-SITE  │     │ + REPORT │
  └─────────┘     └──────────┘     └────────────┘     └───────────┘     └──────────┘
       │               │                 │                  │                │
       ▼               ▼                 ▼                  ▼                ▼
   SOS Button      Severity 1-5     Push Alert via     Checklist        AI generates
   + Details       + Crisis Type    FCM + Email        tracking +       post-incident
   + Room #        + Checklist      + Assignment       ADI scoring      report
                   + Brief                              + Timeline

🚀 Quick Start

Prerequisites

Requirement Version
Flutter SDK >= 3.11.4
Dart SDK >= 3.x
Firebase CLI Latest
Google Maps API Key Active
Node.js (for Firebase tools) >= 18

Installation

# 1 → Clone the repository
git clone https://github.com/krishnasahoo/crisissync.git
cd crisissync

# 2 → Install dependencies
flutter pub get

# 3 → Configure Firebase
#     Ensure firebase.json and .firebaserc match your project
flutterfire configure

# 4 → Deploy Firestore rules & indexes
firebase deploy --only firestore:rules,firestore:indexes

# 5 → Launch development server
flutter run -d chrome --web-port=8080

Environment Setup

Create your environment configuration in lib/config/env.dart:

class Env {
  static const String geminiBaseUrl = 'YOUR_GEMINI_ENDPOINT';
  static const String mapsApiKey   = 'YOUR_GOOGLE_MAPS_KEY';
  static const String emailApiUrl  = 'YOUR_EMAIL_SERVICE_URL';
}

☁️ Deployment

🐳 Docker Build

# Build the Flutter web app
flutter build web --release

# Build Docker image
docker build -t crisissync-web .

# Run locally
docker run -p 8080:8080 crisissync-web

☁️ Google Cloud Run

# Using the deploy script
./deploy.ps1

# Or via Cloud Build
gcloud builds submit --config=cloudbuild.yaml

# Manual deploy
gcloud run deploy crisissync-web \
  --image gcr.io/PROJECT_ID/crisissync-web \
  --platform managed \
  --region asia-south1 \
  --allow-unauthenticated

🔒 Security

  • Firebase Auth — Role-based access control (admin / staff / guest)
  • Firestore Rules — Granular document-level security policies
  • RTDB Rules — Validated write access with role verification
  • API Key Rotation — Automatic Gemini key cycling on rate limits
  • HTTPS Only — Cloud Run enforces TLS termination

📦 Full Dependency List
Category Package Version
Firebase firebase_core ^3.13.0
firebase_auth ^5.5.2
cloud_firestore ^5.6.6
firebase_database ^11.3.5
firebase_messaging ^15.2.5
Routing go_router ^14.8.1
UI/UX google_fonts ^6.2.1
flutter_animate ^4.5.2
fl_chart ^0.70.2
Maps google_maps_flutter ^2.12.1
google_maps_flutter_web ^0.5.10
Utilities http ^1.3.0
intl ^0.20.2
uuid ^4.5.1
shared_preferences ^2.5.3
url_launcher ^6.3.1
provider ^6.1.4

🤝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request



CrisisSyncBecause every second counts.

Built with ❤️ using Flutter, Firebase & Gemini AI

© 2024 CrisisSync Intelligence · Operational Protocol Alpha-6

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages