PHP backend case study

ShopFlow E-commerce

Context: an e-commerce mock with checkout, payment, and backoffice order handling. The problem is that cart state, pricing, and payment status cannot depend on frontend state.

Case study

Technical scope

Some repositories are private until the work is closed. Project scope, technical decisions, and operating scenarios are described on the page. I can discuss the code during a technical conversation.

01

Problem

  • The shop demo should show the complete commerce lifecycle, not only a checkout form: product discovery, cart state, customer account, payment, and backoffice order handling.
  • The key risks are inconsistent checkout pricing, duplicate payment attempts, webhook replay, inventory drift, and admin operations without auditability or permission checks.
02

Technical decision

  • Backend cart as the source of truth, server-side pricing, Idempotency-Key for checkout, signed webhooks, and an audit log for backoffice operations.
  • The backend is the source of truth for cart state, prices, discounts, shipping, and availability; the frontend displays the result but does not own the final order state.
  • Checkout, cart, customer account, payments, and webhooks are coordinated by separate application services, keeping controllers as a thin HTTP layer.
03

Result

  • The project shows design for a critical business flow: checkout, payment retry, order status, fulfillment, and operational reports.
  • Storefront: product catalog, search, filters, sorting, product pages, wishlist, recently viewed, mini cart, and customer help center.
  • Customer flow: registration, login, shipping profile, order history, checkout prefill, and guest cart merge after login.
  • Backoffice: products, inventory, orders, payments, fulfillment tracking, CSV/JSON reports, audit log, roles, and maintenance panel.
04

Stack

  • PHP / Checkout / Payments / Webhooks
  • composer install
  • composer serve
  • composer smoke-local