Full-Stack IoT Architecture for Real-Time Earthquake Detection
QuakeGuard is an advanced Full-Stack IoT architecture designed for the real-time detection, analysis, and reporting of seismic events.
The system utilizes intelligent edge sensors (ESP32) that analyze vibrations locally and transmit cryptographically secured data to an asynchronous hybrid Cloud. The backend is specifically engineered to handle the massive traffic spikes (Thundering Herd effect) typical during widespread earthquake events, ensuring reliable alarm delivery without bottlenecking.
The project is highly modular, following Microservices and Event-Driven Design principles across three main layers:
- Hardware: ESP32-C3 SuperMini paired with an ADXL345 Accelerometer.
- Edge Computing: 100Hz sampling rate, applying Digital High-Pass Filters (HPF) and the STA/LTA (Short Term/Long Term Average) seismic algorithm directly on the device.
- Security: Hardware-level digital signing of payloads using ECDSA (NIST256p).
- Resilience: Temporal timestamp reconstruction to mitigate network latency and out-of-order packet deliveries.
- Core API: Built with FastAPI (Python) for high-performance asynchronous routing.
- Event Pattern: Producer-Consumer architecture leveraging Redis as a Message Broker to decouple ingestion from processing.
- Persistence: PostgreSQL + PostGIS for robust geospatial data management.
- Background Workers: Dedicated processes for queue consumption, event validation, and alarm aggregation.
- Performance: Fully asynchronous management capable of handling >500 Req/s on standard commercial hardware.
- Framework: React Native (Expo) for cross-platform compatibility.
- Features: Interactive dashboard with real-time visual and haptic alarms via Adaptive Polling, alongside a live sensor network map.
Data integrity is paramount in emergency systems. Every telemetry packet transmitted by the edge sensors is cryptographically signed.
{
"value": 250,
"timestamp": 17000000,
"signature": "a1b2c3d4e5f6..."
}The backend rigorously verifies the signature (SHA256 + ECDSA) against the sensor's registered public key before accepting the payload. This architecture strictly prevents Man-in-the-Middle (MitM) and Spoofing attacks, ensuring that alarms cannot be falsely triggered by malicious actors.
- Docker & Docker Compose
- PlatformIO (VS Code Extension)
- Node.js & Expo Go (Mobile App)
Deploy the API, Database, and Message Broker via Docker:
cd "Backend - Data Elaborator"
docker-compose up --build -dThe backend will be live at http://localhost:8000. API documentation is auto-generated at http://localhost:8000/docs.
- Modify
IoT - Data Harvester/esp32_config.envwith your local IP and WiFi credentials. - Upload the firmware to the ESP32 via PlatformIO.
⚠️ IMPORTANT: On the first boot, copy the generatedPUBLIC KEYfrom the serial monitor and register the device via the Swagger UI (http://localhost:8000/docs).
cd "Frontend - Mobile App"
npm install
npx expo startScan the generated QR code with your smartphone (ensure your phone is on the same WiFi network as your backend).
Developed by GiZano
Version 3.0.0 (Stable) | MIT License