MIKHAIL NERI

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.

Headless commerce platform Three applications over one shared database. Card gateways post signed webhooks to the API, the API is the only door into the data, and the storefront is one client of it. Parts: Stripe; Mollie; Viva Wallet; Pay by bank (per deployment); CI4 admin platform (catalog, orders, logic); REST API service (private and public endpoints); React 19 storefront (tanstack start); Shopify / WooCommerce (cart handoff); One shared database (mariadb · 34 migrations). Stripe connects to REST API service. Mollie connects to REST API service (signed webhooks). Viva Wallet connects to REST API service. Pay by bank connects to REST API service. CI4 admin platform connects to REST API service. REST API service connects to React 19 storefront (bearer, cors). React 19 storefront connects to Shopify / WooCommerce (optional). CI4 admin platform connects to One shared database. REST API service connects to One shared database. Signed webhooks Bearer CORS Optional Stripe Mollie Viva Wallet Pay by bank Per deployment CI4 admin platform Catalog, orders, logic REST API service Private and public endpoints React 19 storefront TanStack Start Shopify / WooCommerce Cart handoff One shared database MariaDB · 34 migrations
  • 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.
FIG. 01 Gateways sit on the API edge, not in the storefront, so payment truth is decided on the server. The Shopify and WooCommerce handoff is dashed because the business switches it on per destination.

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.

Headless commerce platform Three applications over one shared database. Card gateways post signed webhooks to the API, the API is the only door into the data, and the storefront is one client of it. Parts: Stripe; Mollie; Viva Wallet; Pay by bank (per deployment); CI4 admin platform (catalog, orders, logic); REST API service (private and public endpoints); React 19 storefront (tanstack start); Shopify / WooCommerce (cart handoff); One shared database (mariadb · 34 migrations). Stripe connects to REST API service. Mollie connects to REST API service (signed webhooks). Viva Wallet connects to REST API service. Pay by bank connects to REST API service. CI4 admin platform connects to REST API service. REST API service connects to React 19 storefront (bearer, cors). React 19 storefront connects to Shopify / WooCommerce (optional). CI4 admin platform connects to One shared database. REST API service connects to One shared database. Signed webhooks Bearer CORS Optional Stripe Mollie Viva Wallet Pay by bank Per deployment CI4 admin platform Catalog, orders, logic REST API service Private and public endpoints React 19 storefront TanStack Start Shopify / WooCommerce Cart handoff One shared database MariaDB · 34 migrations
FIG. 02 Both fixes live where the money is decided: the API and its gateways.
  1. 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.

  2. HP.02

    Authenticated payment webhooks

    Paid notifications are verified cryptographically or confirmed again with the provider, which closes the door on forged payment events.

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

Building something like this?

Start a project

Payments readiness Next system