Skip to content

What is EcoCtrl

EcoCtrl is an energy and IoT control platform that combines a 3D building visualization portal, a real-time monitoring admin dashboard, and a REST API backend into a single pnpm monorepo.

It is designed for facility teams who need to:

  • Visualize multi-floor buildings and equipment in 3D, with hotspot annotations and live data overlays.
  • Monitor energy consumption, faults, and IoT device states in real time.
  • Manage devices, users, alerts, maintenance plans and reports from one admin console.
  • Integrate with third-party IoT gateways via a typed proxy layer.

At a glance

LayerStackPurpose
apps/webReact Router 7 + Babylon.js + TailwindCSS v4Public 3D portal — building view, floors, systems, analysis
apps/adminReact 19 + Recharts + TailwindCSS v4Internal admin dashboard — accounts, devices, models, reports, settings
apps/docsVitePress 2This documentation site
packages/serverFastify 5 + Drizzle ORM + PostgreSQL + RolldownREST API and IoT gateway proxy
packages/uiReact + Base UI + TailwindCSS v4Shared component library (shadcn/ui style)
packages/sharedZod + TypeScriptShared schemas, types and Vite tooling

High-level architecture

                ┌───────────────────────────────┐
                │    Browser (web / admin)      │
                └───────────────┬───────────────┘
                                │ HTTPS

                ┌───────────────────────────────┐
                │   Caddy reverse proxy (TLS)   │
                │   /api/* → server  /static/*  │
                └───────────────┬───────────────┘

            ┌───────────────────┴────────────────────┐
            ▼                                        ▼
  ┌──────────────────┐                     ┌──────────────────┐
  │ Static SPA bundle │                     │ Fastify API       │
  │ (admin / web)     │                     │ Drizzle + Postgres│
  └──────────────────┘                     └──────────┬────────┘


                                          ┌──────────────────────┐
                                          │ Third-party IoT API  │
                                          │ (token-refreshing)   │
                                          └──────────────────────┘

Every client app talks to the API via a fixed /api prefix; the actual backend hostname is rewritten by Vite's dev proxy in development and by Caddy in production. This means changing the API host or prefix never requires a rebuild of the frontend.

Where to go next

Released under the MIT License.