Case study 03 · In use

Landing page builder

A block constructor for product landing pages. One operator assembles a page from typed blocks, an AI step writes the copy and code checks every field, and the page is exported as a light static file only after automated checks pass.

Results at a glance

244 of 244variants pass all 9 render scenarios
56page designs: one core and 55 themed
$0.03–0.05model cost for a full page, 66–100 s (two measured runs)

Project facts

RoleDesigned and built with AI coding agents. I wrote the specs, reviewed and gated every release, and use it as my working tool.
PeriodSince November 2025; block constructor since September 2026
StackReact, Vite, Tailwind, TanStack Query, dnd-kit, Node.js, Express, Prisma, PostgreSQL, Playwright, Sharp
AILLM copy with validation and retries, a vision model for product photos, local background removal
01

Problem

Product landing pages are needed for several countries at once, each in its own language, currency and phone format, and one operator builds them. The earlier setup had about ten fixed HTML templates, several tied to a single market, so a new layout meant a new template. At the audit before the rebuild the code had 63 automated tests.

The rebuild had to make pages composable from reusable blocks, have AI write copy that fits every field, keep every block readable on a phone in long languages and right to left, and export a light static page whose images, fonts and scripts all ship inside the package.

02

What I built

A block constructor with an AI copy step and an automated quality gate. The operator starts from a product link, a store preset and the target countries; each country becomes a queued job in which an AI step writes all copy and code checks it. In the editor the operator swaps block variants, moves blocks between pages, previews the page on a 390 px phone and exports it after a pre-flight check.

It is my own working tool. The block designs and page structures stay private, so instead of screenshots this page has a schematic demo: switch a block's variant, move it up or down, let the AI step fill the copy, then run the quality check.

  1. Header · Logo left
  2. Product · Image left
  3. Benefits · Three columns
  4. FAQ · Accordion
  5. Interactive game · Quiz
  6. Order form · Single step

QA not run

Illustration. Schematic blocks only: the real designs and page structures are not shown.

03

Key parts

Typed blocks and composition rules

The library has 27 block types and 244 variants: header, product gallery, price, benefits, FAQ, guarantee, delivery date, colour and size picker, order form, footer and more. Every variant describes itself: its text fields with their limits, its settings, the events it fires, how it renders and its own quality record.

  1. The settings panel is generated from each variant's description, and text fields show their limits and errors while the operator types.
  2. Composition rules run in the browser and on the server, so the editor flags a problem as it happens and the export refuses it for the same reason: at most one order form, placed before the finish; a block that shows a result only after the block that produces it; no page without a way forward.
  3. Switching a variant keeps the texts and settings that still fit and sets the rest aside, so switching back restores them.
  4. Editing is built for speed and safety: drag and drop with keyboard and menu alternatives, a command palette, 100-step undo and autosave every second with conflict detection.

AI-written copy, checked before it is used

An AI step writes every text field of every block, code checks each field, and only the fields that fail are asked again. Copy is handled as data with rules, not as free text. For the photos, a vision model picks the usable product images and a local model removes backgrounds in a separate process.

How AI-written copy is checked A plan lists every field with its limits. The AI model writes all copy. Code checks each field. Fields that fail are asked again with the rejected answer and the reason, and the new answer is checked again; it is kept only if it is better. When every field passes, the page is saved in one transaction. Planevery field + limits AI modelwrites all copy Code checkseach field Savedin one transaction Re-ask only the failing fieldskeep an answer only if better fails with the reason passes

Illustration. Simplified flow of the copy step.

  1. A plan lists every field of every block with its length limit, required placeholders such as the price, and a short note on what the field is for.
  2. Each field is checked in code: length, number of items, required placeholders and language.
  3. Only failing fields are asked again, with the rejected answer and the reason, for a limited number of rounds. A new answer replaces the old one only if it is better; a field that still has an error stops the job instead of reaching the page.
  4. Single blocks can be filled or rewritten on demand, up to 10 blocks per request within 120 seconds.
  5. Several model providers are supported, and the default model is picked by measured cost. Two measured runs for a full page: $0.03–0.05 in model cost and 66–100 s.

Interactive game blocks

The library includes interactive game blocks for engagement: short, playful steps that keep the visitor moving through the page. Six game variants share one game kit, so a new game adds only its own look and logic.

  1. Games and the guided product quiz are action blocks: they lead the visitor forward, and the blocks that depend on them appear only after they are completed.
  2. Answers and choices carry over to later blocks during the visit, kept in the browser's session storage rather than on a server.
  3. Each action block has its own driver, so the automatic run in a real browser plays it to the end the way a visitor would.

