A local-first plant monitoring system for BC growers, featuring ESP32-based Guardian hubs and nRF52832-based Buddy probes communicating over LoRa 915MHz.
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β CLOUD (OPTIONAL) β
β β’ AWS IoT Core / Self-hosted MQTT β
β β’ End-to-end encrypted β
β β’ Data backup only (local-first design) β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β GROW GUARDIAN (Hub) β
β β’ MQTT broker (Mosquitto) β
β β’ HTTP REST API (ESP32 AsyncWebServer) β
β β’ LoRa gateway (single-channel, 915MHz) β
β β’ SQLite database (local storage) β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β β β
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Buddy 1 β β Buddy 2 β β Buddy N β
β β’ LoRa star β β’ LoRa star β β’ LoRa star β
β β’ Sleep 99% β β’ ACK/retry β β’ 20+ nodes β
βββββββββββββββ βββββββββββββββ βββββββββββββββ
growos/
βββ backend/ # Node.js REST API + MQTT broker bridge
β βββ src/
β β βββ routes/ # API routes (auth, devices, sensors, alerts, relays)
β β βββ services/ # MQTT client, cron jobs
β β βββ db/ # Database pool and migrations
β β βββ utils/ # Logger and utilities
β βββ package.json
β βββ .env.example
βββ web/ # React + TypeScript Dashboard
β βββ src/
β β βββ pages/ # Dashboard, Devices, Alerts, Analytics
β β βββ hooks/ # API hooks and Socket.io hooks
β β βββ types/ # TypeScript type definitions
β βββ package.json
βββ firmware/
β βββ guardian/ # ESP32-S3 hub firmware (C++/PlatformIO)
β βββ buddy/ # nRF52832 probe firmware (C++/PlatformIO)
βββ docker-compose.yml
- Node.js 20+
- PostgreSQL 16+ (with TimescaleDB extension recommended)
- MQTT Broker (Mosquitto)
- PlatformIO CLI (for firmware)
cd backend
cp .env.example .env
npm install
npm run db:migrate
npm run devcd web
npm install
npm run devdocker-compose up- MCU: ESP32-S3 (Dual-core, WiFi 4/Bluetooth 5)
- LoRa: RA-01H (SX1276, 915MHz NA)
- Sensors: SCD41 (COβ), SHT45 (Temp/Humidity), BMP388 (Pressure), BH1750 (Light), SGP40 (VOC)
- Power: 10,000mAh LiPo, USB-C PD, Solar input with MPPT
- Relays: 4x 10A/120V relay outputs
- Storage: 16GB microSD
- MCU: nRF52832 (Bluetooth 5.2)
- LoRa: E22-900M30S (SX1262, 915MHz NA, 5km range)
- Sensors: Capacitive moisture, DS18B20 (soil temp), Custom EC sensor
- Power: LIR2450 rechargeable coin cell (1+ years @ 15min intervals)
- Rating: IP68 (1m submersible)
POST /api/v1/auth/login- User loginPOST /api/v1/auth/register- User registrationGET /api/v1/auth/verify- Verify token
GET /api/v1/devices- List devicesPOST /api/v1/devices/register- Register new deviceGET /api/v1/devices/:deviceId- Get device detailsPATCH /api/v1/devices/:deviceId- Update devicePOST /api/v1/devices/:deviceId/command- Send command to device
GET /api/v1/sensors/:deviceId/latest- Latest readingsGET /api/v1/sensors/:deviceId/history- Historical dataGET /api/v1/sensors/:deviceId/export- Export data (CSV/JSON)
GET /api/v1/alerts/rules/:deviceId- Get alert rulesPOST /api/v1/alerts/rules- Create alert ruleGET /api/v1/alerts/history- Alert historyPOST /api/v1/alerts/history/:alertId/acknowledge- Acknowledge alert
GET /api/v1/dashboard/overview- Dashboard overviewGET /api/v1/dashboard/vpd-analysis- VPD analysis
- Live sensor data via WebSocket
- Temperature, humidity, COβ, light, VPD tracking
- Soil moisture, EC, pH from Buddy probes
- Configurable threshold alerts
- Email and push notifications
- Alert history and acknowledgment
- Guardian and Buddy device registration
- Relay control (4 channels)
- Firmware version tracking
- Battery and signal monitoring
- VPD (Vapor Pressure Deficit) analysis
- Environmental trend charts
- Data export (CSV/JSON)
- Historical data aggregation
- JWT-based authentication
- AES-128 encrypted LoRa communication
- TLS 1.3 for WiFi/HTTP
- SQLCipher for local database encryption
- Signed firmware updates (Ed25519)
NODE_ENV=development
PORT=3000
DATABASE_URL=postgresql://growos:growos_dev@localhost:5432/growos
MQTT_HOST=localhost
MQTT_PORT=1883
JWT_SECRET=change_me_in_productionVITE_API_URL=http://localhost:3000/api/v1
VITE_SOCKET_URL=http://localhost:3000MIT License - See LICENSE file for details
Contributions are welcome! Please read the contributing guidelines before submitting PRs.