You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
QuakeGuard is a **Full-Stack IoT** architecture designed for the real-time detection, analysis, and reporting of seismic events.
11
-
The system utilizes intelligent edge sensors (ESP32) that analyze vibrations locally and transmit encrypted data (ECDSA) to an asynchronous hybrid Cloud, capable of handling the massive traffic spikes (**Thundering Herd** effect) typical during earthquake events.
12
-
20
+
**QuakeGuard** is an advanced Full-Stack IoT architecture designed for the real-time detection, analysis, and reporting of seismic events.
13
21
22
+
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.
14
23
15
24
---
16
25
17
26
## 🏗 System Architecture
18
27
19
-
The project is modular and follows **Microservices** and **Event-Driven Design** principles:
28
+
29
+
The project is highly modular, following **Microservices** and **Event-Driven Design** principles across three main layers:
***Logic:** 100Hz sampling, Digital High-Pass Filters (HPF), and STA/LTA (Short Term/Long Term Average) algorithm.
32
+
***Hardware:** ESP32-C3 SuperMini paired with an ADXL345 Accelerometer.
33
+
***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.
24
34
***Security:** Hardware-level digital signing of payloads using **ECDSA (NIST256p)**.
25
-
***Resilience:** Temporal timestamp reconstruction to mitigate network latency issues.
35
+
***Resilience:** Temporal timestamp reconstruction to mitigate network latency and out-of-order packet deliveries.
26
36
27
37
### 2. ☁️ Backend (Data Elaborator)
28
-
***Core:** FastAPI (Python).
29
-
***Pattern:** Producer-Consumer with **Redis** as a Message Broker.
30
-
***Persistence:** PostgreSQL + PostGIS for geospatial data management.
31
-
***Worker:**Background processes for queue consumption and alarm aggregation.
32
-
***Performance:**Asynchronous management capable of handling >500 Req/s on standard hardware.
38
+
***Core API:**Built with **FastAPI** (Python) for high-performance asynchronous routing.
39
+
***Event Pattern:** Producer-Consumer architecture leveraging **Redis** as a Message Broker to decouple ingestion from processing.
40
+
***Persistence:****PostgreSQL + PostGIS** for robust geospatial data management.
41
+
***Background Workers:**Dedicated processes for queue consumption, event validation, and alarm aggregation.
42
+
***Performance:**Fully asynchronous management capable of handling >500 Req/s on standard commercial hardware.
33
43
34
44
### 3. 📱 Frontend (Mobile Monitor)
35
-
***Framework:** React Native (Expo).
36
-
***Features:** Dashboard with real-time visual/haptic alarms (Adaptive Polling) and an interactive sensor map.
45
+
***Framework:****React Native** (Expo) for cross-platform compatibility.
46
+
***Features:** Interactive dashboard with real-time visual and haptic alarms via Adaptive Polling, alongside a live sensor network map.
47
+
48
+
---
49
+
50
+
## 🔐 Security & Cryptography
51
+
52
+
Data integrity is paramount in emergency systems. Every telemetry packet transmitted by the edge sensors is cryptographically signed.
53
+
54
+
```json
55
+
{
56
+
"value": 250,
57
+
"timestamp": 17000000,
58
+
"signature": "a1b2c3d4e5f6..."
59
+
}
60
+
```
61
+
62
+
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.
37
63
38
64
---
39
65
@@ -42,32 +68,35 @@ The project is modular and follows **Microservices** and **Event-Driven Design**
42
68
### Prerequisites
43
69
* Docker & Docker Compose
44
70
* PlatformIO (VS Code Extension)
45
-
* Node.js & Expo Go
71
+
* Node.js & Expo Go (Mobile App)
46
72
47
-
### 1. Launch the Backend
73
+
### 1. Launch the Cloud Backend
74
+
Deploy the API, Database, and Message Broker via Docker:
48
75
```bash
49
76
cd"Backend - Data Elaborator"
50
77
docker-compose up --build -d
51
-
# Backend will be live at http://localhost:8000
52
78
```
79
+
*The backend will be live at `http://localhost:8000`. API documentation is auto-generated at `http://localhost:8000/docs`.*
53
80
54
-
### 2. Configure and Flash the IoT Device
55
-
1.Modify ```IoT - Data Harvester/esp32_config.env``` with your local IP and WiFi credentials.
56
-
2.Upload the firmware to the ESP32.
57
-
3.**IMPORTANT:** On the first boot, copy the ```PUBLIC KEY``` from the serial monitor and register it via Swagger (```http://localhost:8000/docs```).
81
+
### 2. Configure and Flash the IoT Edge Device
82
+
1. Modify `IoT - Data Harvester/esp32_config.env` with your local IP and WiFi credentials.
83
+
2. Upload the firmware to the ESP32 via PlatformIO.
84
+
3.**⚠️ IMPORTANT:** On the first boot, copy the generated `PUBLIC KEY` from the serial monitor and register the device via the Swagger UI (`http://localhost:8000/docs`).
58
85
59
-
### 3. Launch the Mobile App
86
+
### 3. Launch the Mobile Dashboard
60
87
```bash
61
88
cd"Frontend - Mobile App"
62
89
npm install
63
90
npx expo start
64
-
# Scan the QR code with your smartphone (must be on the same WiFi)
65
91
```
92
+
*Scan the generated QR code with your smartphone (ensure your phone is on the same WiFi network as your backend).*
**Developed by [GiZano](https://giovanni-zanotti.is-a.dev)**
99
+
<br>
100
+
*Version 3.0.0 (Stable) | MIT License*
72
101
73
-
The backend cryptographically verifies the signature (**SHA256 + ECDSA**) before accepting the data, preventing **Man-in-the-Middle** and **Spoofing** attacks.
0 commit comments