Meowtin
← Back to Portfolio

Ecommerce

Short Fuse Merch Store

Short Fuse30 products · 110 tests
Next.jsTypeScriptPostgreSQLDrizzleStripeZodVitestVercel
Visit Site →
A custom merch store for Short Fuse, replacing the band's Big Cartel shop. (The band's official site is a separate codebase that shares this one's design system.)

Hosted platforms charge a monthly subscription plus a cut of every sale, and on the volumes an independent band actually moves that is a meaningful share of what a shirt earns — for a 30-product catalog that uses almost none of what the subscription buys.

Built as a pnpm workspace: a Next.js storefront and admin, Drizzle over Postgres, and a framework-free core package holding every calculation that decides what a customer is charged. The route handlers are thin wrappers over it, and it is unit-tested on its own. 110 tests, ~13,000 lines of TypeScript, 11 tables.

The browser never sends a price. It sends product ids, sizes, quantities and a country; /api/cart and /api/checkout both reload every product from the database and recompute the total through the same function, and the Stripe line items are built from that result. A tampered cart in localStorage changes what the customer sees and never what they are charged — there is a test for exactly that.

Shipping had to be quoted before payment. Stripe Checkout collects the address after the session is created, so it cannot pick a destination-based rate for you. The review step asks for the country first, quotes the flat rate from it, and locks the session to that one country — otherwise a customer is quoted the US rate and ships to Australia.

An order only becomes paid from a signature-verified webhook. Reaching the success page proves nothing — the customer could navigate there directly. Every Stripe event id is inserted under a unique index before the event is handled, so a redelivery is a no-op, verified with a concurrency test; orders whose webhook never arrived are reconciled against the Stripe API rather than left pending forever. Line items snapshot the product name, size and price at purchase, so a later price change cannot rewrite an old receipt.

Behind it, an admin the band runs themselves: products and per-size availability, categories, cart offers with four fixed trigger types, order status, and store settings. The Big Cartel importer is idempotent and refuses to clobber fields the admin has since edited.

Two things are deliberately not done. Tax is off — the band is not registered to collect anywhere; orders still carry a tax field and the webhook records whatever Stripe reports, so turning on Stripe Tax later is a config change rather than a migration. And per-size stock could not be recovered from Big Cartel, whose export marks every option as available including on products the store itself shows as sold out — so size availability is derived from the product, and low stock is set by hand.

Screenshots

Short Fuse Shop — screenshot 1
Short Fuse Shop — screenshot 2
Short Fuse Shop — screenshot 3
Short Fuse Shop — screenshot 4
Short Fuse Shop — screenshot 5
← All Projects