Aller au contenu principal
E-Commerce · Web + Mobile + Admin

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.

Jan – Aug 2024
Meridian Capital Group
8 months
al-madina.moffiitech.com
Al-Madina Ittar
2,400Active users
94%Faster reports
4Production Apps
17REST API Modules
119Automated Tests
16Weeks to Launch
Aperçu du projet

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.

Mon rôle

One backend, three purpose-built clients

CALENDRIER

16 weeks (Jun – Oct 2026)

TAILLE DE L'ÉQUIPE

1 full-stack engineer

MON TITRE

Lead Full-Stack Engineer & Product Designer

CLIENT

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
Processus

Comment nous y sommes arrivés

Un sprint de 8 mois entre découverte, conception et livraison - avec une contrainte forte : la première version devait remplacer Excel dès le premier jour, pas progressivement.

Week 1

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.

Weeks 1–3

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.

Weeks 1–4

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.

Weeks 2–7

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.

Weeks 6–10

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.

Weeks 4–14

Web Storefront

Built the customer website: the frame-sequence cinematic hero, catalogue, search, checkout, account area and a same-origin proxy for secure sessions.

Weeks 10–15

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.

Weeks 14–16

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.

Recherche UX

Ce avec quoi les utilisateurs peinaient réellement

P—

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.”

Besoin principal :

Guest checkout with order tracking by reference + email

P—

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.”

Besoin principal :

Size variants and a cart/wishlist synced across devices

P—

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.”

Besoin principal :

An actionable dashboard and bulk order tools

Principales conclusions de la recherche

01

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.

02

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.

03

A static product grid made premium pricing feel generic. Cinematic motion, editorial serif type and gold-on-black restraint carry the brand.

04

Prices, shipping, discounts and totals must always be recomputed on the server from the live catalogue, with line items snapshotted at purchase time.

Système de design

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.

Palette de couleurs

#0B0B0BRich Black
#141414Obsidian
#1C1C1ECharcoal
#C8A24BAntique Gold
#D4AF37Gold
#9A7B33Bronze
#E8D7A8Champagne
#F7F3EAIvory
#0F5132Emerald
#5A1A2BBurgundy

Échelle typographique

Display32px · 800 · -0.03em
Heading20px · 700 · -0.02em
Body medium15px · 500
Caption13px · 400 · muted
EYEBROW11px · 600 · +0.12em

Exemples de composants

ActiveAlert
Search reports...

Principes de design

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.

Galerie

Le produit en détail

Cinematic Web Hero
Mobile Home
Admin Dashboard
Product Detail
Native Checkout
Order Management
Fonctionnalités clés

Ce qui le rend différent

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.

Stripe · Webhooks · Idempotency · Backend

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.

Security · JWT · RBAC · Backend

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.

GSAP · Canvas · Web

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.

Zustand · Web · Mobile

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.

Recharts · Analytics · Admin

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.

MongoDB · Admin · Mobile

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.

Admin · Backend

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.

Business Logic · Backend

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.

BullMQ · Redis · Expo Push

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.

UX · Accessibility · Admin

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.

Search · Redis

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.

Expo · React Native · Mobile
Résultats et impact

Les chiffres après six mois en production

4

Apps shipped

API, admin, web storefront, iOS/Android app

119

Automated tests

81 API integration/unit + 38 web & mobile

0%

Client-side price trust

Every total recomputed on the server

28

Admin screens

Catalogue, commerce, engagement, system

32

Storefront routes

Including guest order tracking & account area

25

Mobile screens

Expo Router, light & dark

Technologie

Avec quoi il a été construit

Language

TypeScript

Backend

Node.jsExpressMongoDB & MongooseRedisBullMQZodJWT & bcryptSwagger / OpenAPIPino

Frontend

Next.js 16React 19Tailwind CSS v4TanStack Query & TableReact Hook FormRechartsGSAP & ScrollTriggerZustand

Mobile

Expo SDK 56React Native 0.85Expo RouterReanimated 4FlashListExpo Notifications & SecureStore

Integrations

StripeCloudinaryNodemailer

Testing

Jest & SupertestVitestmongodb-memory-server

DevOps

DockerRenderCloudflare Workers (OpenNext)
Réflexions

Défis et enseignements

Défis

1

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.

2

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.

3

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.

4

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.

5

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.

6

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.

Enseignements

1

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.

2

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.

3

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.

4

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.