Smart Facility IoT Monitoring Platform
Engineered a multi-site IoT monitoring platform: a config-driven React/TypeScript SPA and Express API over SQL Server that projects live sensor, occupancy and BLE asset telemetry onto annotated floor plans, shipped as customer-specific production builds.
- Role
- Full-stack engineer · frontend, API & data
- Year
- 2021–2023
- Type
- IoT & digital twins
- Stack
- React · TypeScript · Node.js · Express · Microsoft SQL Server · Redux · Azure App Service · Azure AD · MSAL · Azure Maps · Azure AI services (Face, Custom Vision) · amCharts · Prisma
- customer-specific builds from one codebase
- 3
The problem
Facilities teams received telemetry from many device types (air quality, leaks, occupancy, parking, energy and water meters, BLE/GPS tags) through a third-party IoT data-sharing service, with no single operational view per site, floor, room or desk. They needed live state, historical trends, alert rules and self-service admin, and each customer required its own module set and branding from one shared codebase.
Architecture
- 01
Source
Sensor readings and BLE/GPS tag events from a third-party IoT data-sharing service, served alongside Microsoft SQL Server operational data.
- 02
API
Express layer over a shared SQL access module with pooled connections, transactional batch execution and per-row results for bulk uploads.
- 03
Configuration
Per-module JSON facts files declare upstream record types, field mappings, value-to-state rules and the site, floor, location hierarchy.
- 04
State
Redux with redux-thunk drives real-time and trend views; tag events are cached client-side so filtering needs no further API calls.
- 05
Visualisation
Live readings joined to W3C Web Annotation regions on floor plans in Annotorious, with amCharts trends and Azure Maps asset tracking.
- 06
Identity and hosting
Azure AD sign-in via MSAL with silent bearer-token acquisition, deployed per customer variant to Azure App Service (iisnode).
Engineering highlights
01
Floor plans as annotations
Modelled rooms, desks, parking bays and asset zones as W3C Web Annotation media fragments and joined live readings to colour-coded regions. The same rendering layer was reused for forklift zones and computer-vision bounding boxes.
02
Config-driven sensor modules
Each sensor module is driven by a JSON facts file declaring upstream record types, fields and value-to-state rules, so customer variants differ mainly in their facts files and enabled routes rather than bespoke component logic.
03
Recency-based asset status
Classified forklift tags as active, inactive or silent from event recency over a single three-day fetch, de-duplicated client-side. Filters run on cached data, and Axios cancel tokens abort in-flight requests on navigation.
04
Self-healing SQL access layer
Shared data layer with transactional batches that roll back on first failure and report per-row outcomes. Later reworked into a lazily created connection pool that resets after a failed connect, with error logging and configurable encryption.
05
Token-aware API client
Rewrote the front end on msal-browser and msal-react, with an Axios request interceptor that acquires tokens silently for the active account and attaches a bearer token to every API call.
06
Production re-hosting
Moved the stack to a newer App Service plan: pinned the iisnode runtime and tuned retries, surfaced genuine 5xx failures instead of masked 200s, and corrected CORS for the redeployed front ends.