Full-Stack · E-Commerce
Ali Baba — Multi-Branch E-Commerce Platform
A server-rendered, multi-branch e-commerce platform with a role-based admin console and a pure server-side discount engine.
The business problem
What was at stake
Running one online store across several physical branches usually means orders land at the wrong kitchen, managers can see each other's numbers, and the day's totals never quite add up — and every one of those is lost money or lost trust. The business needed a single system where each branch runs itself, prices can't be tampered with, and the revenue figures are simply correct.
What this protects
Business guarantees, in plain terms
You get paid the right amount, every time.
Prices and discounts are calculated and locked on the server, so a customer physically cannot alter a total to pay less than the price you set.
Every branch stays in its lane.
Each manager sees and controls only their own branch's orders, stock, and customers — never another location's.
Your revenue reports are trustworthy.
Money is tracked to the exact cent and counted only once an order is actually delivered, so your figures match reality — and your bank.
Under the hood
Ali Baba is a production-grade e-commerce platform for a multi-branch patisserie business, pairing a customer storefront with a role-gated admin console. It's built entirely on the Next.js 16 App Router with React Server Components and Server Actions — every page renders fully populated on first load, with no client-side data-fetching layer.
Architecture & Approach
The whole app is server-rendered and server-validated. Prisma queries run directly inside Server Components; every mutation goes through a Server Action guarded by a role check. A pure, dependency-free Discount Engine resolves the best live promotion identically on product cards, the cart, and at checkout — so a customer is always billed exactly what they were shown.
Engineering Highlights
Branch-scoped RBAC resolved live from the database; financial-grade Decimal money end to end; race-safe atomic stock control; cursor-based pagination; request-level query dedupe with React cache(); and timezone-exact, DELIVERED-only revenue reporting pinned to Africa/Cairo.
Built With
Have a project like this?
Tell me what you're building — I'll show you how I'd make it secure, fast, and correct.