IoT Device Communication Platform
A real-time backend platform enabling mobile and web applications to communicate with and control hundreds of connected IoT devices.
The project involved designing and maintaining a production backend platform responsible for communication between mobile applications, web interfaces, configuration tools, and hundreds of physical smart home devices.
The backend acts as the primary API layer between end-user applications and an embedded controller, providing a consistent interface for device control, configuration, and real-time state synchronization.
The system supports 19 device categories including lighting, security, HVAC, media, locks, and cameras, while combining REST APIs, WebSocket event streaming, MQTT messaging, and legacy SOAP communication within a single event-driven architecture.
The primary challenge was creating a responsive modern API layer on top of an existing embedded device ecosystem that relied on several different communication protocols.
Multiple applications could request the same device information simultaneously, while the underlying controller had limited resources and needed to remain protected from redundant requests.
The system also had to operate across multiple hardware generations and two Node.js runtime generations while remaining available during controller restarts, firmware updates, and temporary connectivity interruptions.
Real-time event subscriptions introduced another challenge: thousands of client subscriptions needed to be managed reliably without creating memory leaks or unnecessary controller load.
An event-driven Node.js backend architecture was implemented using Express as the REST API layer and Socket.IO for real-time client communication.
The entire device project state was maintained in a LokiJS in-memory database, allowing extremely fast device and configuration lookups without repeated disk access.
A custom request queue and throttling system was created to detect duplicate requests, execute a single operation against the embedded controller, and distribute the result to all waiting clients.
MQTT was integrated for publish/subscribe communication and feature management, while SOAP communication was handled through a persistent event-driven connection to the embedded controller.
JWT authentication, caching, retry mechanisms, subscription cleanup, nginx proxying, and cross-platform deployment support were incorporated to create a resilient production system.
The completed platform provides reliable real-time control and synchronization across hundreds of connected devices while maintaining sub-second interaction times.
Request coalescing significantly reduces unnecessary controller operations when multiple clients request the same data, while WebSocket and MQTT communication eliminate the need for continuous polling.
The platform operates from a single codebase across eight hardware platforms and supports both Node.js 12 and Node.js 18 environments.
Graceful degradation and offline authentication capabilities allow applications to continue receiving meaningful system responses even when the underlying controller or cloud connectivity is temporarily unavailable.