Skip to content

πŸŽ“ Full-stack emergency evacuation system with Dijkstra pathfinding. React admin dashboard + floor displays, Express 5 REST API, MongoDB, Socket.IO real-time broadcasting, and USRP radio fallback. Features AI hazard detection, dynamic route weights, Redux state management, and TailwindCSS UI.

Notifications You must be signed in to change notification settings

Marcuii/evac-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

EES

🏒 Emergency Evacuation System

AI-Powered Real-Time Building Evacuation Routing System

Graduation Project - Computer Engineering

Version Node React Express MongoDB Socket.IO License

Overview β€’ Features β€’ Architecture β€’ Modules β€’ Quick Start β€’ Documentation


πŸ“‹ Overview

The Emergency Evacuation System (EES) is a comprehensive full-stack solution designed to provide real-time, AI-assisted evacuation routing for buildings during emergencies. The system continuously monitors building corridors through CCTV cameras, analyzes footage using AI to detect hazards (fire, smoke, crowd density), computes optimal evacuation routes using Dijkstra's algorithm with dynamic edge weights, and broadcasts personalized routes to display screens throughout the building.

🎯 Problem Statement

During building emergencies, occupants often lack real-time information about safe evacuation routes. Traditional static evacuation signs cannot adapt to dynamic hazards like spreading fires, smoke-filled corridors, or overcrowded pathways. This system addresses these challenges by providing:

  • Real-time hazard detection through AI-powered camera analysis
  • Dynamic route computation that adapts to changing conditions
  • Multi-channel communication ensuring route delivery even during network failures

✨ Key Capabilities

Capability Description
πŸ€– AI Hazard Detection Real-time fire, smoke, and crowd density analysis from CCTV feeds
πŸ—ΊοΈ Dynamic Pathfinding Dijkstra's algorithm with hazard-weighted edges and threshold penalties
πŸ“‘ Dual Communication Socket.IO (primary) + USRP/SDR radio transmission (fallback)
πŸ–₯️ Admin Dashboard Web-based floor management, monitoring, and configuration
πŸ“Ί Floor Screens Production displays showing evacuation routes with visual guidance
☁️ Cloud Integration MongoDB Atlas sync + Cloudinary image storage
πŸ”„ Offline Mode Continue local AI analysis when cloud services are unavailable

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                           EMERGENCY EVACUATION SYSTEM                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”‚
β”‚  β”‚  CCTV Cameras   β”‚    β”‚   AI Services   β”‚    β”‚    MongoDB      β”‚           β”‚
β”‚  β”‚  (RTSP Feeds)   β”‚    β”‚  (Local/Cloud)  β”‚    β”‚   (Database)    β”‚           β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚
β”‚           β”‚                      β”‚                      β”‚                    β”‚
β”‚           β–Ό                      β–Ό                      β–Ό                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚                          BACKEND SERVER (server/)                      β”‚  β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚  β”‚
β”‚  β”‚  β”‚  RTSP    β”‚  β”‚    AI    β”‚  β”‚ Dijkstra β”‚  β”‚Socket.IO β”‚  β”‚   USRP   β”‚  β”‚  β”‚
β”‚  β”‚  β”‚ Capture  │─▢│ Analysis │─▢│ Routing  │─▢│ REST API β”‚  β”‚ Fallback β”‚  β”‚  β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                                    β”‚             β”‚           β”‚
β”‚           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”‚             β”‚           β”‚
β”‚           β”‚                                        β”‚β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚
β”‚           β–Ό                                        β–Ό                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ Admin Dashboard β”‚                    β”‚      Building Floor Screens     β”‚  β”‚
β”‚  β”‚    (admin/)     β”‚                    β”‚          (screens/)             β”‚  β”‚
β”‚  β”‚  - Floor Mgmt   β”‚                    β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”  β”‚  β”‚
β”‚  β”‚  - Monitoring   β”‚                    β”‚  β”‚Floor 1β”‚ β”‚Floor 2β”‚ β”‚Floor 3β”‚  β”‚  β”‚
β”‚  β”‚  - Settings     β”‚                    β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Flow Pipeline

Every Capture Cycle (configurable interval):
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   RTSP     │──▢│   Local    │──▢│  Dijkstra  │──▢│  Socket.IO │──▢│   Screen   β”‚
β”‚  Capture   β”‚   β”‚ AI + Cloud β”‚   β”‚  Routing   β”‚   β”‚  Broadcast β”‚   β”‚  Display   β”‚
β”‚  (FFmpeg)  β”‚   β”‚AI Analysis β”‚   β”‚ (Weighted) β”‚   β”‚  (Rooms)   β”‚   β”‚  Update    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚                                  β”‚
                       β–Ό                                  β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚    Cloudinary  β”‚                β”‚  USRP Radio    β”‚
              β”‚    (Storage)   β”‚                β”‚  (Fallback)    β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

evac-system/
β”œβ”€β”€ server/                 # Backend API Server (Express + MongoDB)
β”‚   β”œβ”€β”€ controllers/        # Request handlers
β”‚   β”œβ”€β”€ models/             # Mongoose schemas
β”‚   β”œβ”€β”€ routes/             # API route definitions
β”‚   β”œβ”€β”€ sockets/            # Socket.IO event handlers
β”‚   β”œβ”€β”€ utils/              # Utilities (AI, Dijkstra, RTSP, USRP)
β”‚   └── middleware/         # Auth, security, logging
β”‚
β”œβ”€β”€ admin/                  # Admin Dashboard (React + Vite)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ pages/          # Dashboard, Floors, Routes, Settings
β”‚   β”‚   β”œβ”€β”€ components/     # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ store/          # Redux state management
β”‚   β”‚   └── services/       # API service layer
β”‚   └── public/
β”‚
β”œβ”€β”€ screens/                # Floor Display Screens (React + Vite)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ pages/          # LandingPage (controller), ScreenPage
β”‚   β”‚   β”œβ”€β”€ components/     # Route display, floor map
β”‚   β”‚   └── store/          # Redux + USRP service
β”‚   β”œβ”€β”€ usrp-bridge.js      # USRP/GNU Radio bridge service
β”‚   └── rx_ofdm.py          # GNU Radio OFDM receiver
β”‚
β”œβ”€β”€ mock-services/          # Development Mock Server
β”‚   β”œβ”€β”€ routes/             # Mock RTSP, Local AI, Cloud AI
β”‚   └── test-images/        # Sample camera images
β”‚
β”œβ”€β”€ setup.sh                # Install all dependencies
β”œβ”€β”€ start-server.sh         # Start backend server
β”œβ”€β”€ start-admin.sh          # Start admin dashboard
β”œβ”€β”€ start-screens.sh        # Start screen displays
β”œβ”€β”€ start-mock.sh           # Start mock services
└── README.md               # This file

πŸ”§ Modules

πŸ–₯️ Backend Server (server/)

The core backend handling all system logic.

Component Description
REST API Floor management, routes, records, settings endpoints
Socket.IO Real-time route broadcasting to floor screens
Periodic Job RTSP Capture β†’ AI Analysis β†’ Dijkstra β†’ Broadcast pipeline
USRP Sender GNU Radio OFDM fallback transmission
Cloud Sync Configurable MongoDB Atlas synchronization
Settings API Dynamic cloud sync/processing configuration

Technologies: Express 5.x, MongoDB 8.x, Mongoose, Socket.IO 4.x, Winston, Helmet

Port: 3000

πŸ“– Server Documentation | API Reference


πŸ“Š Admin Dashboard (admin/)

Web interface for system administrators.

Feature Description
Dashboard System overview, health monitoring, quick stats
Floor Management Create, edit, delete floor maps with visual editor
Graph Editor Visual node/edge editor for evacuation paths
Camera Management Monitor and configure RTSP cameras
Route Viewer View computed evacuation routes with hazard levels
Settings Configure cloud sync, cloud processing, API connection

Technologies: React 19, Redux Toolkit, TailwindCSS, Vite, Lucide Icons

Port: 3030

πŸ“– Admin Documentation


πŸ“Ί Floor Screens (screens/)

Production displays showing evacuation routes to building occupants.

Feature Description
Route Display Visual evacuation path with directional guidance
Real-time Updates Socket.IO connection for live route changes
USRP Fallback Automatic switch to radio when network fails
Multi-Screen Sync BroadcastChannel for same-device screens
Hazard Indicators Visual warnings for fire/smoke/crowd levels

Technologies: React 19, Redux Toolkit, Socket.IO Client, GNU Radio

Port: 3060 (screens) | 3062 (USRP bridge)

πŸ“– Screens Documentation


πŸ§ͺ Mock Services (mock-services/)

Development server simulating external hardware for testing.

Service Endpoint Description
RTSP Simulation /api/rtsp/capture Returns test camera images
Local AI /api/local-ai/analyze Simulated edge AI (~1s latency)
Cloud AI /api/cloud-ai/analyze Simulated cloud AI (~3s latency)

Port: 3090

πŸ“– Mock Services Documentation


πŸš€ Quick Start

Prerequisites

Requirement Version Purpose
Node.js β‰₯ 18.0.0 Runtime environment
MongoDB 6.x+ Database
FFmpeg Latest RTSP camera capture
GNU Radio 3.10+ USRP radio transmission (optional)

Installation

# Clone the repository
git clone https://github.com/marcelinosaad/evac-system.git
cd evac-system

# Install all dependencies (all modules)
chmod +x setup.sh && ./setup.sh

# Or install manually per module:
cd server && npm install && cd ..
cd admin && npm install && cd ..
cd screens && npm install && cd ..
cd mock-services && npm install && cd ..

Configuration

# Copy environment template
cp server/.env.example server/.env

# Edit configuration
nano server/.env

Key Configuration:

# Server
PORT=3000
LOCAL_MONGO_URI=mongodb://127.0.0.1:27017/evac_local

# Admin Authentication
ADMIN_AUTH_TOKEN=your-secure-token

# AI Endpoints (use mock-services for development)
LOCAL_AI_ENDPOINT=http://localhost:3090/api/local-ai/analyze
CLOUD_AI_ENDPOINT=http://localhost:3090/api/cloud-ai/analyze

# RTSP Template
RTSP_TEMPLATE=http://localhost:3090/api/rtsp/capture?cameraId={cameraId}

# Cloudinary (optional for development)
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret

Running the System

Open 4 terminal windows:

Terminal Command Service URL
1 ./start-server.sh Backend API http://localhost:3000
2 ./start-admin.sh Admin Dashboard http://localhost:3030
3 ./start-screens.sh Floor Screens http://localhost:3060
4 ./start-mock.sh Mock Services http://localhost:3090

Verify Installation

# Check backend health
curl http://localhost:3000/health

# Expected response:
{
  "success": true,
  "service": "evac-backend",
  "version": "1.0.0",
  "database": { "status": "connected" }
}

πŸ“– Documentation

Document Description
server/README.md Backend server overview
server/API_DOCUMENTATION.md Complete REST API reference
server/USRP_SYSTEM.md USRP radio fallback system
server/FLOOR_UPLOAD_GUIDE.md Floor map creation guide
admin/README.md Admin dashboard guide
screens/README.md Screen display documentation
screens/SCREEN_SYNC_GUIDE.md Multi-screen synchronization
mock-services/README.md Mock services for development

πŸ› οΈ Technologies

Layer Technologies
Backend Node.js 18+, Express 5.x, MongoDB 8.x, Mongoose, Socket.IO 4.x
Frontend React 19, Vite 6.x, Redux Toolkit, TailwindCSS 3.x
Security Helmet, Rate Limiting, NoSQL Sanitization, CORS
Media FFmpeg (RTSP capture), Cloudinary (cloud storage)
Radio GNU Radio 3.10+, UHD, USRP B200/B210 (SDR)
Logging Winston (file + console logging)
AI Custom AI endpoints (people counting, fire/smoke detection)

πŸ” Security Features

  • Admin Authentication - Token-based API protection (x-admin-auth header)
  • Rate Limiting - 100 requests per 15 minutes per IP
  • NoSQL Injection Prevention - Query sanitization middleware
  • XSS Protection - Helmet security headers
  • CORS - Configurable cross-origin resource sharing
  • Input Validation - Express-validator on all endpoints

πŸ“Š System Workflow

1. Floor Setup (Admin)

  1. Create floor map in Admin Dashboard
  2. Define nodes (rooms, corridors, exits)
  3. Connect nodes with edges (paths)
  4. Configure cameras on edges
  5. Set hazard thresholds per edge

2. Real-time Operation

  1. Periodic job captures frames from cameras
  2. Frames sent to Local AI (fast) + Cloud AI (accurate)
  3. AI results update edge weights
  4. Dijkstra computes optimal routes from each node to exits
  5. Routes broadcast via Socket.IO to floor screens
  6. If network fails, USRP radio transmits routes

3. Screen Display

  1. Screens connect to backend via Socket.IO
  2. Receive route updates for their floor
  3. Display visual evacuation path
  4. Show hazard warnings and distance info
  5. Auto-switch to USRP receiver if socket disconnects

πŸ‘¨β€πŸ’» Author

Marcelino Saad
Computer Engineering - Graduation Project


πŸ“„ License

This project is licensed under the ISC License.


Built for safer emergency evacuations 🏒🚨

Β© 2026 Emergency Evacuation System

About

πŸŽ“ Full-stack emergency evacuation system with Dijkstra pathfinding. React admin dashboard + floor displays, Express 5 REST API, MongoDB, Socket.IO real-time broadcasting, and USRP radio fallback. Features AI hazard detection, dynamic route weights, Redux state management, and TailwindCSS UI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published