The problem
The template shop cannot express the catalogue, every promotion needs a developer, and stock drifts from the ERP so customers buy what is not there. Page speed collapses exactly when the ad spend lands.
Our approach
Split the storefront from the commerce engine. Product pages are statically rendered and revalidated on change, so a campaign spike hits a CDN instead of a database. Stock is authoritative in the ERP, pushed to the storefront on a webhook, with a reservation check at checkout so overselling is caught at the last honest moment.
Architecture
- Clients
- Next.js storefront (ISR)Admin console
- Edge
- CDN cache per marketImage optimisation
- Services
- Cart + pricingPromotionsTax per jurisdictionStock reconciler
- Data
- PostgreSQLElasticsearchWebhook replay log
- External
- ERP (stock of record)Stripe
Next.js storefront, incremental static regeneration per product, edge cache per market
Commerce engine handling cart, pricing rules, promotions and tax per jurisdiction
ERP integration: webhook in, queued reconciliation job, nightly full diff as a safety net
Payments through Stripe with idempotent order creation and a replayable webhook log
Search on Elasticsearch with per-market synonym dictionaries
What usually goes wrong
Catalogue migration always contains more special cases than the client remembers. We import real data in week two, not week twelve, so the surprises are priced while the plan can still absorb them.