Skip to content

Deployment and Operations Guide

GiZano edited this page Aug 5, 2026 · 2 revisions

Deployment & Operations Guide

This section outlines the procedures for provisioning the QuakeGuard infrastructure.

Prerequisites

  • Backend: Docker Engine & Docker Compose.
  • Edge (IoT): VS Code + PlatformIO extension.
  • Mobile: Node.js (v18+) & Expo Go app.

Backend Provisioning

  1. Navigate to backend/api.
  2. Copy the environment variables: cp .env.example .env and fill in your HiveMQ credentials.
  3. Launch the stack:
docker compose up --build -d
  1. Verify health at http://localhost:8000/health.
  2. (Optional) To enable on-premise AI emergency reports, use the ai profile — see AI Emergency Report Service.

Edge Node Flashing

  1. Navigate to firmware/esp32_code.
  2. Copy the config: cp esp32_config.env.example esp32_config.env.
  3. Update WiFi credentials, SERVER_HOST, and ENROLLMENT_TOKEN.
  4. Flash via PlatformIO.
  5. Open Serial Monitor (115200 baud) to verify successful automated registration.

Mobile Client Initialization

  1. Navigate to mobile/ and run npm install.
  2. Create a .env file 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
  1. Run npx expo start and scan the QR code with your smartphone.

System Certification (Stress Test)

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_test

A successful run ends with 🏆 SYSTEM CERTIFIED.


Clone this wiki locally