Deno KV System Server
07/08/2023
Deno Deploy app built with Deno KV for remote processing of system state into device control actions.
This is the new backend for processing system state into control actions on the shineponics platform.
It is a work in progress and has not been kitted-out with all of the necessary bells and whistles yet. It allows developers to define the devices within a system and their relationships to each other in TypeScript code. This code is then used when devices with matching IDs to the defined system POST their state data to the cloud.
The Deno KV database was instrumental in allowing this to work in the Deno Deploy serverless environment. Each POST request from a device updates an object stored in Deno KV. Deno Deploy instances wait for all system devices to have POSTed fresh data before they calculate control actions and respond to device requests.
Each device receives only it's own control actions and must request with the correct TLS certificate authority for encrypted HTTPS networking. Additionally, devices will need to request with a specific token generated by the backend for that device but this is not yet implemented. These measures are to keep all networking secure as any unintended access to a real-world control system could lead to devastating consequences.
This technology is being used to control and log the balcony smart farm data right now! There are currently no control systems in the Balcony smart farm but this is being developed.