Shared Libraries And Scaffolder · TL;DR
1 min readTL;DR
A multi-tenant SaaS platform that ships several products (surveys, online menus, event pages, games, and more) faces one recurring temptation: copy the plumbing — auth, multi-tenancy, billing, messaging, email, storage — into every new product. The platform here resists that. Instead it factors each cross-cutting concern into a shared package (a .NET NuGet library for the backend, an @dloizides/ NPM library for the frontend), and only does so once a second* product genuinely needs it. The capstone of this effort is a product scaffolder, create-dloizides-app (run as manage.sh create-app), which composes a handful of code generators into a single command that emits a brand-new product wired onto the entire shared stack and ready to run (login → dashboard) before any product-specific features exist.
The mental model: shared packages are the Lego bricks; the scaffolder is the machine that snaps a starter set together. The scaffolder is pure synthesis of packages that already shipped — it does not invent new abstractions.