Case study · Client under NDA
Headless commerce platform
A commerce back office the client fully owns: one admin, one API and a storefront, so any future frontend is a new client rather than a rebuild.
- Role
- Sole architect and developer
- Status
- Private
- Period
- May 2026 to Jun 2026
- Stack
- PHP 8.2, CodeIgniter 4, MariaDB, React 19, TypeScript, TanStack Start, Tailwind CSS 4, Stripe, Mollie, Viva Wallet
- Scale
- 28 feature phases
55+ admin controllers
34 migrations
56 API routes
3 card gateways + pay by bank
Summary
- Problem
- The client wanted a back office they owned outright, able to power any frontend and swap storefronts later without a rebuild.
- System
- Three deployable applications over one shared database. The admin owns the data and logic, the API exposes it, the storefront consumes it.
- Outcome
- 28 feature phases shipped and live. Brand edits land on the storefront with no redeploy, and a full audit closed every critical and high finding.
What needed to exist
A back office the client owns outright.
The client wanted a commerce back office they fully owned: one codebase that could power any frontend, hold the catalog, orders and business logic, and keep the door open to add or swap storefronts later without a rebuild.
I answered with a headless platform split into three deployable applications. The admin owns the data and the business logic, the API exposes it, and the storefront consumes it. Each ships on its own, and a new frontend is a new client of the API rather than a migration.
Architecture
Three applications, one contract.
- Payments Stripe, Mollie and Viva Wallet on one webhook driven order flow, plus a pay by bank rail built from scratch. Every price is resolved again on the server.
- Admin and API The admin owns the data and logic, and the API exposes it. The API is the only door into the data.
- Storefronts The storefront consumes the API, so a new storefront is a new client of the API rather than a migration.
- Data One shared database behind all three applications, built up over 34 migrations.
Brand edits land on the live storefront with no redeploy. Catalog, pricing, CMS pages, policies, announcements and theme colours are owned in the admin and read by the storefront at runtime, and structured content is parsed defensively, so a malformed edit degrades gracefully instead of breaking the page.
The storefront reads through one typed data layer with caching, so it stays fast without the redundant requests common in headless builds.
Decisions
Separate applications, two kinds of API, a handoff the business controls.
Hand off the cart instead of forcing one checkout
- Context
- The client already runs established Shopify and WooCommerce storefronts.
- Tempting answer
Route every sale through the new checkout.- What I did
- A pluggable handoff layer that passes a cart to an existing store, controlled per destination.
- Why
- Stores that already sell keep selling. The new platform is an option the business controls, not a migration it is forced into.
The API has two doors. Public storefront endpoints are CORS enabled and rate limited, and customer sessions authenticate with Bearer tokens. The private admin API sits behind API key authentication, so the storefront is open to the public and the admin never is.
Hard problems
Price tampering and forged payments.
A full security and code quality audit documented every finding with a severity and file level evidence, and I remediated every critical and high severity issue. The two most serious lived on the API and the gateway edge.
-
HP.01
Server side price validation
Checkout resolves every line price again from the database, so a tampered client request can never set its own price.
-
HP.02
Authenticated payment webhooks
Paid notifications are verified cryptographically or confirmed again with the provider, which closes the door on forged payment events.
-
HP.03
Atomic order processing
Order creation and payment state changes are transactional and idempotent, so nothing is processed twice and no record is orphaned.
Integrations
Card gateways and a pay by bank rail on one order flow.
Stripe, Mollie and Viva Wallet drive a webhook driven order flow, and on one deployment a pay by bank rail built from scratch joined them on the same contract. The Shopify and WooCommerce handoff is the other integration edge, switched on per destination.
That pay by bank work was part of a payment processor readiness project, written up as Payments readiness.
Security
Beyond the headline fixes.
The audit also covered gift card and coupon integrity, rate limiting on customer authentication, SSRF and stored XSS protection in the media pipeline, and reduced data exposure on the public endpoints.
Implementation
Type safe end to end, documented for the next developer.
- Catalog and variations
- Orders
- Role based access
- Coupons
- Inventory and CSV import
- Low stock alerts
- Loyalty points
- Gift cards
- Refunds and returns
- Tax and VAT engine
- Shipping zones and rates
- Verified reviews
- Abandoned cart recovery
- Affiliate tracking
- Stripe subscriptions
- Translation with DeepL
- SEO tooling
- Email notifications
- CSRF and rate limiting
- API key and Bearer auth
- Strict TypeScript
- Automated tests
- Lint and type checks
- Typed API client
- Normalized error handling
- Request timeouts
- Error boundaries and reporting
- Vendor code splitting
- Per route chunks
- Query cache
- Tuned API cache headers
- Documented onboarding
Result
28 feature phases shipped and live.
- feature phases
- 28
- admin controllers
- 55+
- migrations
- 34
- API routes
- 56
- card gateways + pay by bank
- 3
Every phase is live, not a roadmap item. Brand edits reach the storefront with no redeploy, the platform deploys with zero downtime, and the audit closed every critical and high finding.