The core is the most important part which handles all IoT communications between apps and devices in realtime. Making the core event-driven was tough but reducing the latency below 200ms was tougher. Any change in devices state is needed to be reflected on the app instantly. We didn't use regular MQTT protocol. Instead we designed our own to reach that necessary milestone. And we did it after all.
We followed the model similar to pub/sub to allow IoT communications in form of events. A user can update a variable from app and its update handler on device-end would process that update.
And we created two containers for storing device variables: parms (for directly controllable parameters like an appliance's ON/OFF state which we can control form an app) and summary (for uncontrollable parameters like voltage/current of an appliance which we may just want to plot to see their pattern).
That feeling when I just clicked the button and the room turned white with light without any realizable delay. ❤️
In the core, I included an accounts manager and a devices registry. I also built an Auth API that lets the product developers build signup, signin type of functionalities in their apps. And there's a devices API
that runs on realtime communication channel. It lets them control their hardware devices from their apps.
File storage is the next in pipeline.