Al-MadinaIttar
We designed and engineered Al Madina's entire digital commerce stack from a blank repository: a secure, payment-ready API; an operations dashboard the team runs the business from; a scroll-driven cinematic web storefront; and an iOS/Android app with the same cart, wishlist and checkout. Four codebases, ~54,000 lines of TypeScript, shipped in 16 weeks.
The Challenge
A luxury brand with no digital channel
Al Madina sold premium ittars, oud and attars through physical retail only. Customers in the UAE and abroad had no way to browse the catalogue, read scent notes or buy online — and the brand experience that makes a 300 AED perfume feel worth it didn't exist on a screen.
Customers live on mobile, operations live on desktop
The audience shops on phones, gifts on the web and expects a native app; the staff need a fast desktop tool. Building those separately would mean three diverging versions of pricing, stock and order logic.
Payments, guests and trust
The business needed card payments, cash-on-delivery (still dominant in the Gulf), guest checkout without an account, coupons and refunds — with zero tolerance for double-charges, client-side price tampering or coupon abuse.
A small team running the whole store
Products come in 3 ml to 100 ml variants, orders move through fulfilment stages, reviews need moderation and promotions need broadcasting. The team needed to do all of it from one place, safely, without a developer.
One backend, three purpose-built clients
ZEITPLAN
16 weeks (Jun – Oct 2026)
TEAMGRÖSSE
1 full-stack engineer
MEIN TITEL
Lead Full-Stack Engineer & Product Designer
KUNDE
Al Madina Ittar (UAE)
Backend API (al-madina-api)
- Node 20 + Express + TypeScript, layered routes → controller → service → repository per feature
- 17 modules: auth, products, categories, collections, tags, cart, wishlist, orders, payments, coupons, reviews, addresses, users, notifications, search, contact/newsletter, admin
- 20 MongoDB collections with Mongoose, text indexes and soft deletes
- Pluggable payments: Stripe Checkout, cash-on-delivery and a signed simulated gateway
- Redis cache-aside + BullMQ queues for email, in-app and push notifications
- Rotating refresh tokens with reuse detection, lockout, RBAC and audit logging
- OpenAPI/Swagger docs, Docker, deployed to Render
Admin Dashboard (al-madina-admin)
- Next.js 16 App Router + React 19, feature-sliced architecture
- Live KPI dashboard with period-over-period comparison and Recharts trends
- Full CRUD for products (with size variants & SKUs), categories, collections, tags and coupons
- Order management with bulk status moves, transition rules, payment history and refunds
- Customers, loyalty tiers, review moderation, broadcasts, contact inbox, audit log
- ⌘K command palette, CSV export, undo toasts and unsaved-changes guards
- Nonce-based CSP; deployed to Cloudflare Workers via OpenNext
Wie wir dorthin kamen
Ein 8-monatiger Sprint über Entdeckung, Design und Lieferung – mit einer harten Vorgabe: Die erste Version musste Excel vom ersten Tag an ersetzen, nicht schrittweise ablösen.
Discovery & Product Specification
Mapped the brand, catalogue and Gulf buying habits into a written spec: scent families, loyalty tiers (Member, Connoisseur, Maison Elite), AED pricing rules, shipping thresholds, order lifecycle and the roles the business needs.
Brand System & Mobile UI
Built the Art-Deco visual language — obsidian black, antique gold, champagne, emerald and burgundy accents; Playfair Display and Jost type — first as the mobile design system, with a mock data layer so UI could move ahead of the backend.
API Foundation
Scaffolded the layered Express API: Zod-validated config, Mongoose models, auth with JWT + rotating refresh tokens, catalogue, cart, wishlist and orders, standard success/error/pagination envelopes and Swagger docs.
Admin Dashboard
Shipped the operations console against the live API — catalogue CRUD with image uploads to Cloudinary, order and customer management, review moderation and notification broadcasts.
Payments, Coupons & Variants
Introduced a provider-based payments module (COD, simulated, Stripe), per-attempt transactions with idempotency keys, retries and refunds; coupons with server-side discount computation; and 3–100 ml product variants with their own price, SKU and stock.
Web Storefront
Built the customer website: the frame-sequence cinematic hero, catalogue, search, checkout, account area and a same-origin proxy for secure sessions.
Mobile ↔ API Integration
Flipped the app from mock to live data: SecureStore sessions, guest-to-account cart and wishlist merge, native Stripe checkout via deep links and Expo push token registration.
Security Hardening & Launch
Account lockout, refresh-token reuse detection, NoSQL operator guard, per-route rate limits, audit logs, CSP, dashboard analytics and bulk order tools; deployed API to Render, admin to Cloudflare Workers and released the Android build.
Womit Nutzer tatsächlich zu kämpfen hatten
Persona — The Gifter
Buys perfume as a gift, often for someone abroad
“I don't want to create an account just to send one bottle. Let me pay, give me a reference and let me track it.”
Kernbedürfnis:
Guest checkout with order tracking by reference + email
Persona — The Connoisseur
Repeat buyer of oud and amber blends
“I want to try a 3 ml before I commit to 100 ml, and I want my bag to follow me from my phone to my laptop.”
Kernbedürfnis:
Size variants and a cart/wishlist synced across devices
Persona — The Store Manager
Runs fulfilment and promotions day to day
“Every morning I need to know what to ship, which payments failed and what's out of stock — in one screen.”
Kernbedürfnis:
An actionable dashboard and bulk order tools
Wichtigste Forschungsergebnisse
COD had to be a first-class payment method whose payment only settles when the order is marked delivered — not an afterthought bolted onto card payments.
Customers think in oud, floral, amber, musk, woody, citrus and spicy. Fragrance families became a primary navigation axis on web and mobile and a weighted text-search signal.
A static product grid made premium pricing feel generic. Cinematic motion, editorial serif type and gold-on-black restraint carry the brand.
Prices, shipping, discounts and totals must always be recomputed on the server from the live catalogue, with line items snapshotted at purchase time.
Maison Art-Deco
One design language shared by the storefront, the app and the dashboard: deep obsidian surfaces, antique-gold accents and Art-Deco ornament (dividers, frames, geometric patterns), with jewel-tone emerald and burgundy for collections. The admin uses a calmer ivory variant of the same palette for long working sessions; all text meets WCAG AA contrast.
Farbpalette
Typografie-Skala
Komponentenbeispiele
Designprinzipien
Restraint is luxury. Gold is an accent, never a fill. Generous negative space and few, deliberate elements per screen.
One token set, three platforms. The same named colours, radii and type roles in Tailwind v4 tokens on web/admin and StyleSheet tokens on mobile.
Motion with a purpose. Cinematic where it sells (the hero), quiet everywhere else, and fully disabled under prefers-reduced-motion.
Honest states. Every section loads, empties and fails on its own. No placeholder or fake numbers — if the API is down, the section hides.
Das Produkt im Detail



