Case study · Retail & E-commerce

Headless Commerce Re-platform for a National Retailer

Replaced a decade-old monolithic storefront with a headless Next.js platform on AWS, tripling conversion and cutting page load times in half.

+300%
Conversion rate
50%
Faster page loads
99.9%
Uptime through peak
Daily
Releases (from 6-weekly)
Client
National specialty retailer (confidential)
Industry
Retail & E-commerce
Year
2023
Duration
7 months
Team
9 engineers

Project overview

The client operates 140+ physical stores and a growing online channel that accounted for 22% of revenue. Their e-commerce platform was a heavily customised monolith that had become the single biggest constraint on the digital roadmap.

CodeQube was engaged to design and deliver a headless replacement, migrate the product catalogue and customer accounts, and hand over a platform the client’s own team could operate.

Business problem

Where the client started.

01

Release cycles of 6–8 weeks due to a shared monolith and manual regression testing, making seasonal campaigns hard to execute.

02

Median page load of 4.8s on mobile and a Lighthouse performance score in the low 30s, suppressing both conversion and organic ranking.

03

Inventory across stores and warehouses synced hourly by batch job, leading to oversells and cancellations at peak.

04

No design system; the storefront, loyalty portal and store-locator each had their own component implementations.

Proposed solution

What we proposed, and why.

  • A headless architecture separating the customer experience layer (Next.js) from commerce services via a GraphQL backend-for-frontend.

  • Event-driven inventory synchronisation using Kafka, with near-real-time stock levels surfaced on product and checkout pages.

  • A tokenised design system shared across storefront, loyalty and store tools, with accessibility baked into every component.

  • A strangler-pattern migration in which routes moved to the new platform incrementally behind an edge router, allowing per-route rollback.

Architecture

How the system is put together.

Edge-rendered Next.js storefront talking to a GraphQL BFF that aggregates commerce, search, inventory and content services. Inventory events flow over Kafka from the store POS and warehouse systems into a materialised stock service.

ecommerce-platform-transformation/architecture — layered view
L1Experience
Next.js (ISR + edge)Design systemCDN / edge router
L2API
GraphQL BFF (NestJS)Apollo FederationAPI Gateway + WAF
L3Services
Commerce engineSearch (Elasticsearch)Stock serviceLoyaltyHeadless CMS
L4Integration
Kafka (MSK)POS & WMS connectorsERP syncPayment provider
L5Platform
EKSRDS PostgreSQLElastiCacheTerraformGitHub Actions

Technology stack

Backend, frontend, data and cloud.

Next.js
React
TypeScript
Tailwind CSS
Storybook

Challenges faced

What got in the way, and how we dealt with it.

Challenge

Customer data lived in the monolith’s database with bespoke password hashing and no export tooling.

Resolution

Built a dual-write bridge and lazy password re-hash on first login. Accounts migrated silently over eight weeks with no forced resets.

Implementation details

How delivery was sequenced.

  1. 1

    Discovery & architecture (weeks 1–4)

    Event-storming workshops with merchandising, stores and digital teams; C4 architecture and ADRs agreed with the client architecture board.

  2. 2

    Foundation (weeks 5–10)

    AWS landing zone and EKS platform via Terraform, CI/CD with preview environments, design system v1 with 40 components.

  3. 3

    Incremental delivery (weeks 11–26)

    Two-week sprints migrating routes in priority order: PLP, PDP, search, cart, checkout, account. Each route shadow-tested before traffic switch.

  4. 4

    Hardening & launch (weeks 27–30)

    Load tests to 5× peak, penetration test, accessibility audit, and rehearsed cutover for the final checkout route ahead of the holiday season.

Non-functional requirements

Security and scalability considerations.

Security

  • PCI DSS scope minimised by tokenising payments through a hosted provider; no card data touches CodeQube-built services.
  • WAF, rate limiting and bot management at the edge; OWASP ASVS L2 controls verified by third-party penetration test.
  • Secrets managed in AWS Secrets Manager with short-lived IAM roles per service; no static credentials in pipelines.

Scalability

  • Horizontal pod autoscaling on EKS with pre-warmed capacity for known campaign windows.
  • ISR and edge caching serve 92% of page views without hitting origin services.
  • Kafka partitioning by store allows inventory throughput to scale linearly with the store estate.

Results & business impact

What it delivered.

+300%
Conversion rate
50%
Faster page loads
99.9%
Uptime through peak
Daily
Releases (from 6-weekly)

Business impact

  • Online revenue share grew from 22% to 34% within two quarters of launch.
  • Oversell-related cancellations reduced by 88% due to real-time inventory.
  • The client’s in-house team now ships independently; CodeQube retained for platform advisory.

More case studies

Related work.

Next step

Facing a similar problem?

We'll walk you through how this was built, what we'd do differently today, and what it would take for your organisation.