PCB Dashboard: a multi-tenant platform for pollution control compliance
A compliance platform designed around a state pollution control board’s operating model — from head office down to individual industries.
- Role
- Architect and full-stack developer
- Employer
- Ecologic Engineering
- Scope
- Designed for 125,000+ regulated industries
- Stack
- React 18, Express, PostgreSQL, Redis
Overview
Pollution control boards regulate industries through a hierarchy of offices: a state head office, zonal offices, regional offices and, below them, the industries themselves.
PCB Dashboard is designed around that model. It brings inspection, laboratory, legal, emergency, financial and compliance workflows into one platform, with access scoped to each level of the hierarchy and a Flutter app for field inspection officers.
The problem
Each user — a state administrator, a regional officer, a lab user or an industry — should see and act on exactly their part of a very large dataset. The platform is scoped for more than 125,000 regulated industries, so the data model and access control have to hold up at that size.
What I built
- A normalized PostgreSQL schema of more than 50 tables, with recursive hierarchy trees and multi-level tenant isolation.
- Hierarchical, JWT-based role-based access control with granular permission scopes.
- An automated compliance-scoring engine.
- Zod runtime validation and Prisma ORM for type-safe database access.
- Redis caching with SCAN-based, non-blocking cache invalidation.
- Hardware-accelerated 3D terrain rendering for geospatial compliance tracking with Three.js, React Three Fiber and the Google Maps API.
Architecture
A React 18 and TypeScript dashboard (built with Vite) and a Flutter inspection app share an Express and TypeScript API. Prisma and PostgreSQL hold the tenant hierarchy and domain data; Redis caches API responses.
-
Clients
Web dashboardReact 18 · Three.jsInspection appFlutter -
API
Express APITypeScript · RBAC · Zod -
Data
PostgreSQLPrisma · 50+ tablesRedisCaching
- State
- Zone
- Region
- Industry
Engineering decisions
- Hierarchy in the schema. Offices and industries are stored as recursive trees, so tenant isolation and permissions follow the organisation’s real structure.
- Validate at runtime, not just compile time. Zod schemas check request data at runtime, complementing TypeScript’s compile-time types and Prisma’s typed queries.
- Non-blocking cache invalidation. Clearing cache entries with SCAN instead of KEYS avoids blocking Redis while keeping cached responses consistent.
Evidence and status
The codebase is private to Ecologic Engineering, so there is no public repository or live demo.
I can walk through the schema design, tenant isolation and RBAC model in an interview.