One codebase and design system for every Ravenry campaign page: each on its own address, every lead in one admin.

Serving the live SWDA page since 15 September 2026, unchanged to the pixel.

Open the previewDesign system docs
Walkthrough · VideoOne codebase, one design system, a host per campaign

Project facts

Role
Product design and direction. Built with AI coding sessions under my direction.
Timeline
3 weeks, 15 September to 6 October 2026
Built with
  • Claude Code
  • Playwright
  • Pillow
  • ffmpeg
Stack
  • Next.js 16
  • React 19
  • TypeScript
  • pnpm workspaces
  • Tailwind CSS 4
  • GSAP
  • Lenis
  • Supabase
  • Resend
  • GitHub Actions
  • Vercel
01

Before the Second Page, a Platform

Ravenry's first campaign page, the launch of a study with SWDA, was built as a single site with its own admin and database, before any design system existed. A second campaign was coming, and more after it. Copying the site for each one would multiply the code, the admin and the database, and with them every fix.

A branch, an app or a repository per page would each have made the second campaign cheap and every later change expensive. The approved plan made one app instead, in which each campaign is a folder that answers on its own address. The live SWDA page became campaign number one without a pixel of difference, and its parts became the design system every campaign shares, @ravenry/ui.

Extracting the system showed what one campaign hides:

  • Utilities that could not be re-themed. Tailwind wrote every colour utility as a literal, so no campaign could change one. The built CSS held one var() reference; after the fix, 183.
  • Timings that had drifted into eleven durations, fourteen delays and six distances, almost none of them decisions.
  • Two live accessibility defects: a focus ring as faint as 1.25:1 on the blue plate, failing 8 of 26 tab stops, and a skip link that led nowhere on four routes.
The campaign index: two campaign cards, SWDA marked Live and Rigor Room marked Draft, each with its address, and a dashed card for the next campaign showing the command that starts it
01Every campaign in one place, and the next one a command away
02

A Campaign Is a Folder

  1. Start a campaign with one command. pnpm new-campaign <id> writes the folder, registers it everywhere it needs to be, and prepares its database row.
  2. Describe it in plain data. Each campaign's campaign.ts holds its identity, its hosts, its search settings, its colours and its form: the fields and the consents, each with its exact wording.
  3. Give it an address. A proxy reads every request's host. A campaign's own host serves its folder; an old address redirects, keeping its path and query; anything else is the platform.
  4. Build it from the design system. The campaign names its colours by role, and every component, the form and the email follow them.
  5. Run it from one place. The index previews every campaign live, the documentation shows every component in any campaign's theme, and one admin keeps every campaign's leads apart. When a campaign has to leave, the exporter turns it into a private repository of its own, for a partner's developers.
02 · VideoEvery campaign previewed live, without leaving the index
The design system

A Campaign Names Its Colours, Everything Follows

A campaign's config names its colours by job: brand, navy, plate-lift, gold, thirty roles in all, as plain hex values. Anything else is refused, and a role left unnamed keeps Ravenry's default. One ThemeStyle tag in the campaign's layout writes the roles as CSS custom properties, and every utility on the page follows them. Section owns each page's grounds and rhythm, Reveal and Parallax move on one motion scale, and one form kit renders the campaign's declared form inline and in a popup.

The documentation lives at /design on the platform: 49 pages in nine groups, modelled on the documentation of shadcn/ui and Preline. Each component page has a live preview, its code, its props, accessibility notes and a do and don't list. A theme picker re-themes every page into any campaign's colours, and the choice lives in the address, so a page can be shared in SWDA's or Rigor Room's colours.

03 · VideoOne page, re-themed for each campaign
The same roles under three campaigns: the defaults, SWDA and Rigor Room, eight roles each
04One set of roles, three campaigns' colours
The design system's colour roles in SWDA's theme, each swatch saying the campaign named it
05Each colour says where it comes from: named by the campaign, the default, or following another role
The same roles in Rigor Room's theme
06The same components, Rigor Room's colours
07 · VideoOne form kit, each campaign's own questions
The admin

Every Campaign's Leads, Kept Apart