Was es anders macht
Pluggable Payments: Stripe, COD & Retries
A provider interface lets Stripe Checkout, cash-on-delivery and a signed simulated gateway sit behind one API. Every attempt is its own transaction with an idempotency key; 'succeeded' only ever comes from a signature-verified webhook or a delivery confirmation. Failed or expired payments can be retried, settled ones refunded from the dashboard.
Hardened Authentication
15-minute JWT access tokens and opaque, hashed refresh tokens that rotate on every use. Reusing a spent token revokes the whole session family; five wrong passwords lock the account; staff sessions are capped and roles are re-checked from the database on each admin request.
Cinematic Scroll Storytelling
The web hero renders a 176-frame (desktop) / 30-frame (mobile) bottle sequence onto a canvas, scrubbed by GSAP ScrollTrigger and tied to the real catalogue product, with a static fallback for reduced motion.
Guest-First Cart & Wishlist Sync
Cart and wishlist work instantly as a guest on web and mobile. On sign-in they merge with the server copy by product and size, summing quantities — so a second device never overwrites the first.
Operations Dashboard
A manager's daily view: orders to fulfil, failed/pending payments and out-of-stock items, plus revenue, orders, AOV and new customers against the previous period with timezone-aware time series.
Variant-Aware Catalogue
Products carry 3, 6, 12, 30, 50 and 100 ml variants with their own price, SKU, barcode and stock; the selected size flows from the product page into cart pricing and the order snapshot.
Bulk Order Workflows
Move many orders at once through allowed status transitions; each runs the same path as a single update (history, COD settlement, customer email/notification/push) and anything that can't move is reported with a reason.
Coupons That Can't Be Gamed
Percentage or fixed discounts with minimum spend, caps, expiry and usage limits. Discounts are computed server-side, and usage is only consumed once payment actually settles.
Notifications & Broadcasts
BullMQ queues deliver order emails, in-app notifications and push events. Admins broadcast promotions by loyalty tier, and customers' opt-outs are respected automatically.
Power-User Admin UX
⌘K command palette to jump to any page or find a product, order or customer; CSV export; undo toasts; unsaved-change guards; keyboard-accessible tables, dialogs and comboboxes.
Weighted Search & Autocomplete
MongoDB text index weighted by name, brand, notes and description, Redis-cached results, prefix suggestions and debounced search with recent terms on mobile.
Native Mobile Experience
Expo Router app with onboarding, haptics, FlashList, Reanimated 4, SecureStore sessions, deep-link payment return and a mock data source that keeps it runnable without a backend.
Zahlen nach sechs Monaten im Live-Betrieb
Apps shipped
API, admin, web storefront, iOS/Android app
Automated tests
81 API integration/unit + 38 web & mobile
Client-side price trust
Every total recomputed on the server
Admin screens
Catalogue, commerce, engagement, system
Storefront routes
Including guest order tracking & account area
Mobile screens
Expo Router, light & dark
Womit es gebaut wurde
Language
Backend
Frontend
Mobile
Integrations
Testing
DevOps
Herausforderungen & Erkenntnisse
Herausforderungen
Never charging twice
Mobile networks retry. Orders and payment attempts both take an idempotency key; a replayed POST /orders returns the original order, and if the first attempt's gateway call failed, the replay opens a fresh Stripe session under a new key instead of returning an order that can never be paid.
Refresh-token races across tabs and devices
Rotating refresh tokens break when two requests refresh at once. The API allows a 30-second grace window before treating reuse as theft; the admin de-duplicates refreshes in flight and adopts a token another tab already rotated; the web BFF shares one rotation per token across parallel requests.
Keeping tokens away from JavaScript on the web
The storefront talks only to a same-origin /api/proxy route that holds access and refresh tokens in httpOnly, SameSite cookies, attaches the Bearer header server-side and rotates silently — so an XSS bug can't steal a session.
COD and card payments on one model
Fulfilment status and payment status are separate axes. Card payments settle from verified webhooks; COD settles only when an admin marks the order delivered — and coupons are consumed only at that moment, so unpaid orders never burn a single-use code.
Defending a NoSQL API
Beyond per-route Zod validation, a global guard rejects any body, query or param key starting with '$' or containing '.', blocking operator-injection payloads even on a route that forgets to validate. Webhooks are verified against raw request bytes before parsing.
Cinematic motion without killing performance
Separate desktop and mobile frame sets, progressive frame loading onto a single canvas, ScrollTrigger refresh once the first frame paints, and a fully static path under prefers-reduced-motion.
Erkenntnisse
Design the seams before the screens
A single response envelope, pagination shape and error-code vocabulary across all four apps meant each client could be built — or mocked — independently and wired up later with almost no rework.
Mock-first mobile pays off
Every mobile service has a mock and a remote half behind one switch, so the app's UI was finished weeks before the API existed and still runs offline for demos.
Put money logic in exactly one place
Shipping, discounts and variant pricing live only on the server. Clients show estimates and label them as such; the order response is the source of truth.
Write the shortcut down
Deliberate simplifications — in-memory rate limiting, a stubbed push sender, per-process token rotation — are marked in code with their ceiling and upgrade path, so scaling work is a checklist rather than an archaeology project.