Bender
Describe an app and get a complete, themed set of real mobile screens on an infinite canvas. Edit them through chat, re-theme, critique and export clean code.
- Next.js
- AI SDK
- Inngest
- Clerk
- Prisma
- Polar
82
unit checks passing
35
hand-made OKLCH themes
122
commits to production
I kept spending 10 to 15 unpaid hours wiring clickable Figma mockups just so a client could "see the vision".
why I built it01How it flows
- 1Lock a design contracttype scale, OKLCH tokens, nav
- 2Generate the screensscreen 0 first, the rest in parallel
- 3Wire them into a prototypeclickable navigation graph
- 4Send in test personasdead taps get logged
- 5Fix and re-testwire · generate · edit
02The fun part3 problems
The electric-violet dot grid
1/3A regex read oklch(0.26 0.02 250) as RGB and painted the whole canvas violet. Now a 1×1 canvas lets the browser convert the colour itself.
canvas-dot-grid.tsxDon't charge people for "hi"
2/3Greetings and maths get caught by regex before any model or credit is touched. A circuit breaker fails open for paying users and closed for public comments.
lib/intent.tsThe friction moat guard
3/3The judge sometimes invented screen IDs. A deterministic validator drops them and downgrades impossible fixes before anything hits the database.
lib/validate-friction.ts1function resolveToken(probe: HTMLElement, token: string, fallback: RGB): RGB {2probe.style.color = `var(${token}, rgb(1, 2, 3))`;3const computed = getComputedStyle(probe).color;4if (!computed || computed === "rgb(1, 2, 3)") return fallback;56const ctx = getSwatchCtx();7if (!ctx) return fallback;89ctx.fillStyle = "#000000";10ctx.fillStyle = computed;11const fromBlack = ctx.fillStyle;12ctx.fillStyle = "#ffffff";13ctx.fillStyle = computed;14if (ctx.fillStyle !== fromBlack) return fallback;1516ctx.clearRect(0, 0, 1, 1);17ctx.fillRect(0, 0, 1, 1);18const [r, g, b, a] = ctx.getImageData(0, 0, 1, 1).data;19return a === 0 ? fallback : [r, g, b];20}
03What broke
- The test agent reads text only, so it can't see a button hidden below the fold.
- Screens load the Tailwind Play CDN, which slows down screenshots and exports.
- Pitching weekend freelancers at $19 a month was the wrong market.
The leftovers
About eight months, January to the end of August 2026.
The funny part: I was completely sure this would turn into a SaaS. It became a side project.
04Things people ask
What's the core stack?
Next.js 16 (App Router), React 19, TypeScript, Tailwind CSS, MongoDB with Prisma, and Inngest for background orchestration. Authentication is handled by Clerk and payments run on Polar.
Why not just use Figma or v0?
Figma produces static, vector-based pictures that require hours of manual wiring and don't reflect real DOM behavior. Code generators like v0 or Lovable build screens, but they don't test flows or detect navigation friction. Bender generates a connected set of screens, wires them up, and walks agents through them to find where the UX breaks.
How does the synthetic testing walk work?
Bender extracts all interactive tap targets from each screen into a navigation graph. An agent roleplaying a persona tries to accomplish a task (e.g., "Find your invoice history") step-by-step. If it taps an element with no wired target, that's recorded as a dead tap; after consecutive failures, the persona gives up, and the judge synthesizes a concrete repair plan.
Why do you call it triage instead of validation?
Because language models cannot feel human emotion or truly validate product-market fit. Claiming an LLM "validates" UX is deceptive. Bender uses deterministic triage: finding broken links, dead taps, missing screens, and layout blockers that a machine can objectively prove.
How do you prevent the designs from looking like generic AI templates?
The generation prompt explicitly bans category clichés—like dark fintech with neon green numbers or purple glassmorphism gradients. Every generation is forced to choose one of 7 hero archetypes (no two screens in a set can share one) and one of 7 navigation layouts with an architectural rationale.
Can I export the screens?
Yes. You can export complete project ZIPs with clean HTML and Tailwind markup, capture high-resolution device frame screenshots via headless Chromium, or copy tailored prompts into Cursor or Figma.
Why did you use Inngest instead of standard API routes?
Generating four cohesive screens and running multi-persona test walks takes between 30 and 90 seconds and requires multiple model steps. Inngest handles step-level retries, backoff, and state persistence so serverless functions never hit 15-second execution limits.
What was the most frustrating bug in the project?
Tracking down why the canvas dot grid turned neon violet. It looked like an obvious CSS bug, but it was actually caused by regex number parsing failing on modern oklch() color strings returned by getComputedStyle.
How does the re-test loop work?
When you apply a generated repair (like wiring a button or rebuilding a screen), Bender lets you run a re-test against the prior run. It tracks friction signatures (frameId|title) to see if the issue is marked resolved or remains recurring, storing the results in a dedicated FrictionFix collection.
Can I try it?
Yes, it's live at benderai.app.
The whole write-up6 min read, for the curious
The itch
I built Bender because of a specific frustration in product design: spending 10 to 15 unpaid hours over a weekend hand-wiring clickable mobile mockups in Figma just so a prospective client can "see the vision" on spec. Most AI generators spit out isolated, static web screens that look like generic templates—heavy on glowing purple gradients, floating glass tab bars, and fake filler text. I wanted something that designs a coherent, themed set of interconnected mobile screens, makes them clickable, and then walks autonomous agents through the flow to spot broken taps and dead ends before a client or user ever sees them.
What it does
You give Bender a natural language description of an app concept (or pick a curated starter template), and it takes you through a complete design-and-triage loop:
- It locks a dedicated design contract (type scale, OKLCH color tokens, navigation layout, and screen archetypes).
- It generates a multi-screen mobile flow rendered in interactive device frames on an infinite canvas.
- It wires interactive buttons and icons into a clickable navigation graph so you can click through the prototype.
- It dispatches simulated user personas to attempt realistic goals across the screens, logging dead taps and abandoned flows.
- It outputs a triage report where every friction point has an executable repair action (
wire,generate,regenerate,edit), letting you fix issues and re-run tests to verify they resolved.
How it works
Bender runs on Next.js 16 (App Router) and React 19, backed by MongoDB through Prisma.
The front end is an infinite pan/zoom canvas hosting mobile frames. Instead of static images or flat SVG mockups, each screen is an isolated iframe rendering real HTML and Tailwind utilities. Live theme tokens are injected as CSS custom properties into a dedicated <style id="theme-vars"> element, allowing instant, flicker-free re-theming without reloading the frame or losing scroll position.
Long-running generative and testing pipelines run asynchronously via Inngest background workers to avoid serverless request timeouts. When you prompt Bender, the API route validates intent, deducts credits atomically, creates a queued record, and triggers Inngest. Progress events stream back to the browser over Server-Sent Events (SSE).
To prevent screens from drifting into clashing styles without serializing the whole 90-second process, Screen 0 is generated first alone to establish the visual baseline. Its HTML is then injected as reference context into the prompts for Screens 1 through N, which generate concurrently in parallel.
The fun part
1. The electric-violet canvas dot grid (The OKLCH token trap)
My interactive canvas has a background dot grid that pulses subtly under the cursor. The dots needed to match the active theme's --ink and --primary tokens. Because all my theme presets are authored in modern OKLCH (e.g. oklch(0.26 0.02 250)), calling getComputedStyle(el).color returns that exact string.
My first implementation used a simple regex parsing three numbers (match(/[\d.]+/g)). It read 0.26 as Red, 0.02 as Green, and 250 as Blue—instantly painting the entire canvas in blinding electric violet.
Regex cannot parse modern CSS color spaces into sRGB. The fix was writing resolveToken() in canvas-dot-grid.tsx: I create a 1x1 scratch canvas context on startup and let the browser's native CSS Color 4 engine parse the color. I also had to guard against two edge cases: browsers that parse oklch() in CSS but fail silently on ctx.fillStyle (probed via two sentinel colors), and inherited CSS properties resolving to ancestor colors when a token is missing.
function resolveToken(probe: HTMLElement, token: string, fallback: RGB): RGB {
probe.style.color = `var(${token}, rgb(1, 2, 3))`;
const computed = getComputedStyle(probe).color;
if (!computed || computed === "rgb(1, 2, 3)") return fallback;
const ctx = getSwatchCtx();
if (!ctx) return fallback;
ctx.fillStyle = "#000000";
ctx.fillStyle = computed;
const fromBlack = ctx.fillStyle;
ctx.fillStyle = "#ffffff";
ctx.fillStyle = computed;
if (ctx.fillStyle !== fromBlack) return fallback;
ctx.clearRect(0, 0, 1, 1);
ctx.fillRect(0, 0, 1, 1);
const [r, g, b, a] = ctx.getImageData(0, 0, 1, 1).data;
return a === 0 ? fallback : [r, g, b];
}
2. Pre-charge intent routing & the asymmetric circuit breaker
In early versions, typing "hi" or "what is 2+2" charged the user an AI credit, invoked the full design planner, and generated a bizarre 4-screen mobile app. At the same time, relying entirely on an LLM for content moderation created an exploit: an attacker could flood the unauthenticated public prototype comments endpoint, burn through my Gemini Flash quota, and disable moderation across the entire app.
I solved this in lib/intent.ts and lib/moderation.ts with a three-layer filter:
- Layer 0 (Deterministic Small Talk): Regex patterns catch greetings, acknowledgments, basic math, and noise with zero API calls and zero credit deduction.
- Layer 1 (Normalized Denylist): Folds leetspeak, accents, and punctuation to catch slurs deterministically before any model is touched.
- Layer 2 (Asymmetric Circuit Breaker): If the safety classifier fails 5 times consecutively, the breaker trips. Authenticated paying users fail open so an upstream provider outage never blocks work mid-session. Unauthenticated public comment routes fail closed so attackers cannot use provider outages to post unmoderated spam.
3. The friction moat guard
In the synthetic walk, the LLM "Judge" would occasionally hallucinate nonexistent frame IDs or suggest a wire repair for a dead tap pointing to a target screen that didn't exist. If stored blindly, these hallucinations would corrupt the database and crash future re-tests.
I built lib/validate-friction.ts as a pure, deterministic validation barrier before any row touches MongoDB:
- If a friction point is attached to an unknown screen ID, it is dropped immediately.
- If a
wirerepair points to a screen that does not exist, the repair verb is automatically downgraded togenerate(instructing the model to build the missing screen first). - Every valid fix is indexed by a durable signature (
frameId|normalized-title) so re-tests can calculate whether the issue actually resolved or remained recurring.
What broke / what I'd change
- The text-only simulated walk was a compromise: In
lib/user-test-agent.ts, the agent navigates by reading HTML stripped down to 1,500 characters of plain text and an element list. The agent is visually blind. It cannot see if a button is positioned below the mobile viewport fold, obscured by an overlay, or styled with unreadable low contrast. I'd replace the text stripper with a real headless browser session (using the Puppeteer/Chromium engine already in/api/screenshots) feeding the agent real DOM bounding boxes and accessibility trees. - The Tailwind Play CDN dependency: Screen iframes currently pull from
https://cdn.tailwindcss.com. This is an in-browser development compiler. It forces headless screenshot captures to wait for client-side compile steps and makes direct production code export harder than pre-compiling clean CSS bundles. - The spec-pitch freelancer ICP was the wrong wedge: Targeting weekend freelancers pitching on spec at $19/mo was a commercial mistake. Freelancers have high churn and tiny budgets. The real, high-value problem is B2B: product teams, design engineers, and agencies who spend thousands of dollars on Design QA and need automated flow verification before shipping.
Numbers
- 122 git commits from inception to production.
- 31 app pages and 35 backend API route handlers.
- 11 Prisma MongoDB collections.
- 35 hand-crafted OKLCH theme presets and 11 benchmark starter templates.
- 82 automated unit test checks passing across three test suites (
validate-friction.test.ts,generate-with-fallback.test.ts,intent.test.ts). - 4 machine-applicable repair actions tracked across re-tests (
wire,generate,regenerate,edit). - 7 hero archetypes and 7 navigation layouts enforced by schema to eliminate cookie-cutter mobile screens.
Leftovers
About eight months, January to the end of August 2026.
The funny part: I was completely sure this would turn into a SaaS. It became a side project.
