AI-powered Fire, Smoke, Risk, Safe Route and Shelter system with a detection data layer and live SSE dashboard API
# AFRICA RESQ — AI Fire & Smoke Detection System (Egypt)
## Overview
AFRICA RESQ is an AI-powered fire and smoke detection system designed to support
emergency response and search-and-rescue operations in **Egypt**.
The system combines computer vision, hazard analysis, risk assessment, survivor
detection, **nearest emergency-shelter search** and decision-support components,
all exposed through a FastAPI backend that feeds a real-time **dashboard**.
> **One repo, two builds.** This repository hosts the whole project: the AI /
> data-engineering / API backend in the repo root, and the fully-built command
> dashboard (its own frontend, server and rover simulator) under
> `dashboard/`. See Project Structure.
## What's inside (hackathon prototype)
| Feature | Description |
|---|---|
| 🏠 Nearest shelter search | Real shelter dataset for **13 Egyptian cities** (Cairo, Giza, Alexandria, Port Said, Ismailia, Suez, Luxor, Aswan, Sharm El-Sheikh, Hurghada, Mansoura, Tanta, New Admin Capital). Distances (haversine), direction, walk/drive estimates, city filter. |
| 📡 Fake sensor simulator | Continuous simulated telemetry (temperature, gas, smoke density, humidity, wind, battery, GPS, fire/smoke/survivor detections, risk, priority, recommendation). Runs automatically so dashboards always have live data. |
| 🔌 API contract for the dashboard | The backend exposes every endpoint the frontend dashboard team needs (`/api/nearest_shelter`, `/api/sensor`, `/api/full`, `/api/route`, ...). The frontend dashboard itself is built by the frontend teammate — a basic reference page is served at `/map`. |
| 🗄️ Data engineering | Every detection — from the camera (YOLO) **and** the fake sensor simulator — is automatically persisted to a SQLite store (`data/africa_resq.db`) plus an append-only JSONL export (`data/events.jsonl`), queryable via `/api/events*`. |
| 🚁 Perception (optional) | YOLO fire/smoke detection pipeline (`src/perception.py`, `live_pipeline.py`, `webcam.py`) for real came …