All ideasMore in Work

Build a SaaS in a weekend with AI — and catch the payment bug it approved itself

Ryan Mercer spent a weekend building a SaaS with AI and Next.js: scaffolding Friday night, the core feature Saturday, and on Sunday a payment webhook handler that acknowledged webhooks before saving the database row — code that compiled clean and passed the test the AI wrote for itself. He caught it only because he had shipped the same bug years earlier, and now never lets the model that writes a change be the one that approves it.

This only partly worked. Read what happened before you try it.

How it works

  1. Friday night: scaffold the app (Next.js App Router, Tailwind, Postgres, auth, schema) in a couple of hours with AI writing and him steering
  2. Saturday: build the core feature in slices, his time mostly spent reading plausible code
  3. Sunday: The AI writes a payment webhook handler that acknowledges the webhook before persisting the row, and its own test passes it
  4. He spots the ordering bug from personal experience
  5. Fix is reordering two lines: persist before acknowledging
  6. His standing rule becomes separate author and skeptic passes, with him owning the merge

Why it’s worth knowing

The dangerous bug was two lines in the wrong order, and the model's own test suite blessed it — only the human's scar tissue caught it.

Where it’s from

Summarized from a public post on medium.com. See the original ↗

Upgraded prompt

A ready-to-use prompt for this idea, built from research on what makes AI agents do the job right: who the AI should be, the exact steps, and a check to make sure it was done the way you wanted.

1Who the AI should be
2The prompt, with the steps
3The check when it’s done
Upgraded prompts are coming soon.

Try next

Every idea is a real post from someone who tried it, summarized in our words, with a link to the original. App names are swapped for plain words.