Overview
NorskHandverk is a full-stack e-commerce platform for Norwegian handcrafted products. Customers can browse products, build a cart and pay securely with Stripe.
The challenge
Payments must never be charged twice, even if a customer double-clicks, refreshes the page or the network fails in the middle of checkout. The order in the database also has to stay in sync with what actually happened in Stripe.
How I solved it
- Idempotent checkout, so repeating the same checkout request never creates a second payment.
- Stripe webhooks confirm payments on the server side, instead of trusting the browser.
- Dynamic cart in the Next.js frontend.
- Relational data model in PostgreSQL for products, orders and order lines.
Tech
- Backend: .NET 9 Web API
- Frontend: Next.js 16
- Database: PostgreSQL
- Payments: Stripe