Skip to content

SyedArmanAli2003/ResQNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

47 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ResQNet β€” Smart Crisis Response Platform

Google Solution Challenge 2026 Β· Built with Firebase Β· Powered by Gemini AI


πŸ†˜ What is ResQNet?

ResQNet is a real-time community crisis response and resource-allocation platform designed to bridge the gap between people who need emergency help and the coordinators + volunteers who can deliver it. In disaster-prone or resource-constrained communities, traditional emergency channels are often slow, opaque, or inaccessible. ResQNet solves this by combining:

  • A citizen-facing reporter app to send structured SOS reports in seconds
  • A coordinator dashboard powered by Gemini AI to triage, prioritize, and dispatch volunteers
  • A volunteer registry so field responders can self-register and be matched to incidents automatically
  • A community resources hub with local helplines and crowd-sourced resource listings

All data is synchronized in real-time via Firebase Firestore, making the platform resilient and responsive even during fast-moving crises.


🎯 Problem Statement

Every year, thousands of people in under-served communities face emergencies β€” floods, medical crises, conflict, displacement β€” where first responders either don't receive timely information or can't efficiently allocate limited volunteers and resources. Manual coordination (calls, WhatsApp groups, spreadsheets) is error-prone and slow.

ResQNet solves three root problems:

  1. Fragmented reporting β€” citizens have no structured way to report local crises
  2. Slow triage β€” coordinators can't quickly judge severity across multiple incoming reports
  3. Inefficient dispatch β€” volunteers are assigned manually without proximity or skill matching

✨ Key Features

🏠 Landing Page (index.html)

  • Animated dark-mode hero with a live blinking "Crisis Response Network" badge
  • Two clear entry points: "I need help" (citizen) and "I'm a coordinator"
  • System status pills (operational Β· real-time sync Β· secure login)
  • Responsive layout that stacks on mobile

πŸ” Authentication (auth.html)

  • Tabbed UI β€” Sign In / Create Account on a single page
  • Email/Password sign-in with Firebase Auth
  • Google OAuth sign-in via popup β€” one-click onboarding
  • Forgot password flow with email reset link
  • Account creation stores full profile (name, phone, address, role) to Firestore users collection
  • Auto-redirect if already signed in
  • Friendly inline error messages for all common failure modes

πŸ“‘ Reporter Dashboard (reporter.html)

The main interface for citizens and field users after sign-in.

SOS Button

  • Giant hold-to-activate circle button with an animated SVG progress ring
  • Hold for 2 seconds to trigger the report flow β€” prevents accidental submissions
  • On hold: button scales down, progress ring fills

GPS & Reverse Geocoding

  • Automatically captures GPS coordinates via the browser Geolocation API
  • Uses Nominatim (OpenStreetMap) to resolve coordinates β†’ a human-readable address
  • Falls back gracefully if GPS is denied

Voice-to-Text Recording

  • In-modal microphone button using the Web Speech API
  • 15-second countdown with live status updates
  • Captured transcript is stored alongside the report for AI triage context

Crisis Category Selection

Five incident types, each mapped to a triage level:

Category Icon Default Triage
Medical πŸ₯ Critical (Level 1)
Disaster 🌊 Severe (Level 2)
Conflict βš”οΈ Moderate (Level 3)
Resource πŸ“¦ Minor (Level 4)
Hospitality 🏠 Monitoring (Level 5)

Gemini AI Triage

After submission, the app silently calls Gemini 2.5 Flash (falling back to 1.5 Flash) with:

  • Incident type, description, voice transcript, and location
  • Returns a structured JSON: { level, levelName, color, reasoning, volunteerTypes, estimatedMinutes }
  • The triage result is saved back to Firestore and shown in the success modal
  • A fallback rule engine activates if all Gemini models fail (keyword-based heuristics)

Incident Feed

  • Live Firestore onSnapshot listener β€” no page refresh needed
  • Active incidents rendered as cards sorted by severity
  • Each card shows: level, time, type, location, description
  • "Mark resolved" button on each card updates Firestore status to resolved
  • Real-time stats: active / deployed / resolved counts in the header

Timeline Logging

  • Every significant event (report created, triage complete) writes a subcollection entry in incidents/{id}/timeline
  • Actor, action, details, and server timestamp are recorded

πŸŽ›οΈ Coordinator Dashboard (coordinator.html)

The command-and-control center for verified coordinators, protected by Firebase email/password authentication.

Sidebar Navigation

Panel Description
Live Incidents Real-time feed sorted by triage severity
Volunteers View, filter, and dispatch volunteers
Report a Need Submit an incident directly from the dashboard
History Browse all past incidents with status filters
Insights Charts, maps, and community analytics
Settings Profile, notifications, triage self-test