Themed design sets

Design sets for different occasions and seasons: 56 page designs in total, one core design plus five designs for each of 11 occasions. Each themed design has its own page structure and AI-generated hero artwork, and any page can be restyled without touching its blocks.

  1. A style panel sets colours, corner radii and text size, and can take the logo and colours from a saved store preset.
  2. Readability is enforced: label colours follow a contrast rule, and a theme cannot put text on a background where it would be hard to read.
  3. Four open-licence font families ship with the page, subset to the scripts it uses, so no font service is needed.
  4. Designs are versioned and frozen by a content hash. A page can be updated from a newer version of its design, with the difference applied as one undo step; saving a page as a template requires the pre-flight checks and an automatic browser run through the page.

Automated quality gate

A variant enters the library only after a real browser has rendered it at 390 × 844 px in 9 render scenarios: three languages (English, long German at the field maximum, long Arabic right to left) in three colour palettes. All 244 variants pass.

The 9 render scenarios behind a quality stamp A grid of three languages (English, long German, Arabic right to left) by three colour palettes. Every cell is rendered at 390 by 844 pixels and checked for overflow, contrast and tap size. When all nine pass, the variant gets a stamp with the hash of its files, the engine and the browser version, and enters the library: 244 of 244 variants. Palette 1 Palette 2 Palette 3 English German, long Arabic, RTL ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ Stampfiles · engine · browser Library244 of 244 Each cell: 390 × 844 px · no overflow · contrast ≥ 4.5:1 · tap size

Illustration. The 9 render scenarios behind each variant's quality stamp.

  1. Checks in every scenario: no horizontal overflow, text contrast of at least 4.5:1 and controls large enough to tap.
  2. Action blocks such as games, quizzes and forms are played to the end in the browser.
  3. A passing variant gets a stamp with the hash of its files, the hash of the rendering engine and the browser version. Changing the engine marks every stamp stale, and a fast test fails until all variants are checked again.
  4. Beyond single blocks: an automatic run through whole exported pages, browser tests of the editor at 1440 and 390 px, and a linter that enforces the interface's design rules.

Static export with a pre-flight check

Before a package is built, a pre-flight runs 10 groups of checks. The result is a static page: every image, font and script ships inside the package; an external asset URL stops the export. The builder never receives contact details or visitor data: the exported page is hosted elsewhere.

10groups of checks before every export
~200–300 KBper page without images, about 65 KB compressed
49 KBpage script in plain JavaScript, under a 64 KiB ceiling
  1. Checks cover the composition rules, texts, block data, leftover template markers, placeholders, language and text direction, and font licences.
  2. A refusal lists every reason at once, each with a link to the place to fix it. Over-long text and pages above 500 KB raise warnings.
  3. The live preview runs in a sandboxed frame: it never sends a form and never ends up in the package.
  4. Images are re-encoded to WebP, capped at 2,400 px and stored once by content hash.
04

Reliability and guardrails

  1. Generation runs as a queue: one job per country, concurrency limits, automatic retries after 20, 60 and 120 seconds on rate limits, server and network errors, and recovery after a restart.
  2. Writes are idempotent: a job saves the page and its own link to it in one transaction, so a retry after a restart returns the same page instead of a second one.
  3. Edits are conflict-safe: autosave checks the revision, actions on a group of pages hold a lock, and regenerating copy writes only if the page has not changed in the meantime.
  4. The database release was rehearsed on a copy: idempotent SQL replayed in tests, a rollback that refuses once new data exists, a 5-second lock timeout proven against an open transaction, a 156 MB backup in 6 s and a restore in 3 s, equal row counts in all 31 tables, and byte-identical exports for 14 existing pages.
  5. About 3,700 test cases in 250 files; database tests run in temporary schemas and never touch working data.
  6. Model API keys stay on the server, and the interface only shows whether a key is set.
05

Results

Most of the commits landed in 17 days: 803 of the 819 between 24 September and 10 October 2026, on 12 active days. Automated tests grew from 63 at the audit before the rebuild to about 3,700. The work followed written specs and plans, with one implementer and one review per task and an "As built" note when the task was done.

06

What's next

  1. Block-level analytics: attention, taps and scroll depth for each block, so a layout can be judged by how visitors use it. The design is written; work has not started.
  2. More block-based designs, modelled on the remaining older templates.
  3. A/B tests of two exported versions of a page, with traffic split evenly, following the written test guide.

← Back to all work