City of New Britain, CT

City of New Britain Digital Ecosystem

One multi-tenant Node.js/MongoDB backend and one Angular + NgRx admin panel powering four independent public city websites, each its own Angular SSR frontend, with a full performance, SEO and compliance overhaul.

Last updated

  • Node.js
  • Express
  • MongoDB
  • Mongoose
  • Zod
  • AdminJS
  • Angular
  • Angular SSR
  • NgRx
  • TypeScript
  • RxJS
  • Tailwind CSS
  • Angular Material
  • JWT
  • RBAC
  • Docker
  • nginx
Cover for the City of New Britain Digital Ecosystem case study

Overview

The City of New Britain, Connecticut runs four public websites: NB Recovers, Visit New Britain, NB Youth Prevention and NB CyberSafe. I own the architecture behind all of them: a single shared, multi-tenant Node.js and MongoDB backend, a single shared Angular + NgRx admin panel, and four independent Angular SSR frontends, one per site.

Each site has its own audience and its own real features, but content, users and permissions are managed in one place.

The challenge

Four sites with different purposes could easily have become four separate codebases, four admin panels and four deployments to maintain. The goal was the opposite: one platform that keeps each site's data properly separated, gives editors one admin panel, and still lets every site ship features of its own.

  • Each tenant's content has to stay isolated while sharing one API and one database.
  • Each public site needs its own features, not just its own colours.
  • Public city sites have to be fast, discoverable and compliant: Core Web Vitals, sitemaps and a cookie consent that really controls third-party scripts.
  • Deployments have to stay simple, even with five Angular apps and one API.

What I built

One backend, many tenants

Multi-tenancy is modelled in the data layer, so each site's content stays separate while all four share one API and one database. The shared admin panel manages around 40 resource types, with JWT authentication and role-based access control deciding who can edit what.

Four public frontends with real features

  • A searchable business directory.
  • A working meeting-registration system for the Parent Café program.
  • An interactive cybersecurity quiz with incident reporting.

Performance, SEO and compliance overhaul

  • Core Web Vitals work across the SSR frontends.
  • A GDPR-style cookie consent that actually gates third-party scripts until the visitor agrees.
  • Dynamic sitemap generation per tenant, built from each site's live content.
  • Public API sessions gated by reCAPTCHA, so the open endpoints are not an easy target for bots.

One deployment template

Deployment is a parameterized Docker and nginx setup: the same template serves every site, so adding or updating a site is configuration, not a new pipeline.

Tech & architecture

  • Backend: Node.js, Express, MongoDB with Mongoose, Zod request validation, AdminJS.
  • Frontends: five Angular apps (standalone components, SSR), NgRx, TypeScript, RxJS, Tailwind and Angular Material.
  • Security: JWT authentication, RBAC and multi-tenant data modelling.
  • Infrastructure: Docker and nginx, parameterized per site.

Outcome

The city runs four distinct public websites from one backend and one admin panel. Editors work in a single place, each site keeps its own features and data, and the shared performance, SEO and consent work benefits every site at once. New sites slot into the same architecture and deployment template instead of starting from scratch.