Backend system automating prepaid electricity and water metering across multi-tenant buildings, replacing manual monthly meter reading with real-time MQTT telemetry, automated billing, and a scheduled, trigger-based anomaly detection pipeline.
Building managers tracked electricity and water usage through manual monthly meter readings and manually disconnected supply when a resident's prepaid credit ran out. This was labor-intensive, error-prone, and gave no visibility into meter tampering, reverse-flow, or sensor faults until a manual inspection caught them.
Built a NestJS and MySQL backend that ingests live MQTT telemetry from 2,444+ smart meters and converts it into prepaid token billing. A scheduled job (NestJS cron) handles retention and cleanup, and a 12-detector rule-based engine runs on each telemetry event to flag tampering, reverse-flow, and sensor faults in real time. Background jobs (BullMQ on Redis) handle OTA update fan-out and top-up delivery. Alerts and account notifications are delivered through a Telegram bot and SMTP email. Access is secured with Google OAuth 2.0, JWT with refresh-token rotation, and role-based access control across buildings. CI/CD runs through GitHub Actions (lint, test, build on every push, Dependabot for dependency updates), deploying to a self-hosted VM via PM2 with nginx as reverse proxy. The backend is covered by 166 Jest unit tests. I used Claude Code as part of the development workflow for implementation and code review. Live demo: https://netflow-demo.vercel.app/
Replaced manual monthly meter reading and manual prepaid disconnection with an automated pipeline covering 2,444+ smart meters in real time. The 12-detector anomaly engine surfaces tampering, reverse-flow, and sensor faults automatically instead of relying on manual inspection, and building managers and residents receive automated Telegram and email alerts instead of waiting for a physical site visit. The system is backed by 166 automated unit tests and an automated CI pipeline (lint, test, build on every push), which reduces the manual verification effort needed before each deployment. No production financial figures (cost savings, revenue impact) have been measured yet, as this is a delivered engineering project rather than a billed client engagement.
Covers 2,444+ smart meters with real-time anomaly detection across 12 detector types (tamper, reverse-flow, sensor-fault, and others), replacing manual monthly meter reading and manual inspection. Backend correctness is verified by 166 automated unit tests, and every push runs through an automated CI pipeline (lint, test, build) before deployment. No production financial figures have been measured for this project.