The brief
A subscription for physical mail is harder than it looks. One grandparent buys for three grandchildren at three addresses. A gift has to start on a birthday months away. A family moves in the middle of the year. Every two weeks the right letter has to reach the right child, and the business is run by its founders, often one person at a kitchen table.
They had the letters. They needed the software, end to end.
What I built
Engineering
Payments that can't drift
Every Stripe webhook is verified, processed exactly once, and checked against Stripe's own record before the app trusts it. Races between finishing checkout and Stripe's events are handled, so a paid order is never lost, even if the buyer closes the tab at the wrong moment.
Email that always sends
Emails are queued in the same database transaction that saves the order, sent after it commits, and retried by a daily job. Sending runs on AWS SES with no stored keys: Vercel's OIDC identity assumes an AWS role.
Addresses checked against USPS data
Google Address Validation catches a typo at checkout, not three weeks later when the letter comes back. If the check is down, checkout still works, and a daily quota cap keeps the cost fixed.
One clock for the whole business
"Is this letter due today?" is always answered in US Eastern time, and tests can set the date, so the 1st-and-15th schedule and future gift dates are proven by tests, not hoped for.
Safe to change
About 370 tests run against a real PostgreSQL database in CI, plus browser tests of full checkout journeys. A deploy applies its own database migrations, written expand-then-contract so the live site never breaks mid-release.
Accountable and private
Every change to a subscription records who made it, in the same transaction. When a customer asks to be forgotten, one command removes them everywhere, including every Stripe customer their sign-ups created.
Outcome
Store, portal and back office went from first commit to live at lettersaboutgod.com in four weeks: one engineer, 195 commits and 13 database migrations.