The Site Factory

Live. Five sites deploy from it today, including this one.

One shared engine that turns a folder of content and a palette into a live website: a brochure site in minutes, a membership site with logins, billing and gating in an afternoon.

What it does, step by step
  1. Generate a siteOne command writes a folder that compiles: build configuration, the seams the engine reads, a palette, pages that render, a customer-service assistant already mounted. The last run took nine seconds.
  2. Write only three thingsContent (what the site sells, its words, its legal clauses), brand CSS (four named colours, a type family, sizes) and configuration (name, origin, prices, provider ids). Anything else a new site has to write is treated as a defect in the factory.
  3. Membership, when a site needs itThree login doors (Google, Patreon, a six-digit email code), Stripe and Patreon billing, a tier ladder, content gating, token metering, a thirty-day hold on cancelled data, crons and alarms. Every site gets the same engine; none of them rewrites it.
  4. Prove it, every pushTwo hundred guards run before every deploy: types, dead code, secrets, a clean-room build from tracked files only, a live probe of every customer interaction on the deployed site, and a walk through every member route as every test member.
How it is built

An npm-workspace monorepo. One canon/ holds the engine and the page frame; each site is a thin folder that imports it through one alias. The canon is layered by an inward-only ring model and cut by a frame list, so a brochure site compiles the page shell, SEO and chat but never a login or a ledger.

  • TypeScript
  • Next.js 16 (App Router)
  • React 19
  • Supabase Postgres
  • Stripe
  • Patreon OAuth
  • Resend
  • Vercel (one project per site, one repository)
  • Node test runner, Playwright
  • Structure is canon, brand is the site. Canon CSS declares layout and mechanism and reads tokens it never defines; a site declares tokens and never declares structure. A guard asserts both directions.
  • Derived, not declared. The site roster, the guard list, the frame list, the sitemap and the factory inventory are read off the tree by scripts; a number typed into a document is treated as a bug.
  • A gate never seen red is a decoration. Every guard is proven by planting the defect it claims to catch and watching it fail, then restoring the tree.
  • Simplicity is rule one. Two designs that meet the requirements are not equal; the simpler one is correct and the other is a defect.
000 SITE FACTORY/
├── canon/                 the engine and the frame, edited here and nowhere else
│   ├── lib/               auth · membership · billing · ai · seo · catalogue engine
│   ├── components/        page shell · header · hero · sections · legal · chat
│   └── scripts/           ~200 guards, run before every deploy
├── blanksite/             the template, and the fleet-wide gates
├── membershipsites/       starforgekits/  dustylighthouse/
├── brochuresites/         nocmetals/  jeffxu/   ← this site
└── brochuresitesforclients/  bomicleaning/

a site = content + brand CSS + configuration, over one canon

all projects