Storefront overview
Country-aware catalog, cart, checkout, confirmation, and account routes in Openfront Ecommerce.
The built-in storefront lives under app/(storefront)/[countryCode]. It reads region-aware catalog data and provides product discovery, cart, checkout, confirmation and customer-account routes.
Current routes
- regional home and store pages;
- product, category and collection detail;
- cart and checkout;
- order confirmation;
- sign-in and checkout-link entry;
- account profile, addresses, orders, invoices and invoicing.
Storefront UI and data helpers live under features/storefront. Product, cart, checkout, payment and order truth remains in the Keystone/domain layer.
Current storefront workflow
- Resolve a country code and region.
- Browse products, variants and prices for that region.
- Create or resume a cart whose ID is stored in the storefront cookie.
- Add or update lines and collect address, shipping and payment choices.
- Initiate a payment session for an installed provider.
- Call
completeActiveCartto capture or record payment and create the order. - Load the resulting order for confirmation or customer history.
Current Ecommerce source does not consistently establish this as an ownership-safe, idempotent checkout boundary. activeCart, updateActiveCart, line-item updates, payment-session initiation and completion accept caller-supplied IDs and use privileged Keystone access without complete cart-owner, parent-line, replay or transaction checks. Treat the built-in flow as implementation source to harden, not as proof that an external client can safely expose those operations.
Before accepting live checkout, derive or validate totals on the server, bind every line and payment session to the authorized cart, serialize inventory changes, add an idempotency boundary, verify signed webhook replay handling, reconcile provider state, and test wrong-user and replay cases.
Custom storefronts
You can change the built-in storefront or build another client. Use narrow public/catalog operations and ownership-scoped cart/order operations. Do not expose private Keystone lists, provider credentials, internal costs or unrestricted status updates to make a separate client easier.