SaaS Platform Case Study

The Cloud Bakery OS

A full-scale multi-tenant SaaS platform that manages every aspect of a modern bakery business — from production planning and inventory to route optimisation and FSA-compliant traceability.

Overview

One platform. Every aspect of bakery operations.

The Cloud Bakery OS was built to replace the patchwork of spreadsheets, paper records, and disconnected tools that most artisan bakeries rely on. The result is a single, unified platform covering production, inventory, ordering, delivery, compliance, and staff management.

Built as a fully multi-tenant SaaS product, each bakery gets their own isolated environment with custom branding, their own customer portal, and a subscription plan matched to their size.

25+

Operational modules

200+

API endpoints

50+

Database tables

4

Subscription tiers

The Cloud Bakery OS Dashboard

Architecture

Built for scale from day one

Database-level multi-tenancy means every bakery's data is fully isolated — no shared tables, no data leakage risks.

🏗️

Multi-Tenant Isolation

Every table is scoped to a tenant context. All queries are filtered at the middleware layer — no query ever runs without tenant isolation. Admin impersonation is fully audited.

🎨

White-Label Customer Portal

Each bakery gets a slug-routed portal (/portal/[slug]) with their own branding, product catalogue, and customer accounts. Guests can checkout without registering.

🔐

6-Role RBAC

Platform Owner, Platform Admin, Owner, Manager, Worker, and Driver roles — each with precisely scoped permissions. Feature access is further gated by subscription tier.

💳

Subscription Tiers

Demo, Starter, Professional, and Enterprise plans. Feature flags and usage limits enforced at the API layer on every request.

🔎

FSA-Compliant Traceability

Full "field to fork" batch/lot traceability. Forward and backward trace, recall management, FIFO lot allocation, and expiry tracking — built to FSA one-step traceability requirements.

🛡️

GDPR Field Encryption

Field-level encryption on all PII (email, phone, address, name). Supports right-to-erasure with a single delete operation.

Modules

Everything a bakery needs

25+ integrated modules covering every workflow — from the production floor to the customer's door.

🧪

Recipe & Ingredient Management

Recipe versioning with auto-calculated nutrition facts, allergen tracking (all 14 UK allergens), cost analysis, and multi-output support.

📋

Production Planning

Daily/weekly scheduling with demand-based suggestions, FIFO lot allocation, bake sheet PDF generation, and order-linked production plans.

📦

Inventory & Stock

Real-time stock tracking across multiple locations, reorder points, demand forecasting, expiry warnings, and purchase order management.

🛒

Order Management

Customer order creation, standing/recurring orders, status tracking from pending to delivered, route assignment, and invoice generation.

🚚

Route Optimisation & Delivery

Route planning with Google Maps API, driver assignment, delivery window management, proof of delivery, and real-time route updates.

🏷️

Label Designer & Printing

Visual drag-and-drop label designer with dynamic data binding, barcode/QR code support, batch printing, and print queue management.

🔍

Batch/Lot Traceability (FSA)

FSA-compliant "field to fork" traceability with forward/backward trace, recall management, expiry tracking, and supplier lot linkage.

🎓

Training Academy

Online courses with modules, quizzes, multimedia assets, certificate generation, external trainee invitations, and guest access.

🖥️

Kiosk Mode

Touch-optimised full-screen interface for production floor tablets — time clock, production tasks, simplified navigation.

⏱️

Time Clock & Payroll

PIN-based employee time tracking with break management, GPS location, overtime detection, manager approval, and payroll export.

📊

Analytics & Reporting

Real-time KPI dashboard, revenue by product/customer/route, production efficiency, profit margins, and CSV/Excel/PDF export.

🛍️

White-Label Customer Portal

Slug-routed customer portal (/portal/[tenantSlug]) with custom branding, product catalogue, guest checkout, order history, and reCAPTCHA v3.

Tech Stack

Built on a modern, production-proven stack

Frontend

  • Next.js 15
  • TypeScript
  • Tailwind CSS
  • shadcn/ui
  • React Hook Form
  • Chart.js / Recharts
  • @dnd-kit (label designer)

Backend

  • Next.js API Routes
  • Prisma ORM
  • Database driver
  • Password hashing
  • JWT auth
  • Zod validation

Database

  • MySQL 8.0
  • Field-level encryption
  • Comprehensive relational schema

Infrastructure

  • Vercel (hosting)
  • Object Storage (CDN)
  • Redis (caching)
  • Google Maps API
  • Nodemailer + Resend

Security & Compliance

  • GDPR field-level encryption
  • CSRF protection
  • RBAC (6 roles)
  • Audit logging
  • FSA compliance
  • Rate limiting

Notable Decisions

Engineering highlights

Dual database layer

The ORM handles schema management and type safety. Direct database connections are used for performance-critical queries. The hybrid approach gives the best of both worlds without over-engineering.

Route optimisation algorithm

Custom route optimiser using the Google Maps Roads API to calculate optimal delivery sequences by considering delivery windows, driver availability, and live traffic — saving significant fuel and time each day.

AI-powered demand forecasting

AI integration provides recipe optimisation suggestions and demand forecasting to help bakeries plan production more accurately and reduce waste.

Label designer with drag-and-drop

Built on @dnd-kit, the label designer allows bakeries to create fully custom product labels with dynamic data binding (weight, allergens, expiry dates), barcode/QR support, and batch printing to connected printers.

Training academy with certification

A built-in learning management system allows bakeries to train staff with structured courses, quizzes, and auto-generated certificates. External trainees can be invited via token-based guest access.

Audit trail on every change

Every user action is logged with actor, target, timestamp, IP, and user agent. The audit system underpins GDPR compliance and gives platform admins full visibility across all tenants.

Need something built at this scale?

I design and build custom SaaS platforms, internal tools, and enterprise web applications. Let's talk about your project.