Routing
This page describes routing in the Accelerator boilerplates. If your CMS owns routing (the CMS-led variant of Approach B), these conventions do not apply.
The mechanics follow the framework (the Next.js App Router, Nuxt pages, Vue Router), but the model is the same in all three boilerplates.
Commerce routes
Commerce pages (product, category, cluster, search, cart, checkout, quick order and account) are file-system routes that ship with the boilerplate. They fetch their data on the server where it helps SEO, and hydrate the interactive parts in the browser.
Content routes and the CMS catch-all
In the Next.js boilerplate, a catch-all route resolves any URL that is not a commerce route by looking up a page in the CMS by its slug. If the CMS has that page it renders, otherwise the route returns 404. Commerce routes always win: a CMS page cannot replace /cart or /login. See CMS integration.
How links are built
The boilerplates build every product, cluster and category link from one pattern, page/id/slug by default, which gives URLs such as /product/123/cordless-hammer-drill. The first segment is the name of the route folder (product, cluster, category). Serving categories under another name, such as /categorie/ for a Dutch shop, means renaming that route folder and updating the link builders that point to it.
Revalidation
All three boilerplates cache the catalog data they fetch for anonymous visitors. Signed-in users always get fresh data, because their prices and assortment depend on their Company. To refresh cached data without a rebuild, call the refresh endpoint from a backend webhook with a tag:
curl -X POST https://shop.example.com/api/revalidate \
-H 'Content-Type: application/json' \
-H 'X-Revalidate-Secret: YOUR_REVALIDATE_SECRET' \
--data '{"tag": "product:42"}'
{"ok": true, "tag": "product:42"}
Tags name what to refresh: product:<id>, category:<id>, menu or catalog (everything). The endpoint answers 503 while REVALIDATE_SECRET is not set and 401 when the header does not match it.
See also
- Accelerator for the stacks and their settings
- CMS integration for how content pages are resolved
- Deployment for setting the refresh secret in production
- Categories and navigation for the category data model behind the URLs