WooCommerce as the source of truth, Laravel as the BFF

I work on a beauty and cosmetics store that has run on WooCommerce for years. The sales team works in the WordPress panel: adding products, following orders, knowing every corner of it. Meanwhile the storefront, a WordPress theme with many plugins, was slow, and in online sales every second of slowness is a customer who won't wait.
Two simple options were on the table, and both were bad: a full migration to another platform, meaning the whole team's habits change and the data move is risky; or endless tuning of the same theme, which has a ceiling.
Three layers
- WooCommerce stays the source of truth. Products, stock, prices and orders are created and kept there. The sales team notices no change.
- A Laravel BFF reads data from WooCommerce in scheduled jobs, shapes it the way the storefront needs, and keeps it ready.
- A Nuxt storefront reads only from the BFF, with SSR for Google and PWA for mobile.
Why a BFF?
WooCommerce's REST API is built for administration, not for a storefront. One category page might need several requests and lots of extra data. A BFF (Backend for Frontend) does that work once, ahead of time: the data a page needs is ready, in exactly that shape.
The result is that shopper traffic never reaches WordPress. WordPress serves only the sales team and the sync jobs, and the storefront is served from cache.
The sensitive parts
- Stock and price: anything from a cache may be minutes behind. Fine for a product page, not for the moment of purchase. When an order is placed, stock and price are checked against WooCommerce itself.
- Orders go straight to WooCommerce. The BFF keeps no orders; it only relays. One source of truth, not two.
- Syncs must be repeatable. If a job stops halfway, running it again must not break anything.
The general lesson
You don't always have to throw away a system that works. Often the best move is to find which part really hurts and separate only that. Here the problem wasn't the panel, it was the storefront, so only the storefront changed.
I used the same pattern for a source with no API at all in the flight system's crawlers, and for payments in what payment gateways share. WooCommerce's own API is in the REST API docs.
Comments
Sign in to leave a comment.
Sign inLoading…


