Vincent Angoulvant
Menu
Shop home page: “Free delivery from €50” banner, the headline “Des objets choisis, livrés chez vous.” (Hand-picked items, delivered to your door), a “Voir le catalogue” (See the catalog) button and the start of the popular products section

Problem

A small shop, a craftsperson or an independent brand wants to sell online without depending on a marketplace or a heavy CMS. The need comes down to a few points: present a catalog, take payments securely, never sell an out-of-stock product, and confirm every order to the customer by email.

I built this demo shop to show that journey end to end, as it would work for a real merchant. Customers can buy with or without an account. The shop itself is in French.

Technical choices

  • Next.js and React: pages are rendered on the server, so they are fast and well indexed. Interactive parts (cart, forms) are isolated in small components.
  • Stripe Checkout and webhooks: payment happens on Stripe’s secure page, and card details never pass through the website. Prices are recalculated on the server from the database: a customer cannot change an amount from their browser. The order is only created when Stripe’s signed confirmation (webhook) is received, never on the return page alone.
  • Stock and orders: PostgreSQL (hosted on Supabase), accessed through Prisma. Each order is saved in a transaction that checks the stock again before decrementing it: the last item can never be sold twice. If Stripe sends the same confirmation twice, the order is not duplicated.
  • Customer accounts: Supabase authentication, with email address confirmation, order history and password change. Buying without an account remains possible.
  • Emails: the order confirmation is sent through Resend, from an authenticated custom domain (DKIM, SPF, DMARC).

Challenge

Guest checkout raised a real security question. A customer who orders as a guest, then creates an account with the same address, should find that order in their history. But if orders were linked at sign-up, anyone could register with someone else’s address and see their orders, including their name and shipping address.

So I put this logic directly in the database, with PostgreSQL triggers: a guest order is only linked to an account once its owner confirms their email address by clicking the link they received. As long as the address isn’t proven, nothing is linked. This rule applies whatever the sign-up path, even if the application code changes later.

Result

The shop is live on a custom domain, hosted on Vercel, with Stripe in test mode: you can go through the whole purchase with the test card 4242 4242 4242 4242. It includes the catalog, a persistent cart, payment with shipping address and promo codes, ordering with or without an account, order history and the confirmation email.

The code passes strict TypeScript checks and linting with no errors. A script simulates a signed Stripe payment confirmation, to test order creation locally. Next steps: an admin area to track orders, along with automated tests and continuous integration.