Rizzé Co.

Live / Paid client work · Sep–Oct 2026

At a glance

Playwright E2E tests passing
0
Playwright E2E tests passing
catalogue revalidation window
0s
catalogue revalidation window
payment security via hosted Shopify checkout
0%
payment security via hosted Shopify checkout

Open with

Try it live

On repeat

Softcore

The Neighbourhood

0:00--:--

Chat about Rizzé Co.

Yash ›

psst, I answer from my notes on Rizzé Co., so ask me about the hard bits.

Today

Rizzé Co.

A custom headless storefront for a coastal activewear brand, built on Next.js 16 and Shopify.

  • Next.js
  • React
  • TypeScript
  • Tailwind CSS
  • Shopify Storefront API
  • Playwright
Try it live

28

Playwright E2E tests passing

60s

catalogue revalidation window

100%

payment security via hosted Shopify checkout

“
Default Shopify themes feel like cookie-cutter templates. The client needed granular brand aesthetics and sub-second transitions, without losing hosted checkout.
why I built it

01How it flows

  1. 1Browse catalogue & reelsNext.js Server Components + private Storefront API
  2. 2LocalStorage cart & drawerfast client state, validated on every action
  3. 3Re-validate stock & variantsServer Action clamps quantities against real stock
  4. 4Secure checkout redirectcreates Shopify checkout URL, zero payment data touched

02The fun part3 problems

Keeping the cart honest without trusting localStorage

1/3

Anyone can tamper with browser localStorage to inflate quantities or insert fake variant IDs. The checkout server action re-fetches the live catalogue, clamps quantities to min(10, stock), and silently drops non-existent variants.

app/actions/checkout.ts

Fallback catalogue resilience

2/3

If Shopify hiccups or in CI where credentials do not exist, the data layer silently falls back to a committed JSON snapshot so the site never throws a 500 error.

lib/shopify/catalog.ts

Security headers on a static-ish storefront

3/3

Locked down CSP with frame-ancestors none, images scoped only to the Shopify CDN, origin checks, and a 16 KB body limit on server actions.

next.config.ts
app/actions/checkout.tsts
1// Tests/product-cart.spec.ts — tampered storage is silently corrected
2lines.push({ variantId: "gid://shopify/ProductVariant/999", handle: "fake", quantity: 500 });
3lines[0].quantity = 500;
4// After reload, the cart still shows 1 item, quantity capped at ≤ 10.

03What broke

  • In-process memory rate limiter counts per serverless instance on Vercel; high traffic across multiple instances could allow extra attempts.
  • Email signup form has full backend validation and honeypots wired up, but awaits client decision on email provider (e.g. Klaviyo).

The leftovers

Built over two months, September to October 2026.

The funny part: watching automated Playwright tests attempt to hack the cart with 500 pairs of socks and invalid Shopify IDs, only for the server action to silently clamp the order to real inventory numbers.

04Things people ask

What's the stack?

Next.js 16 (App Router), React 19, TypeScript, Tailwind CSS 4, Shopify Storefront API, Playwright for end-to-end tests, deployed on Vercel.

Why not just use Shopify's built-in storefront?

Default Shopify themes restrict custom interactions, animations, and transitions. Going headless allowed us to craft a high-performance, tailored brand experience with zero layout compromises while retaining Shopify's secure checkout and backend inventory management.

How does checkout work?

The cart lives in the browser, but at checkout time a server action re-fetches every item from Shopify's live catalogue, caps quantities against real stock, then creates a Shopify cart server-side and redirects the shopper to Shopify's hosted checkout page. Prices always come from Shopify. The browser never sends a price.

What happens if Shopify goes down?

The site switches to a committed JSON snapshot of the catalogue automatically. Shoppers can browse but can't check out. There's a Playwright test specifically for that path.

How are hero banners and announcements managed?

The store owner edits them in Shopify's Metaobjects editor — no CMS, no code, no redeploy. The Next.js app reads them from the Storefront API with a 60-second cache, so changes are live in about a minute.

Can the cart be tampered with?

The browser cart is just a list of variant IDs and quantities. On checkout, the server ignores any fake variant ID, any unavailable item, and silently clamps quantities to min(10, actualStock). There's a Playwright test that stuffs fake entries into localStorage and verifies they're dropped.

What was the trickiest security thing?

Probably getting the Content Security Policy right without forcing every page to render on demand. unsafe-inline is needed for Next.js's bootstrap script, which is a known trade-off — the alternative (nonces) would have made every page dynamic and killed the cache. Everything else in the CSP is locked down: no third-party scripts, no framing, images only from the Shopify CDN.

Is it accessible?

There was a dedicated accessibility pass in the git history. The Playwright tests check ARIA roles and labels throughout (cart drawer, product photo gallery counter, FAQ accordion states, etc.).

What about SEO?

The site generates a sitemap, robots.txt (which discloses /cart), Open Graph images, and proper canonical URLs. X-Powered-By is removed so the framework isn't advertised.

Can I try it?