08 · VideoSearch, open a lead, see exactly what it agreed to
09 · VideoAnalytics for each campaign, on demo data

Every name, organisation and email in the admin shots is invented, on the reserved .example domain.

03

One Deployment, a Folder per Campaign

3shapes of one codebase
3hosts on the production deployment
5routing questions, then the platform
0files rewritten
System map in three tiers. Top: three shapes of one codebase. 01, the production deployment from main, serves ravenry-swda-landing.vercel.app, redirects SWDA's old event host to it and serves the platform host with the index and the admin. 02, preview builds of the working branch serve ravenry-profile.vercel.app, ravenry-campaigns-next.vercel.app and ravenry-rigor-room.vercel.app. 03, the Rigor Room export serves masterclass.theravenry.com with its own admin and database. Middle: every request enters proxy.ts, which rewrites a campaign's host into its folder and sends the rest to the platform pages; both import three packages, @ravenry/ui, @ravenry/leads and @ravenry/email. Bottom: GitHub Actions checks every change, the exporter turns a committed tree into export 03, Resend sends email, and Supabase holds one row per lead.
10One codebase, three ways to run it
Three shapes

One Codebase, Three Ways to Run It

The same code runs in three shapes. The production deployment, built from main, serves SWDA's page, redirects its old event address and serves the platform host with the index and the admin. Preview builds of the working branch serve the company profile, the redesigned index with the documentation, and Rigor Room's draft, each on an address of its own. An exported copy serves one campaign on a domain the platform does not own, with its own database. In all three, a proxy decides what each request is for, three packages carry everything shared, Supabase holds the leads and Resend sends the email.

  • Production serves three hosts from main, and every push to it deploys.
  • Work waiting for the release publishes from the branch, on its own addresses.
  • An export is the same code, switched to one campaign and one host.
Routing

Five Questions, Then the Platform

The proxy runs before anything renders and asks five questions, in order. Is this an exported copy? Then every host is its one campaign. Is the host an old alias? Then a 308 to the real address, path and query kept, so every link ever shared still lands. Is it a campaign's own host? Then the request is rewritten into that campaign's folder, and admin paths go to the platform host, where the session lives. Is it the profile's host? Then it serves the profile alone. Off production, was a campaign chosen by hand? Then that one. Anything else is the platform, marked noindex on every response. A path that names a file is never touched, so downloads and robots.txt arrive as they are.

  • robots.txt and the sitemap answer per host, from each campaign's own config.
  • A local build picks a campaign by query, header or subdomain; production honours hosts only.
Host routing as a flow. A request arrives, and the matcher skips any path that names a file. Then five questions, each with a no that falls to the next. 01: a standalone export? Every host is that one campaign, the admin answers in place and only the admin is noindexed. 02: an old alias, like SWDA's old event host? A 308 to the campaign's own host, path and query kept. 03: a campaign's own host, like ravenry-swda-landing.vercel.app? A rewrite into app/campaigns/<id>/, with /admin, /api/admin and /design sent to the platform host by a 307. 04: the profile's host, ravenry-profile.vercel.app? / is the profile, /about returns to /, admin paths go to the platform host, nothing else answers. 05: off production, a campaign chosen by query, header, subdomain or default? That campaign. 06: everything else is the platform, with noindex on every response.
11The host decides, in five questions
Boundaries

Lint Keeps the Folders Apart

A campaign cannot import another campaign; the shared packages cannot import the app; the proxy cannot import anything that renders. The registry fails the build if two campaigns claim the same id, slug or host. Three packages carry everything shared, as TypeScript source with no dependencies of their own, so there is only ever one copy of React: @ravenry/ui for the design system and the form kit, @ravenry/leads for the campaign and form declarations and the server side of lead capture, and @ravenry/email for the email layout.

Tenancy

One Accessor for Every Read

One database serves every campaign, and every lead carries its campaign's id, which cannot be empty. Every list of leads, the analytics and the CSV export go through one accessor that cannot be called without a campaign, so no admin view can mix two campaigns' leads.

