Lesson 3 of 3 · Project case study

Building the Arcade

Eight weeks building a real storefront: belt-tier subscriptions, Stripe checkout, and a Sensei that streams hints from Claude. Each topic below links to the code that does it.

By the numbers

Measured in week 8. The store README lists the command behind each one.

40

store unit tests (Vitest)

6

Playwright e2e tests, with axe scans

0

WCAG 2.2 A/AA violations in CI

100

Lighthouse Accessibility, live mobile

What's in it

Four parts of the build worth a closer look, with links to the files.

Server components on React 19 and Next 16

The pricing page is an async server component: it fetches offers on the server and sends finished HTML. The entitlements panel is its own async server component with a loading skeleton, so a slow API never blocks the offers. Checkout is a server action, so the Stripe secret key never reaches the browser.

Typed data from Contentful

Offers (names, prices, perks, badges) live in Contentful, not in code. One Offer type describes them, and the fetch maps Contentful's response into that type at the edge of the app, so components never see raw CMS data. The page rebuilds every 60 seconds (ISR), so a price change goes live without a deploy.

Testing and accessibility

Four layers, each catching what the others miss. Vitest and React Testing Library query by role, so a lost heading fails a test. Storybook runs axe on every component state. Playwright runs the checkout flow and axe on real pages in CI. Then a keyboard pass and a VoiceOver pass, which found three problems the tools passed.

The streaming UI

The Sensei streams a hint from Claude as it's written. The browser calls a store route handler, which adds the API token and passes the stream through from FastAPI unchanged. One abort signal runs through every hop, so Stop really stops the request to Claude instead of just hiding the text.

Go deeper

The live store, the project docs, and the primary source for the trickiest idea here.

Training Notes

What building this project taught me.

Hard: Stop used two hints

Ask and Stop were rendered in the same spot with a ternary, so React reused one button element. A click on Stop landed as a second Ask. Giving each its own key fixed it. Lesson: when two controls swap in place, React needs to know they're different elements.

Hard: the tools passed what a screen reader caught

axe found nothing, but VoiceOver read the "Most popular" badge before the belt name, read prices as "slash month," and the focus ring was hard to see on the dark background. Automated checks are a floor, not proof.

Differently: write the test with the component

Tested components and libs sit at 87 to 100%, but overall line coverage is 64% because pages and server glue lean on e2e. Next time, a small test lands in the same PR as each component, not in a catch-up week.

Differently: announce results, not just loading

The entitlements panel tells screen readers it's loading, but not when it finishes or fails (WCAG 4.1.3). It's listed as a known gap. A status region designed in from the start would have covered all three states.