Live Incidents Panel

  • Fetches all incidents ordered by timestamp in real-time
  • Cards are sorted by AI-assigned triage level (Critical first)
  • Each card shows:
    • Color-coded left border matching triage level
    • Triage badge (Level + name) with model badge (G3 / G2.5)
    • Location, description, AI reasoning
    • Assigned volunteer chip (if dispatched)
    • Suggested volunteer buttons ranked by match score

AI Triage System (5-Level)

The dashboard's fallback triage engine (fallbackTriageForType) auto-assigns levels to stale pending incidents (>5 min without a result):

  • Level 1 β€” Critical (red) β€” Life-threatening, bleeding, cardiac, explosion
  • Level 2 β€” Severe (orange) β€” Major injury, flood, violence
  • Level 3 β€” Moderate (yellow) β€” Conflict, property risk
  • Level 4 β€” Minor (green) β€” Resource shortages
  • Level 5 β€” Monitoring (gray) β€” Support / hospitality needs

Smart Volunteer Matching

The match scoring algorithm ranks available volunteers per incident using:

Score = Skill Match (0-70) + GPS Proximity (0-50) + Urgency Bonus (0-10)
  • Skill match: 70 points if the volunteer's skill aligns with incident type
  • GPS proximity (Haversine formula):
    • ≀ 2 km β†’ +50 pts
    • ≀ 5 km β†’ +35 pts
    • ≀ 15 km β†’ +20 pts
    • ≀ 30 km β†’ +10 pts
  • Urgency bonus: +10 pts if triage level is 1 or 2
  • Falls back to text-based location matching when GPS coords unavailable

Dispatch action β€” clicking a volunteer button:

  1. Updates incidents/{id} with volunteer name, skill, assignedAt
  2. Updates volunteers/{id} to available: false
  3. Writes a dispatched timeline entry

Auto-Dispatch

Clicking "Auto-dispatch top matches" in the Operations panel finds the single highest-scoring unassigned volunteer for each unresolved incident and dispatches them automatically.

Insights Panel

  • Incident Type Breakdown β€” Chart.js pie chart
  • Severity Distribution β€” Bar chart by triage level
  • Most Affected Areas β€” Ranked list of location frequency
  • Incidents Over Time β€” 7-day trend line chart
  • Incident Heatmap β€” Leaflet.js interactive map with clustered markers (color-coded by triage level)
  • Download CSV Report β€” One-click export of all incident data

History Panel

  • Filter by All / Pending / Resolved
  • Shows totals for each status
  • Live-updated from Firestore

Settings Panel

  • Display name editor
  • Notification preference toggle
  • Triage Self-Test β€” Runs 5 deterministic test cases (one per level) and displays pass/fail results for validating the Gemini/fallback pipeline
  • Sign Out

Right Sidebar Stats

  • Today's Active / Deployed / Resolved counts (real-time)
  • Average response time calculated from assignedAt β†’ resolvedAt timestamps
  • AI Triage Queue counter β€” incidents awaiting a triage result

πŸ‘₯ Volunteers (volunteers.html)

Public-accessible page (uses Firebase Anonymous Auth to write to Firestore).

Register as Volunteer

Form fields:

  • Full Name
  • Phone Number
  • Primary Skill (Medical / Rescue / Supply / Coordination)
  • Location (auto-captured via GPS + Nominatim reverse geocode, or manual)
  • Currently Available toggle

Volunteer documents saved to Firestore volunteers collection with GPS coordinates for proximity matching.

Active Volunteers List

  • Live Firestore listener β€” updates without refresh
  • Filter buttons: All / Medical / Rescue / Supply
  • Each card shows: initials avatar, name, skill, location, availability dot (green = available, orange = busy)

πŸ“¦ Resources (resources.html)

Community resource directory β€” also uses Anonymous Auth.

Emergency Helplines (Static)

Quick-dial cards for:

  • Medical Emergency β€” 108
  • Police β€” 100
  • Fire Brigade β€” 101
  • Disaster Relief NDRF β€” 1078
  • Local Ambulance (Durgapur) β€” 0343-2546000

Each card links to tel: for one-tap calling on mobile.

Community Resources (Dynamic)

  • Live-synced list from Firestore resources collection
  • "+ Add Resource" button opens a modal form:
    • Name, Type (NGO / Medical / Shelter / Food), Contact, Address
  • Submitted resources appear instantly for all users

πŸ“‹ History (history.html)

Standalone incident history viewer (also accessible from the reporter sidebar).


πŸ‘€ Account Settings (account.html)

Profile management page for signed-in users.


πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        ResQNet Web App                       β”‚
β”‚  index.html β†’ auth.html β†’ reporter.html / coordinator.html  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚         Firebase Backend          β”‚
          β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
          β”‚  β”‚  Firebase Authentication     β”‚ β”‚
          β”‚  β”‚  (Email/Password + Google)   β”‚ β”‚
          β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
          β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
          β”‚  β”‚  Cloud Firestore (real-time) β”‚ β”‚
          β”‚  β”‚  β”œβ”€β”€ /incidents              β”‚ β”‚
          β”‚  β”‚  β”‚   └── /timeline           β”‚ β”‚
          β”‚  β”‚  β”œβ”€β”€ /volunteers             β”‚ β”‚
          β”‚  β”‚  β”œβ”€β”€ /resources              β”‚ β”‚
          β”‚  β”‚  └── /users                  β”‚ β”‚
          β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚         External APIs             β”‚
          β”‚  β”œβ”€β”€ Gemini 2.5 Flash (AI Triage) β”‚
          β”‚  β”œβ”€β”€ Nominatim (Reverse Geocode)  β”‚
          β”‚  β”œβ”€β”€ Leaflet.js (Incident Map)    β”‚
          β”‚  └── Web Speech API (Voice Input) β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Firestore Collections

Collection Description
incidents All incident reports with triage data
incidents/{id}/timeline Chronological audit log per incident
volunteers Registered field volunteers with skills + GPS
resources Community-submitted emergency resources
users Reporter profiles created on sign-up

🧱 Tech Stack

Layer Technology
Frontend Vanilla HTML5, CSS3, JavaScript (ES Modules)
Typography Google Fonts β€” Inter
Auth Firebase Authentication (Email/Password, Google OAuth, Anonymous)
Database Firebase Cloud Firestore (real-time listeners)
AI Triage Google Gemini API (2.5 Flash β†’ 1.5 Flash fallback)
Maps Leaflet.js + OpenStreetMap tiles
Charts Chart.js (pie, bar, line)
Geocoding Nominatim / OpenStreetMap Reverse Geocoding
Voice Web Speech API (browser-native)
Deployment Docker Β· Google Cloud Run
Version Control Git / GitHub

πŸš€ Getting Started

Prerequisites

  • Node.js (for a local dev server β€” optional)
  • A Firebase project with Firestore and Authentication enabled
  • A Gemini API key (from Google AI Studio)

1. Clone the Repository

git clone https://github.com/SyedArmanAli2003/GD-Solution-challange-2026.git
cd GD-Solution-challange-2026

2. Configure Firebase

Copy the example config and fill in your credentials:

cp config.example.js config.js

Edit config.js:

const CONFIG = {
  GEMINI_API_KEY: "your-gemini-api-key-here"
};

Note: The Firebase config is currently embedded inline in each HTML file. Update the firebaseConfig objects in reporter.html, coordinator.html, volunteers.html, resources.html, and auth.html with your own Firebase project credentials.

3. Firebase Setup

In your Firebase Console:

  1. Enable Authentication β†’ Sign-in methods: Email/Password, Google, Anonymous
  2. Enable Cloud Firestore in production mode
  3. Apply the Firestore security rules from firestore.rules

4. Run Locally

