How kirill-zhirnov/boundless-nextjs-ecommerce-template works
1. This repository is a Next.js + TypeScript storefront template for Boundless Commerce. Architecturally it is a mostly server-rendered/catalog-driven e-commerce front end that consumes Boundless’s headless commerce API and delegates checkout to a separate Boundless checkout flow.
2. The app is organized around Next.js page routes in pages/. Key entry points are the home page, category listing (/category/[slug]), product detail (/product/[slug]), cart, checkout catch-all route, thank-you page, a CMS-style page route (/page/cover), and a generated sitemap.xml. These routes define the top-level navigation and the main SEO-visible content surfaces.
3. Shared page framing lives in layouts/Main.tsx and the reusable shell components in components/ such as Header, Footer, menus, breadcrumbs, and the loading/alert widgets. The layout layer is responsible for composing the common store chrome around every page and for keeping the catalog/cart UI consistent.
4. Data access and domain transformation are concentrated in lib/. This folder likely acts as the boundary between Boundless API responses and UI-friendly models: api.ts for API calls, product.ts, category.ts, menu.ts, breadcrumbs.ts, meta.ts, urls.ts, imgs.ts, and calculator.ts for shaping content, links, image URLs, and pricing/derived values. These helpers are the main place where external API data becomes presentation-ready.
5. State management is centralized in Redux under redux/. The store has separate slices for cart, alerts, aside menu state, app state, and XHR/loading state, plus cart actions. This indicates a global-state boundary for interactive cross-page concerns such as cart contents, mobile menu open/close state, user alerts, and request lifecycle flags.
6. The cart subsystem is a first-class feature rather than a simple form. Components under components/cart/ handle cart rows, loaders, and the header cart widget; the Redux cart slice keeps the canonical cart state; and the checkout page route bridges from the storefront cart into the external checkout experience. This creates a clear separation between browsing and purchase completion.
7. Catalog browsing is split into reusable subcomponents for categories, filters, sorting, pagination, and product cards. components/category/, components/filterForm/, components/ProductsList.tsx, and components/ProductsSlider*.tsx together form the browsing pipeline: category pages load products, pass them through filters/sort controls, and render them in list or carousel form. This is the main merchandising/data-discovery path in the app.
8. Product detail pages are built from a dedicated product component family under components/product/. The page combines gallery/images, labels, characteristics, variant selection, pricing, shipping info, and schema/metadata generation. This area is the boundary where product identity, variant selection, and purchase intent are resolved before an item reaches the cart.
9. SEO and metadata are deliberately built into the architecture. The presence of MetaSchemaOrg, sitemap generation, breadcrumbs, and URL/meta helper modules shows that pages are expected to produce crawlable, structured output. The BOUNDLESS_BASE_URL environment option is specifically used to emit absolute URLs for sitemap and social metadata.
10. Styling is handled with SCSS, not CSS-in-JS. Global variables, mixins, functions, component-specific styles, and a sample theme live under styles/, with a themes/sample override structure suggesting the template is designed for branding/customization without changing component logic. UI structure and visual theme are therefore decoupled.
11. The app is wired for responsive storefront behavior and mobile interactions: aside menu/backdrop, horizontal/vertical menus, filters modal, sliders, loaders, and dedicated mobile-oriented components. The inclusion of Swiper-based slider components and nprogress/loader styles indicates asynchronous page transitions and marketing-style content carousels are part of the intended user experience.
12. Runtime integration is defined by environment variables in .env.example: a permanent API token, instance ID, and optional base URL/image proportion. In architectural terms, the storefront depends on the Boundless Commerce service for catalog, content, and checkout data, while static assets and public web manifest/robots files support deployment as a conventional Next.js site.
Main entry points: Main.tsx Main layout · api.ts API client · PriceAndBuy.tsx Product UI · ProductsList.tsx Catalog UI
Components 21
Pages
Next.js route surfaces and SEO entry points
- Home · Storefront landing page
pages/index.tsx - Category · Catalog listing route
pages/category/[slug].tsx - Product · Product detail route
pages/product/[slug].tsx - Cart · Cart page
pages/cart.tsx - Checkout · Catch-all checkout bridge
pages/checkout/[[...slug]].tsx - Thank you · Post-purchase confirmation route
pages/thank-you/[id].tsx - CMS page · Static content page route
pages/page/cover.tsx - Sitemap · Generated sitemap.xml
pages/sitemap.xml.ts
Components
Reusable storefront UI and page composition
- Main layout · Shared storefront frame
layouts/Main.tsx - Header · Top navigation and cart access
components/Header.tsx - Footer · Site footer content and links
components/Footer.tsx - Catalog UI · Category controls, lists, pagination, and sliders
components/ProductsList.tsx - Product UI · Gallery, variants, pricing, metadata, shipping
components/product/PriceAndBuy.tsx - Cart UI · Cart rows, loaders, and header widget
components/cart/CartItems.tsx - Menus · Horizontal, vertical, aside, and breadcrumb navigation
components/HorizontalMenu.tsx
Domain lib
API boundary and presentation-ready data shaping
- API client · Boundless commerce API access
lib/api.ts - Domain mappers · Category, product, menu, breadcrumb, meta, and URL shaping
lib/product.ts - Pricing · Currency and derived value helpers
lib/calculator.ts
Redux state
Global interactive state and request lifecycle
Styles
SCSS theming and component styling
- Theme SCSS · Global variables, component styles, and sample theme overrides
styles/styles.scss
Connections 31
- Home → Main layout: renders in · Home page uses shared shell
- Category → Main layout: renders in · Category route uses shared shell
- Product → Main layout: renders in · Product route uses shared shell
- Cart → Main layout: renders in · Cart route uses shared shell
- Checkout → Main layout: renders in · Checkout flow keeps storefront frame
- Thank you → Main layout: renders in · Thank-you page uses shared shell
- CMS page → Main layout: renders in · CMS page uses shared shell
- Main layout → Header: composes · Shared header chrome
- Main layout → Footer: composes · Shared footer chrome
- Main layout → Menus: composes · Global navigation and breadcrumbs
- Home → Catalog UI: uses · Home surfaces merchandising content
- Category → Catalog UI: uses · Category route builds browse experience
- Product → Product UI: uses · Product page builds purchase decision view
- Cart → Cart UI: uses · Cart page shows canonical cart state
- Sitemap → Domain mappers: uses · Sitemap emits canonical URLs and metadata
- Catalog UI → Domain mappers: maps data · Category and list presentation models
- Product UI → Domain mappers: maps data · Product detail transformation and SEO metadata
- Product UI → Pricing: formats · Price display and derived calculations
- Cart UI → Slices: reads state · Cart UI binds to global cart state
- Header → Slices: reads state · Header cart and menu state
- Store → Slices: assembles · Store combines app slices
- Home → API client: fetches · Home content comes from commerce API
- Category → API client: fetches · Category listings come from commerce API
- Product → API client: fetches · Product data comes from commerce API
- Cart → API client: fetches · Cart data is synchronized with backend
- Checkout → API client: bridges · Checkout hands off to Boundless flow
- Catalog UI → Theme SCSS: styled by · Browse UI is SCSS-themed
- Product UI → Theme SCSS: styled by · Product UI is SCSS-themed
- Cart UI → Theme SCSS: styled by · Cart UI is SCSS-themed
- Menus → Theme SCSS: styled by · Menus and breadcrumbs use SCSS styles
- Sitemap → API client: reads · Sitemap may reuse catalog data for URLs