Update the UIs of existing sections while keeping the ecommerce boilerplate composable and data-aware.
A section is a reusable slice of a page. Each section:
Section object with a type string and a config payload from JSON or CMS.section.type in both JSON mocks and CMS responses.Files live in app/_components/sections/ (e.g., HeroSection.tsx, ProductsSection.tsx, BannerSection.tsx, etc.).
Scope: You cannot add new sections or modify core plumbing. Changes must stay within existing section UIs (styling, layout, copy handling, states).
{ section: Section }.section.config (titles, images, limits, filters, CTAs). Avoid hardcoded copy.useProductsQuery in ProductsSection, getFileUrl for assets). Provide graceful fallbacks for empty/error states."use client" only when needed (hooks, state, effects). Many presentational sections can stay server components.Example: HeroSection.tsx reads section.config.image, title, description, and primaryCta and uses helpers like getFileUrl/templateUrl to resolve assets and links.
app/page.tsx builds a SectionComponentMap and calls renderSections with pageItems from data/pages/index.json.lib/usePage.tsx switches on section.type when rendering pages like about/page.tsx and contact/page.tsx.For a section to render in all contexts, it must be added to both maps.
app/_components/sections/*.tsx. Do not add new section files or modify registries.section.type or how section.config is read; only adjust rendering (markup, classes, layout).ProductsSection uses useProductsQuery), leave data flow intact and only update presentation or states.data/pages/*.json or CMS data with BUILD_MODE=true to verify UI changes.BannerSection and HeroSection resolve images with getFileUrl and provide clickable CTAs via templateUrl.ProductsSection, ProductCategoriesSection, ToursSection, CmsPostsSection, and GallerySection fetch or render collections, handle loading placeholders, empty states, and errors.ContactSection and FormSection read fields from config and use shared UI components.LastViewedProductsSection reads from cart/context to personalize content.Use these as references for states, fallbacks, and config shapes.
Section type (see types/sections.ts):
type: stringconfig?: any (shape is section-specific; document the keys you expect)content, contentType, contentTypeId, order, namedata/pages/*.json) uses pageItems: Section[]. CMS responses mirror this shape (section.type, section.config).Document expected config fields in PRs or code comments near the section to keep designers and CMS authors aligned.
data/pages/*.json page and run yarn dev with BUILD_MODE unset. Verify rendering, responsiveness, and accessibility.BUILD_MODE=true and load the page via the builder to ensure the section works with live data and params.yarn lint and ensure the section handles loading, empty, and error states without crashing.Template Layout
Understand the global layout (header, footer, theme) for the ecommerce boilerplate so you can adjust UI without touching core logic.
Template Pages
Understand the existing pages in the ecommerce boilerplate. You may adjust UI only—no new pages or core wiring changes.