Understand how the ecommerce boilerplate under web-builder/apps/templates/ecommerce-boilerplate is organized so you can update UIs without touching core plumbing.
web-builder/apps/templates/ecommerce-boilerplate.app/ with a shared layout in app/layout.tsx that wraps pages with ApolloWrapper and ClientLayout.pageItems; React components in app/_components/sections/ render each section type.graphql/ and helper hooks in lib/ fetch CMS/client-portal data; static JSON in data/ backs local mocks.components/ui; reusable widgets (loaders, alerts, forms) live in components/common.app/: All routes and page shells. Notable entries:
_components/: Layout chrome (Header, Footer, ClientLayout) and all section components under _components/sections/.page.tsx: Home page that maps pageItems to section components via renderSections.about/, contact/, products/, profile/ that render CMS-backed pages with usePage.components/: Reusable UI.
ui/: Shadcn primitives (buttons, inputs, dialog, sheet, etc.).common/: Shared widgets (loaders, dynamic forms, empty states, template alerts).data/: Local config and mock content.
configs.json: Template metadata (title, description), appearance tokens, menus, integrations.pages/*.json: Page-level content (index.json, about.json, contact.json, etc.) used in build/local modes.graphql/: Domain-specific operations grouped by feature (auth/, clientportal/, cms/, ecommerce/, order/, payment/, products/) plus aggregate queries.ts/mutations.ts.lib/: Cross-cutting utilities.
apollo-wrapper.tsx and client.ts: Apollo Client setup.AuthContext, CartContext) and hooks (useClientPortal, usePage, fetchCms, fetchCpConfig, fetchTours).renderSections.tsx: Helper to render a section list from a component map.types/: Shared TypeScript contracts (types/sections.ts defines the base Section shape).public/: Static assets (images, icons, favicons).app/page.tsx): Imports pageData from data/pages/index.json, builds a SectionComponentMap, and calls renderSections to output the page. When BUILD_MODE=true, it swaps to app/page.client.tsx to let the builder inject live data via query params.about/page.tsx and contact/page.tsx call usePage(pageName) to fetch CMS content with GET_CMS_PAGE, passing the client-portal-id header from route params. Sections are rendered by switching on section.type.app/layout.tsx wraps everything in ApolloWrapper and ClientLayout, ensuring GraphQL and layout chrome are available to every page.app/_components/sections/. Each file exports a React component that accepts { section: Section }.app/page.tsx maps section.type to components for build/local; lib/usePage.tsx does the same for CMS. Do not add or remove mappings—only adjust UI inside existing section files.data/configs.json stores meta tags, theme tokens, menus, and integration placeholders. Keep IDs and secrets out of this file; use environment variables instead.data/pages/*.json supply title, description, and pageItems for local development and build previews. Use these to validate layout and theming without hitting the CMS.BUILD_MODE=true toggles builder-driven rendering; absence falls back to local JSON-driven rendering for the home page.components/ui (generated via components.json shadcn config).components/common (loaders, dynamic forms, empty states).lib/utils.ts handle class merging and small helpers reused across sections.graphql/, with aggregated exports in graphql/queries.ts and graphql/mutations.ts.lib/apollo-wrapper.tsx provides the provider setup; lib/client.ts configures the Apollo client instance.lib/ (e.g., usePage, fetchCms, fetchCpConfig) standardize how sections and pages request CMS/client-portal data, keeping rendering logic composable and data-aware.Development Guide
Rules and workflow for UI-only changes, repo setup, and what you are allowed to edit.
Template Layout
Understand the global layout (header, footer, theme) for the ecommerce boilerplate so you can adjust UI without touching core logic.