SWDA's page on its own host, served from the same build
12SWDA, on its own address
Rigor Room's page on its own host, from the same build
13Rigor Room, on its own address
14 · VideoOne build, a host per campaign
The life of a theme

From One Hex Value to a Pixel

  1. SWDA's config names a role, for example brand: "#0c4aaf", and the campaign definition refuses anything that is not a hex colour.
  2. The theme function writes :root{--color-brand:#0c4aaf;...}, so nothing but a colour can reach the stylesheet.
  3. ThemeStyle renders it as a plain style tag that React 19 hoists into the head. Unlayered, it beats Tailwind's layered defaults in any load order.
  4. Utilities read the role, so bg-cloud paints var(--color-cloud). Each default points into a reference tier of 18 raw brand values that no utility can use directly.
  5. Component tokens resolve where they are drawn: the call to action's shadows mix from glow, which follows brand unless a campaign names it.
  6. Email clients cannot read custom properties, so the email resolves the theme to literals, and a check holds those literals to the tokens.
A role overridden in one place, and every utility on the page following it
15Roles, not values: a campaign names a role, the page follows
04

One Database, Kept Apart by Code

3tables
5migrations, each applied by hand
29columns in leads once 0005 lands
0defaults on project_id

One Supabase Postgres database holds every campaign. projects has a row per campaign, with its status and its rate limit. leads has a row per submission, and its project_id cannot be empty and has no default, so a submission without a campaign is refused rather than filed in the wrong place. A campaign's own questions land in a fields object and every consent in a consents array, so a new question needs no migration. Row-level security is on with no policies: nothing reaches the tables from a browser, and the server's key is the only way in. So tenancy is code: every list of leads, the analytics and the CSV export read through one accessor that takes the campaign's id first.

Data model. projects: one row per campaign, with id, a unique slug, name and client name, a status of draft, active or archived, and a rate limit of 5 in 60 minutes. leads: one row per submission, grouped as identity with project_id, the five core answers, fields for a campaign's own questions, consent columns plus a consents array, the email outcome, request metadata with a hashed IP, and the first form's columns kept for old rows. login_attempts: id, a hashed address and a time. The one relation: leads.project_id to projects.id, not null, no default, on delete restrict. Row-level security on all three with no policies; tenancy is the accessor leadsQuery(projectId, columns). Below, five migrations: 0001 init, 0002 projects, 0003 strict on 5 Aug 2026, 0004 consent on 29 Aug 2026, and 0005 records, written and waiting.
16Three tables, one relation, five migrations
Migrations

Five Files, Applied by Hand

Each change is a file with its reasoning, applied in the SQL editor before the code that needs it deploys. 0002 and 0003 are one change around a deploy: add project_id with a temporary default, ship code that sets it, then drop the default, so production never broke. 0004 added SWDA's consent as a new column instead of renaming the old one, because a rename would restate what earlier readers agreed to. 0005 adds fields and consents; its backfill marks every record it writes and leaves the wording empty, because the old columns never recorded one. 0005 waits to be applied, and the platform's release waits for it.

  • On delete restrict: a campaign that holds leads cannot be deleted.
  • Consent columns are only ever added; a retired one stays readable.
  • Until 0005 lands, the admin still shows every lead and says what is missing.
05

One Template per Campaign, One Layout

2ways a send starts
10theme roles in each palette
0 pxbetween SWDA's old and new email
0forms a failed send can fail

Two things can send a campaign's email: a successful submission, only when the campaign switches autoSend on, and Send email now in the admin, for one lead at a time. Either way the lead gets its own campaign's template, found through a server-only registry. Templates are React components on one shared Ravenry layout: nested tables and inline styles, no rounded corners, and a plain-text part written by hand. The renderer restores the HTML5 doctype and Outlook's fixed-width wrapper, and Resend sends from the campaign's own sender. The result lands on the lead's row as a sent time or an error, and a failed send never fails the form.

The email path. Two triggers, a submission when autoSend is on and never for a honeypot, and Send email now from the admin for one lead's own campaign, lead to 01, the campaign's template, thank-you.tsx, found through registry.server.ts. Then 02, renderEmail: React Email, the HTML5 doctype and Outlook's 600 px wrapper. Then 03, Resend, from the campaign's own sender and reply-to. Then 04, the row: email_sent_at or email_error, and a failure never fails the form. Below, the colours: campaign.ts names its roles, resolveTheme turns every role into a literal, and the EmailPalette, ten roles and a plate colour measured from the page, feeds the template. token-drift.py fails if a copy drifts from its token.
17Two triggers, one template, the outcome on the row
The theme in an inbox

Derived, Never Copied

Inboxes cannot read CSS custom properties, so an email's colours are literals. They are derived rather than typed: the campaign's theme is resolved against the design system's defaults, and ten roles become the email's palette. The one value that is not a role is the plate, a flat colour measured from the rendered page, because an inbox cannot draw its vignette. A check fails when any copied token drifts from its source. It caught Rigor Room's email still carrying SWDA's blue.

  • autoSend is off for both campaigns today.
  • SWDA's email moved onto the shared layout at 0 px, proven without sending.
  • pnpm email:render prints any campaign's email through its real template.
06

One Admin, Three Layers

3layers on every admin request
1admin, no roles
1accessor for every list of leads
401for the CSV without a session

There is one admin account, its email and a bcrypt hash of its password held in the environment, and no roles. Signing in counts failed attempts per hashed network address, compares the password, then sets an http-only cookie carrying a payload signed with HMAC-SHA256 and an expiry. Every admin request meets three layers. The proxy checks only that the cookie is present, because a known framework flaw once let requests skip middleware. The admin layout verifies the signature on the server. And every page, action and route checks again; the CSV export answers 401 without a session.

Admin sign-in and access in three rows. Signing in: 1, the form, which returns only to /admin or /design; 2, failures counted per hashed network in login_attempts, too many means wait; 3, bcrypt against the hash held in the environment; 4, a signed cookie, an HMAC-SHA256 payload with an expiry, http-only and same-site; a miss is counted. Every admin request: layer 1, proxy.ts asks whether the cookie is present; layer 2, the layout verifies the signature on the server; layer 3, every page, action and route checks again, and the CSV answers 401. One campaign at a time: ?project=<slug> or SWDA by default, one accessor, leadsQuery(projectId, columns), feeding the leads table, the analytics and the CSV, with columns from the campaign's own form declaration.
18One admin, three layers, one campaign at a time
Per campaign

One Campaign at a Time

The admin opens on one campaign: the one named in the address, or SWDA, chosen by name rather than by table order. The leads table, the analytics and the CSV export all read through the same scoped accessor, and their columns come from that campaign's own form declaration, so Rigor Room's team size and business challenge appear as columns of their own. The CSV carries the campaign's slug in its file name, so two clients' exports are never confused, and each lead opens with its consent record.

  • On a campaign's host, admin paths go to the platform host, where the session belongs.
  • Logins per partner are designed and deliberately not built.
  • Send email now sends a lead its own campaign's email, and never a second time.
07

Checked on Every Change, and Every Day

57check scripts
3checks on every pull request, after lint and build
16gates per export
1read a day keeps the database awake

There is no unit-test suite. The checks are Playwright and Pillow scripts that drive a running server: 57 on the working branch, ten for every campaign, 36 for SWDA, nine for Rigor Room and two at the top. Every pull request runs lint, which keeps campaigns apart, the build, which is the typecheck, then health, routing and theme against a production server, with no secrets. Once merged, a nightly run asks production the same questions, the database included. Every export passes sixteen gates. Locally, a suite is green only when every script exits 0 and its output matches a saved run.

What checks the platform, in five columns. 01, every pull request, in ci.yml: lint keeps campaigns apart, the build is the typecheck, then health, routing and theme. 02, every night once merged, in nightly.yml: production's hosts and the database, health and theme, and a real download whose lead is deleted. 03, every day: keep-alive.yml and a Vercel cron ask /api/health on the platform host, one indexed read. 04, every export: 16 gates, from a leak scan to the pixels at 0 px. 05, on the Mac, checks/run.py: a suite per campaign, green when every script exits 0 and its output is unchanged, with pixel captures. Below: 10 scripts for every campaign, 36 for SWDA, 9 for Rigor Room and 2 at the top. Never in a suite: one logs in, one prints real leads, one rewrites source, one sends an email.
19Five places the checks run
Keep-alive

One Read a Day

Supabase pauses a free project after about a week without traffic and withdraws its DNS record, so the form fails for every visitor. It happened on 15 September 2026. Since then a GitHub Actions job asks the health route once a day, and the route runs one indexed read that returns no rows. A healthy answer is cached at the edge for ten minutes, a failure is never cached, and GitHub reports a failed run. A Vercel cron makes the same call as a second line.

  • Four scripts never run in a suite: one logs in, one prints leads, one rewrites source, one sends email.
  • Test rows are tagged, and deleted by prefix afterwards.
  • Pixel captures stay local: Linux draws type differently from the Mac they came from.
08

Seven Phases, the Live Page Untouched

The plan was approved on 15 September 2026 and went in phases, each ending with the live page's pixel captures unchanged:

  • Phase 0, the safety net: a tag, a backup branch and the renames.
  • Phases 1 to 3, on the same day: the workspace, campaigns as folders with host routing, and the design system's foundations, extracted from the live page in six steps within 42 minutes. In production since 15 September.
  • Phases 4 to 7, built by 16 September: one form declaration per campaign with consent records, an email per campaign, the scaffolder and the documentation gallery, and checks on every pull request. They wait for one database migration before they reach production.
  • 16 to 23 September, the design system grows: three token tiers with 30 roles, a type ramp and layout primitives, then the documentation, published at 49 pages with the brand's logo, imagery and print face.
  • Phase 8, the second campaign: Rigor Room, built on the platform from 16 September and later exported, the exporter's first real test beyond the live page.

Claude Code wrote the code and the checks, phase by phase, from rules split by what they govern: one file for the platform, one for the design system, one for each campaign.

Decision 01

One App, Campaigns as Folders

One app keeps one copy of everything shared, so a fix lands once for every campaign. The cost is a shared blast radius, contained by atomic deploys, lint boundaries and each campaign's own checks, and a proxy that now runs on every request.

Decision 02

Extract, Never Redesign, and Prove It in Pixels

The live page could not change while it moved onto the platform and gave up its parts to the design system. Every step was an extraction, and full-page captures from production became the proof, compared pixel by pixel after each one. The cost: the defaults stayed SWDA's until the token tiers arrived, and pixels cannot see a page's title.

Decision 03

Roles, Not Values

One stylesheet serves every campaign, so campaigns set named roles only, and the raw ramps stay outside Tailwind's theme. The cost: shadows are not roles, because a shadow is not a colour, so a campaign's own elevation lives in its own CSS.

Decision 04

Measurement Instead of Prohibition

Ink and the neutrals were first withheld from campaigns, so that none could make a page illegible, and that froze the defaults. Now all thirty roles are themeable, and a contrast matrix checks every pairing before a build. The cost is a strict order for any change: pin the old value, prove 0 px, then move.

Decision 05

One Form Declaration per Campaign

A campaign declares its fields and consents once. The form, its validation, the database insert, the admin table and the CSV export all read that declaration, so a new question needs no database change, and each consent is kept with its exact wording and version. The cost: the release waits for one migration that adds the columns, applied by hand in production.

Decision 06

Hand-Drawn Marks Instead of an Icon Set

AI-generated sites tend to share one icon set, and it shows. The system draws four marks of its own: two arrows, a check and a close, each a hair thinner and slightly more irregular than the original, so they read as drawn for the publication. The cost: one spinner still uses the icon set, the only import left.

Iconography: four hand-tuned marks at three sizes, each with its job
20Marks, not an icon set
09

A Tool for the Team, a System for Every Campaign

  • A tool, not a brochure. The index is a white bar and one card per campaign, with status and address in plain sight and actions that each do one thing. A card for the next campaign shows the command that starts it.
  • Live previews. A popup shows any campaign at desktop or phone width, with full screen as an extra.
  • The brand's rules in shared pages: flat objects with square corners, opaque chrome, and the brand's plate image for blue grounds. The admin stays plain: quiet, dense and legible.
  • Documentation that cannot drift: values are read from the themed page, never typed, and a coverage map ties all 49 of the package's exports to a page, so a new export without a page fails the build.
  • Focus rings follow their ground: on the plate the failing stops now measure 10.47 to 13.68:1, and all 26 pass.
  • 44 px targets, stricter than WCAG 2.2's 24 px, and a skip link that a check presses with the keyboard on every route.
  • Reduced motion is a full still state: numbers show their final value, and the travel check reads 0.0 px.
21 · VideoThe lift, the sheen and the glow
22 · VideoThree depths part under the pointer
23 · VideoA refusal that names every field
Rigor Room previewed at phone width inside the index
24The same preview at phone width
Tools: the design system and the admin
25The team's tools, one click from every campaign
Two buttons with the keyboard's focus ring, on paper and on the plate
26The focus ring follows its ground
The sample form refused: each field marked and described, focus on the first
27Each failed field is marked and described
10

In Production, and Proven Twice

3hosts served by one production deployment
2campaigns built on it so far
1command to start a new campaign
30colour roles a campaign can set
49design-system pages, every specimen live
29contrast pairings measured for every campaign
26 of 26tab stops with a visible focus ring, up from 18
0 pxchange to the live SWDA page through the move

Since 15 September 2026 one production deployment serves three hosts: SWDA's page on its own address, its old event address redirecting to it, and the platform host with the admin. The live page moved onto the platform and onto the design system unchanged to the pixel, and a daily health check has kept the free database tier awake since it paused once, that same day. The second campaign, Rigor Room, was built on the platform, naming 22 of the 30 roles where SWDA names 29, then left through the exporter to go live on a domain of its own.

The lesson is that a platform is mostly rules, and that measurement is what makes a shared system safe to open up. Withholding colours from campaigns protected legibility but froze the defaults; measuring every pairing let all thirty open, with the checks as the guard.

Known limits: the redesigned index, the documentation, the consent records and the scaffolder wait for the release, which waits for one database migration applied by hand; production's index is still the earlier plain list. No design-system recipe is published yet, because one waits for a second campaign to need it.

11

Gallery

The preview popup at desktop width
28Any campaign, previewed at desktop width inside the index
Rigor Room's lead form, with its own questions
29Rigor Room's form asks its own questions
The admin's leads table, on demo data
30Every campaign's leads, kept apart (demo data)
One lead opened with its consent record, on demo data
31A lead and what it agreed to
The admin's analytics, on demo data
32Leads and email delivery over thirty days (demo data)
How the proxy routes hosts, beside the windows each host opens
33Each host opens its own campaign from one build
The plate under the design system's defaults, under SWDA, and under Rigor Room
34The plate under three campaigns' roles
The type page: Inter's specimen and an eleven-step ramp
35One typeface on the web, one ramp of eleven steps
The logo: the lockup on paper and on the plate, and the mark
36The logo's colourways on paper and on the plate, with its clear space
The 26 imagery references: black and white subjects with the sun behind
3726 references for every picture
Elevation: the five shadows the system allows, each named for its job
38Almost no shadows, each named
Motion: three durations, a stagger step and two distances
39Eleven durations cut to three, with one stagger
The sun on paper and on the plate
40The sun, the one circle
Page anatomy: the five layers of a campaign page
41Five layers, one decision each
Accessibility: requirements, what they mean and the check that holds each
42Every requirement has a check
Four live components: the call to action, the form's refusal, the modal and the depth scene
43Four components, each one the real thing

Keep browsing

More AI Engineering

All projects
  • IntLabs WebsiteA business simulation company's website, its writing admin and its database: 76 pages, ten designed emails, row level security on every table.
  • Bubblegum ParadisoAn interactive character microsite: pop the bubbles, plant a sky garden, walk an invisible cloud on a leash.
  • Sari RendangA halal Padang restaurant's website, chosen from three complete looks, every reservation and nasi box order ending in WhatsApp.