Yes — it's live at rizze-plum.vercel.app.

What's not built yet?

Customer accounts, order history, and actually saving email signups to a service like Klaviyo. The architecture is ready for all three; they just need the client to make a decision on the email provider and whether to enable Shopify customer accounts.

Why Vercel specifically?

It's a near-zero-config deployment for Next.js — push to main, it ships. Privacy-friendly page-view analytics (Vercel Web Analytics) turn on automatically. The only real gotcha is that Vercel's free Hobby plan is for non-commercial use, so a live store needs the Pro plan.

The whole write-up4 min read, for the curious

The itch

Shopify's default Liquid themes feel like generic, cookie-cutter templates with clunky page reloads, limited layout control, and third-party app bloat that ruins page speed. Rizzé, a coastal activewear brand, needed an elevated editorial feel: a full-screen hero carousel, smooth slide-out drawers, embedded reels, and instantaneous transitions that match a luxury aesthetic. I took on the project to build a custom headless storefront on Next.js 16 and React 19, pairing custom frontend craftsmanship with Shopify's battle-tested back-office, inventory, and hosted checkout.

What it does

A shopper lands on a full-screen hero carousel, scrolls through featured products and Instagram reels, and can browse by collection or search. Product pages show a photo gallery with colour/size variants, a live stock count ("Only 3 left" appears at ≤ 3), and an add-to-cart button. The cart lives in a slide-out drawer. At checkout, the server validates every line against Shopify's live catalogue and redirects the shopper to Shopify's hosted checkout — so Rizzé never touches payment data. The owner manages hero banners and rotating announcements from inside Shopify itself, no code required.

How it works

The site is a Next.js App Router project deployed on Vercel. All product data comes from Shopify's Storefront GraphQL API through a private (server-only) token — it never touches the browser.

Catalogue data is cached with Next.js's fetch cache and revalidated every 60 seconds, so pages are fast but product info stays fresh. If Shopify can't be reached at all — or in CI where credentials don't exist — the site falls back to a committed JSON snapshot so it never goes down.

The owner can update hero banners and announcement bars directly in Shopify's Metaobjects editor. The site reads those via the same Storefront API call, so changes go live in about a minute without a redeploy.

The fun part

Keeping the cart honest without trusting localStorage. The cart is stored in the browser, which means anyone can tamper with it. I found out quickly that just reading quantities from localStorage and sending them to checkout was not going to fly — someone could inflate quantities or submit fake variant IDs. The solution: the startCheckout server action fetches the full catalogue fresh from Shopify, rebuilds the cart from that, caps each line at min(10, stock), and ignores any variant that isn't actually for sale. The browser's cart is just a list of variant IDs. One of the tests proves it:

// Tests/product-cart.spec.ts — tampered storage is silently corrected
lines.push({ variantId: "gid://shopify/ProductVariant/999", handle: "fake", quantity: 500 });
lines[0].quantity = 500;
// After reload, the cart still shows 1 item, quantity capped at ≤ 10.

The fallback catalogue. Shopify has 99.9% uptime but not 100%. Rather than letting the site throw a 500 if the API hiccups, I wrote a sync-products script that commits a snapshot of the catalogue to the repo. If fetchCatalog() throws, the data layer silently returns that snapshot. Checkout is unavailable in snapshot mode (correctly, since we can't verify stock), and there's an explicit test for that path too.

Security headers on a static-ish site. The CSP had to allow unsafe-inline for Next.js's bootstrap scripts — nonces would have forced every page to be dynamic, killing the static cache. Instead I locked everything else down hard: no third-party scripts, no framing (frame-ancestors 'none'), images only from the Shopify CDN, connections only to 'self'. Server actions get their own layer: origin check, per-IP rate limiting, and a 16 KB body cap. The checkout action also validates the Shopify checkout URL is https: before redirecting — it sounds paranoid but it's a one-liner and rules out a class of redirect attacks.

What broke / what I'd change

The rate limiter is in-process memory, which means each serverless instance keeps its own counter. On Vercel with multiple instances running, a determined person could hit the limit on each instance separately and get more attempts than intended. The README calls this out explicitly — the fix is Upstash Redis or Vercel's firewall rules, but that's outside the current scope.

The email signup form is fully wired up server-side (origin check, honeypot, rate limit, validation) but nothing is actually stored yet — the client needs to pick an email service (Klaviyo was mentioned) before that last step connects.

Numbers

  • 28 Playwright tests across 5 spec files, run on desktop Chrome and Pixel 7 in CI
  • 2 browser profiles per test run (desktop + mobile)
  • 60-second catalogue revalidation window (Shopify → Next.js cache)
  • 5 attempts / 10 minutes rate limit on email signup; 10 attempts / minute on checkout
  • 4 reels in the current Instagram section
  • 16 KB maximum Server Action body size

Leftovers

Built over two months, September to October 2026.

The funny part: watching automated Playwright tests attempt to hack the cart with 500 pairs of socks and invalid Shopify IDs, only for the server action to silently clamp the order to real inventory numbers.