Skip to main content

πŸ—οΈ System Overview

The Svaroh platform consists of four repositories working together: a station running on Raspberry Pi, a cloud relay, a mobile app, and a public artifact repo.

Topology​

Station works offline

Cloud is optional. All core functionality (device control, automations, local UI) runs on Raspberry Pi without internet. Cloud only adds remote/mobile access.

Repositories​

RepoRoleGitHub
smart-homeStation monorepo: backend, frontend, ESP32 firmware, station-agent↗
smart-home-cloudCloud API: auth, relay, station claiming↗
smart-home-mobileExpo / React Native mobile app↗
smart-home-updatesPublic distribution: agent binary, firmware, install scripts↗

Component Responsibilities​

πŸ“± Mobile App​

  • Expo / React Native, talks only to Cloud (HTTPS + WSS)
  • Never connects directly to Station
  • BLE provisioning of new ESP32 devices
  • Source β†—

☁️ Cloud​

  • Fastify + PostgreSQL + WebSocket server
  • Owns: users, auth, station registry
  • Does not store device data β€” proxies via JSON-RPC peer.call() over WSS to Station
  • Source β†—

🏠 Station (Raspberry Pi)​

  • station-agent β€” SEA Node binary, manages Docker, self-updates from smart-home-updates
  • backend (Docker) β€” Fastify, owns device data, MQTT bridge, WebSocket for frontend
  • frontend (Docker) β€” React SPA, served by Nginx
  • PostgreSQL + MQTT (Docker)
  • Source β†—

πŸ’‘ ESP32 Devices​

  • PlatformIO projects per device type: esp32-climate, esp32-pir, esp32-light, esp32-switch-pir
  • All built on shared SmartHomeCore library (Wi-Fi, MQTT, BLE, OTA)
  • Connect to Station's MQTT broker
  • Source β†—

Key Principles​

  • βœ… Mobile talks ONLY to Cloud β€” never directly to Station
  • βœ… Cloud is a relay β€” device data lives on Station
  • βœ… Station works offline β€” Cloud is optional
  • βœ… Updates are pulled β€” Station fetches artifacts from public GitHub repo