You need a local HTTP server (not file://) for Firebase and mic APIs to work:

# Using Python
python -m http.server 4173

# Using Node.js http-server
npx http-server -p 4173

# Then open:
# http://localhost:4173/index.html

5. Demo Credentials

The coordinator dashboard includes demo credentials in the login modal:

Email:    resqnet.coordinator@gmail.com
Password: (contact the project author)

🐳 Docker Deployment

Build and run the container locally:

docker build -t resqnet .
docker run -p 8080:8080 resqnet

Deploy to Google Cloud Run

gcloud run deploy resqnet \
  --source . \
  --project resqnet-494415 \
  --region us-central1 \
  --allow-unauthenticated

πŸ“ Project Structure

GD-Solution-challange-2026/
β”œβ”€β”€ index.html          # Landing page β€” entry point
β”œβ”€β”€ auth.html           # Sign In / Create Account
β”œβ”€β”€ reporter.html       # Citizen reporter dashboard
β”œβ”€β”€ coordinator.html    # Coordinator command center
β”œβ”€β”€ volunteers.html     # Volunteer registration & listing
β”œβ”€β”€ resources.html      # Emergency helplines & community resources
β”œβ”€β”€ history.html        # Incident history viewer
β”œβ”€β”€ account.html        # User account settings
β”œβ”€β”€ style.css           # Shared design system (CSS variables, components)
β”œβ”€β”€ config.js           # Runtime config (Gemini API key)
β”œβ”€β”€ config.example.js   # Config template for new developers
β”œβ”€β”€ firebaseConfig.js   # Firebase credentials helper
β”œβ”€β”€ auth.js             # Auth helper module
β”œβ”€β”€ coordinator.js      # Coordinator logic (separate module)
β”œβ”€β”€ volunteers.js       # Volunteer management module
β”œβ”€β”€ resources.js        # Resources module
β”œβ”€β”€ history.js          # History module
β”œβ”€β”€ account.js          # Account settings module
β”œβ”€β”€ crew-page.js        # Additional crew utilities
β”œβ”€β”€ firestore.rules     # Firestore security rules
β”œβ”€β”€ firebase.json       # Firebase hosting configuration
β”œβ”€β”€ Dockerfile          # Container build config
β”œβ”€β”€ .dockerignore       # Docker exclusion list
β”œβ”€β”€ .gitignore          # Git exclusion list
└── LICENSE             # MIT License

πŸ”’ Security

  • Coordinator dashboard is protected by Firebase email/password auth β€” the app shell is hidden until authentication succeeds
  • Reporter dashboard requires a valid (non-anonymous) Firebase user
  • Volunteer & Resources pages use Anonymous Auth for write access, keeping the barrier low for community contributors while preventing unauthenticated direct API calls
  • Firestore rules (firestore.rules) restrict write/read access per collection
  • API keys are runtime-injected via config.js (excluded from version control via .gitignore)

πŸ—ΊοΈ User Flows

Citizen Reporting Flow

index.html
  β†’ auth.html (sign in / create account)
    β†’ reporter.html
      β†’ Hold SOS button (2s)
        β†’ Category modal opens
          β†’ GPS captured automatically
          β†’ Optional: record voice note (15s)
          β†’ Select category + optional description
          β†’ Submit
            β†’ Firestore write (incident created)
            β†’ Success modal shown
            β†’ Gemini AI triage runs in background
            β†’ Triage result saved to Firestore
            β†’ Coordinator dashboard updates live

Coordinator Response Flow

coordinator.html
  β†’ Login (email/password)
    β†’ Live incidents panel (auto-loads)
      β†’ View AI-triaged incident card
        β†’ Click suggested volunteer β†’ Dispatch
          β†’ Volunteer marked busy
          β†’ Incident marked deployed
          β†’ Timeline entry created
      β†’ Resolve incident β†’ Status updated
      β†’ View Insights β†’ Charts + Heatmap
      β†’ Export CSV β†’ Download report

Volunteer Registration Flow

volunteers.html (no login required)
  β†’ Anonymous Firebase session created
    β†’ Fill form (name, phone, skill, location)
    β†’ GPS auto-captured + reverse geocoded
    β†’ Register β†’ Saved to Firestore volunteers collection
    β†’ Appears in coordinator's volunteer pool instantly

πŸ“Š Triage Levels Reference

Level Name Color Typical Scenarios
1 Critical πŸ”΄ Red Cardiac arrest, active bleeding, building collapse, explosion
2 Severe 🟠 Orange Flood, mass injury, riot, severe shortage
3 Moderate 🟑 Yellow Conflict reports, property damage, moderate injuries
4 Minor 🟒 Green Supply shortages, non-urgent resource needs
5 Monitoring ⚫ Gray Hospitality, shelter, general support requests

πŸ€– Gemini AI Integration

ResQNet uses Google Gemini for automated incident triage:

Prompt structure:

You are an emergency triage AI.
Analyze this crisis and return ONLY valid JSON.

Type: {Medical/Disaster/Conflict/Resource/Hospitality}
Description: {user text}
Voice: {speech-to-text transcript}
Location: {reverse-geocoded address}

Return: { level, levelName, color, reasoning, volunteerTypes, estimatedMinutes }

Model cascade:

  1. gemini-2.5-flash (primary)
  2. gemini-1.5-flash (secondary fallback)
  3. Rule-based keyword engine (final fallback)

This cascade ensures zero downtime for triage even under API quota limits.


🌍 Google Solution Challenge Alignment

ResQNet addresses UN Sustainable Development Goals:

SDG How ResQNet helps
SDG 3 β€” Good Health & Well-being Faster medical emergency response via AI triage
SDG 11 β€” Sustainable Cities & Communities Resilient community crisis coordination
SDG 16 β€” Peace, Justice & Strong Institutions Structured conflict reporting and resource allocation
SDG 17 β€” Partnerships for the Goals Connecting volunteers, NGOs, and coordinators in one platform

πŸ‘¨β€πŸ’» Authors and Contributors

Syed Arman Ali Β· GitHub Aysha Tahoor GitHub Krish GitHub

Built for the Google Solution Challenge 2026.


πŸ“„ License

This project is licensed under the MIT License.

About

ResQNet is a real-time community crisis response and resource-allocation platform designed to bridge the gap between people who need emergency help and the coordinators + volunteers who can deliver it

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors