AI-Powered Real-Time Building Evacuation Routing System
Graduation Project - Computer Engineering
Overview β’ Features β’ Architecture β’ Modules β’ Quick Start β’ Documentation
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.
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
| 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 |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 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 β β βββββββββ βββββββββ βββββββββ β β
β βββββββββββββββββββ βββββββββββββββββββββββββββββββββββ β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
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) β
ββββββββββββββββββ ββββββββββββββββββ
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
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
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
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)
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
| 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) |
# 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 ..# Copy environment template
cp server/.env.example server/.env
# Edit configuration
nano server/.envKey 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_secretOpen 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 |
# Check backend health
curl http://localhost:3000/health
# Expected response:
{
"success": true,
"service": "evac-backend",
"version": "1.0.0",
"database": { "status": "connected" }
}| 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 |
| 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) |
- Admin Authentication - Token-based API protection (
x-admin-authheader) - 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
- Create floor map in Admin Dashboard
- Define nodes (rooms, corridors, exits)
- Connect nodes with edges (paths)
- Configure cameras on edges
- Set hazard thresholds per edge
- Periodic job captures frames from cameras
- Frames sent to Local AI (fast) + Cloud AI (accurate)
- AI results update edge weights
- Dijkstra computes optimal routes from each node to exits
- Routes broadcast via Socket.IO to floor screens
- If network fails, USRP radio transmits routes
- Screens connect to backend via Socket.IO
- Receive route updates for their floor
- Display visual evacuation path
- Show hazard warnings and distance info
- Auto-switch to USRP receiver if socket disconnects
Marcelino Saad
Computer Engineering - Graduation Project
This project is licensed under the ISC License.
Built for safer emergency evacuations π’π¨
Β© 2026 Emergency Evacuation System