-
Notifications
You must be signed in to change notification settings - Fork 2
Deployment and Operations Guide
GiZano edited this page Sep 10, 2026
·
3 revisions
This section outlines the procedures for provisioning the QuakeGuard infrastructure.
- Backend: Docker Engine & Docker Compose.
- Edge (IoT): VS Code + PlatformIO extension.
- Mobile: Node.js (v18+) & Expo Go app.
- Navigate to
backend/api. - Copy the environment variables:
cp .env.example .envand fill in your HiveMQ credentials. - Launch the stack:
docker compose up --build -d- Verify health at
http://localhost:8000/health. -
(Optional) To enable on-premise AI emergency reports, use the
aiprofile — see AI Emergency Report Service.
- Navigate to
firmware/esp32_code. - Copy the config:
cp esp32_config.env.example esp32_config.env. - Update WiFi credentials,
SERVER_HOST, andENROLLMENT_TOKEN. - Flash via PlatformIO.
- Open Serial Monitor (115200 baud) to verify successful automated registration.
- Navigate to
mobile/and runnpm install. - Create a
.envfile mapping your backend secrets and IP:
EXPO_PUBLIC_IOT_API_KEY=your_secret_key
EXPO_PUBLIC_MOBILE_WS_TOKEN=your_ws_token
EXPO_PUBLIC_API_BASE_URL=http://YOUR_LOCAL_IP:8000- Run
npx expo startand scan the QR code with your smartphone.
Validate your infrastructure by simulating a 150-node seismic swarm:
cd backend/api
export API_URL="http://localhost:8000"
export NUM_SENSORS=150
python -m tests.stress_testA successful run ends with 🏆 SYSTEM CERTIFIED.
System health and network latency are continuously monitored through a Grafana container. To eliminate manual configuration, QuakeGuard leverages Grafana's automated provisioning system:
- Data Sources: Natively mounts the TimescaleDB connection parameters.
- Dashboards: The "Mission Control" JSON dashboard is mounted automatically.
Upon executing docker compose up -d, Grafana exposes port 3000 with a fully configured 3-tier dashboard:
- Live Seismograph: Aggregated real-time Magnitude (PGA) and alert tables.
- IoT Telemetry: Node counts, RSSI bar gauges, and ESP32 free heap stability.
- Backend Latency: End-to-end packet latency and ingestion throughput (Events/sec).
To maintain production-grade reliability, QuakeGuard is backed by a rigorous Continuous Integration and Continuous Deployment (CI/CD) pipeline running on GitHub Actions:
-
Test Coverage: The backend is validated by 104
pytestscenarios covering ECDSA cryptography, state machine transitions, and Redis streams processing. The mobile application is covered by 23 Jest tests ensuring state management and UI resilience. - Quality Gates: Every pull request is automatically analyzed by SonarCloud, enforcing strict quality, reliability, and security metrics before a merge is permitted.
- Linting & Safety: Python code is statically analyzed and formatted using Ruff, while dependencies are audited by Safety and CodeQL to prevent supply-chain attacks.
- Previous: AI Emergency Report Service
- Related: Troubleshooting & Usage Guide
- Back to: Home