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.
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.
Aegis shifts the paradigm from "Online-First" to "Offline-First."
- Field App (PWA): Works completely offline. Caches reports locally and syncs automatically when the network returns.
- Command Center: visualizes incidents on a live map, calculates resource needs (Water/Food/Medical), and manages rescue team dispatch.
- Zero-Connectivity Reporting: Uses
localStorageand 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.
- 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."
- 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 +localStoragefor data persistence.
-
Clone the Repo
git clone [https://github.com/TitanOfTime/hackathontest.git](https://github.com/TitanOfTime/hackathontest.git)
-
Database Setup
- Import the SQL schema (not included in repo, auto-generated by
sync.phplogic). - Update
db.phpwith your MySQL credentials:
$conn = new PDO("mysql:host=localhost;dbname=aegis_db", "root", "");
- Import the SQL schema (not included in repo, auto-generated by
-
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
Aegis passes the strict Phase 1 Offline Test:
- Turn off Internet (Airplane Mode).
- Submit a report (Landslide, Level 5).
- Result: App saves data locally; UI confirms "Saved to Offline Queue."
- Close and reopen the app.
- Result: Data persists.
- Turn on Internet.
- Result: App auto-syncs, and the pin appears on the HQ Dashboard within 5 seconds.
Built for the 2025 Disaster Response Hackathon.