StadtPuls

  • Node.js
  • TypeScript
  • Vue
  • PostgreSQL
  • Docker

Description

An IoT platform for municipal utilities: LoRaWAN readings from water meters and sensors arrive validated in a dashboard with a site tree, a map and consumption charts. Each tenant sees only its own assets.

Implementation Details

Node.js services built with Moleculer and connected over RabbitMQ. Incoming uplinks are validated, deduplicated and decoded in a sandboxed driver runtime. Measurement time and ingest time stay separate, so no misleading time series appear. Master data lives in PostgreSQL, measurements in InfluxDB 2. The REST API is generated as OpenAPI from the route table and uses keyset pagination. Keycloak issues OIDC tokens, and permissions plus scopes keep tenants apart. The Vue 3 dashboard is bilingual and signs in with PKCE. 253 automated tests, 9 browser tests against the production bundle and a 15-job GitLab pipeline back it up.

Decision, trade-off, evidence

Decision
Every reading carries two timestamps: when the meter measured and when the value reached StadtPuls. Time series and charts only use the measurement time. The types do not even allow an ingestion time there.
Trade-off
Late or duplicated uplinks land in the right place instead of distorting consumption charts. The price is two data stores (PostgreSQL and InfluxDB) with separate backups, and context and readings are joined in application code.
Evidence
Unit tests keep the two timestamps apart. Integration tests check tenant isolation: another tenant's asset answers 404 instead of 403, so not even its existence leaks.
Duration
Ongoing project
Role
Solo Project
Next ProjectPraxis UI Lab