CS-16 — Backend & integrations · Architecture & performance
Argizari Kandelak — online shop for handmade candles
Trilingual online shop (Basque, Spanish, English) and admin panel for an independent handmade candle brand: catalogue, basket, binding orders, unit-level inventory, shipping and email notifications with a transactional outbox.
- My role
- Personal project; full design and implementation.
- Period
- 2026
- Disclosure
- Public project
- Technologies
- TypeScriptNext.jsReactTailwind CSSPostgreSQLDrizzle ORMNeonBetter Authnext-intlResendCloudflare R2VercelVitestPlaywright
- Last reviewed
- 13 November 2026
Context
A small handmade candle brand needed to sell online and manage its production: many candles are made to order, payment happens outside the website (Bizum or bank transfer) and shipping can only go out once payment is confirmed.
Challenges
- 01Unit-level inventory combining stock, made-to-order and a mixed mode, with reservations when ordering.
- 02Separating production (which does not wait for payment) from shipping (which does), with no partial shipments.
- 03Reliable notifications on free hosting that only allows one cron job a day.
- 04A shop in three languages with Basque as the default and localised URLs.
Solution & architecture
Next.js 16 (App Router) with strict TypeScript, PostgreSQL with Drizzle ORM and Better Auth. Anonymous customers shop with a cookie-based basket that is merged with their account's basket when they sign in; checkout quotes price, VAT, shipping and lead time, and the confirmed order is binding and reserves stock. Stock count corrections show their impact beforehand. Each action writes its notification to an outbox within the same transaction, and Resend sends it with retries and backoff. The admin panel (orders, production, inventory, products, shipping, content, legal, customers) requires an administrator role checked on the server.
Key decisions
D-01
Notification outbox in the database
Writing the email in the same transaction as the change guarantees that no notification is lost; failures are retried and, if they are not delivered, they generate an alert for the administrator.
D-02
Binding order that reserves stock on confirmation
Avoids selling units that do not exist when payment arrives later and outside the website.
Trade-offs
- Vercel's free plan only allows one daily cron job, so the outbox is processed right after each response, on every visit to the admin panel and in the daily cron job, instead of with a dedicated queue.
Results
Phase 1 implemented (shop, admin panel, emails, cron, unit, integration and E2E tests); opening the shop to the public is pending.
Lessons learned
Not documented yet
An entrepreneurial and full-stack development project. The code is private. It includes tracking of pre-launch legal requirements (terms of sale, privacy) and documentation of decisions, architecture, data model and order, inventory and shipping flows.
Ask about this case study
Questions here are answered with the case study “Argizari Kandelak — online shop for handmade candles” as context.