Skip to content

TitanOfTime/Aegis

Repository files navigation

🛡️ Project Aegis: Offline-First Disaster Response System

Hackathon Tech PWA

Aegis is a resilient disaster management platform designed for "digital dead zones." It allows first responders to log critical incidents (Landslides, Floods, Medical Emergencies) without internet access and automatically synchronizes data to HQ once connectivity is restored.


🚨 The Problem

In the wake of the Ratnapura natural disaster, power lines and cell towers are down. First responders are unable to communicate with HQ, leading to uncoordinated rescue efforts and delayed resource deployment.

💡 The Solution

Aegis shifts the paradigm from "Online-First" to "Offline-First."

  1. Field App (PWA): Works completely offline. Caches reports locally and syncs automatically when the network returns.
  2. Command Center: visualizes incidents on a live map, calculates resource needs (Water/Food/Medical), and manages rescue team dispatch.

🌟 Key Features

📱 Field Responder App (Mobile PWA)

  • Zero-Connectivity Reporting: Uses localStorage and a custom Queue System to save reports when offline.
  • Smart Sync Engine: Automatically detects network restoration and pushes the queue to the server (sync.php).
  • Safety Guidance: Dynamic "Safety Cards" provide immediate advice based on the incident type (e.g., "Move to high ground" for Landslides).
  • SMS Fallback: Generates a pre-formatted SOS SMS with GPS coordinates if data connectivity is completely impossible.
  • Image Compression: Client-side compression reduces 5MB photos to <50KB for fast transmission over weak 2G networks.

💻 Command Dashboard (Web)

  • Live Map Clustering: Visualizes high-density hazard areas using Leaflet.js cluster groups.
  • Resource Forecasting: Analytics engine automatically calculates logistics (Liters of water, Meals, Medical kits) based on the "Headcount" reported in incidents.
  • Geofencing & Alerts: Admins can draw "Hazard Zones" on the map and trigger broadcast alerts to all connected devices.
  • Mission Tracking: Track incidents from "Active" → "Team Dispatched" → "Resolved."

🛠️ Tech Stack & Architecture

  • Frontend: HTML5, Tailwind CSS, Vanilla JavaScript (No heavy frameworks for max performance).
  • Backend: Native PHP (Lightweight API endpoints).
  • Database: MySQL (Stores incidents, users, and logs).
  • Maps: Leaflet.js + OpenStreetMap (Free, no API keys required).
  • Offline Tech: Service Workers (sw.js) for caching assets + localStorage for data persistence.

🚀 Installation & Setup

  1. Clone the Repo

    git clone [https://github.com/TitanOfTime/hackathontest.git](https://github.com/TitanOfTime/hackathontest.git)
  2. Database Setup

    • Import the SQL schema (not included in repo, auto-generated by sync.php logic).
    • Update db.php with your MySQL credentials:
    $conn = new PDO("mysql:host=localhost;dbname=aegis_db", "root", "");
  3. Run Locally

    • Serve via Apache/Nginx or PHP built-in server:
    php -S localhost:8000
    • Access the App: http://localhost:8000/app.php
    • Access the Dashboard: http://localhost:8000/dashboard.php

🧪 "Airplane Mode" Test (Grading Criteria)

Aegis passes the strict Phase 1 Offline Test:

  1. Turn off Internet (Airplane Mode).
  2. Submit a report (Landslide, Level 5).
  3. Result: App saves data locally; UI confirms "Saved to Offline Queue."
  4. Close and reopen the app.
  5. Result: Data persists.
  6. Turn on Internet.
  7. Result: App auto-syncs, and the pin appears on the HQ Dashboard within 5 seconds.

Built for the 2025 Disaster Response Hackathon.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors