Loading...
Loading...
Pattern reference for building Deco storefronts. Covers how a site uses the framework (@deco/deco) and apps (deco-cx/apps) together — CMS wiring via __resolveType, section patterns (loaders, LoadingFallback, JSDoc annotations for admin), client-side patterns (invoke proxy, signals, islands, analytics), and app composition (site.ts factory, AppContext, theme, images). Based on analysis of production sites like osklenbr. Use when building new sections, wiring CMS data, creating islands, setting up analytics, composing apps, or understanding how sites connect to the Deco ecosystem.
npx skill4agent add decocms/deco-start deco-site-patterns| Document | Topic |
|---|---|
| cms-wiring.md | CMS block system, __resolveType, decofile, pages, redirects, dependency resolution |
| section-patterns.md | Section conventions, loaders, LoadingFallback, JSDoc for admin, widget types |
| client-patterns.md | Invoke proxy, islands, signals, analytics, cart/wishlist/user hooks, SDK utilities |
| app-composition.md | App factory, AppContext, theme, images, routes, matchers, global layout |
@deco/deco (framework)
Resolution engine, block system, plugins, hooks, runtime
|
deco-cx/apps (integrations)
Commerce types, VTEX/Shopify loaders, website handlers, matchers, analytics
|
Site repo (storefront)
Sections, islands, components, SDK, routes, .deco/blocksmy-store/
|-- deno.json # Imports, tasks, compiler options
|-- fresh.config.ts # Fresh + Deco plugin registration
|-- manifest.gen.ts # Auto-generated block registry
|-- fresh.gen.ts # Auto-generated Fresh manifest (routes + islands)
|-- runtime.ts # Typed invoke proxy for client-side calls
|-- main.ts # Production entry point
|-- dev.ts # Dev entry (tailwind + HMR)
|
|-- apps/ # App registrations
| |-- site.ts # Main app: manifest + dependencies (std, commerce)
| |-- decohub.ts # Admin hub re-export
|
|-- .deco/blocks/ # CMS content (decofile)
| |-- site.json # Root config: global sections, routes, SEO, theme
| |-- everyone.json # Flag with route definitions
| |-- pages-*.json # Page blocks with sections and variants
| |-- redirects-*.json # Individual redirect definitions
| |-- vtex.json # VTEX app configuration
|
|-- sections/ # CMS-renderable UI sections
| |-- ProductRetrofit/ # Product sections (PDP, shelf, search)
| |-- HeaderRetrofit/ # Header section
| |-- FooterRetrofit/ # Footer section
| |-- ImagesRetrofit/ # Banner, carousel, gallery sections
| |-- Theme/ # Theme section (colors, fonts, CSS vars)
|
|-- islands/ # Client-side interactive components (hydrated)
| |-- HeaderRetrofit/ # Header islands (search, drawers)
| |-- DetailsRetrofit/ # PDP islands (product actions, size selector)
| |-- CartRetrofit/ # Cart island
|
|-- components/ # Shared Preact components (used by sections + islands)
| |-- productRetrofit/ # Product card, gallery, details
| |-- searchRetrofit/ # Search result, filters, sort
| |-- uiRetrofit/ # Base UI (image, slider, modal, button)
| |-- minicartRetrofit/ # Cart, cart item, coupon
|
|-- sdk/ # Client-side utilities
| |-- useUIRetrofit.ts # Global UI state (signals)
| |-- formatRetrofit.ts # Price formatting
| |-- analyticsRetrofit.ts # Analytics event dispatch
| |-- useAddToCart*.ts # Add to cart logic
| |-- useLazyLoad.tsx # IntersectionObserver lazy loading
|
|-- loaders/ # Site-specific data loaders
|-- actions/ # Site-specific mutations
|-- matchers/ # Site-specific audience matchers
|-- routes/ # Fresh routes (_app.tsx, proxy.ts)
|-- static/ # Static assetsmanifest.gen.tssite/sections/ProductRetrofit/ProductDetails.tsx.deco/blocks/pages-*.json__resolveTypeinvoke@preact/signalsapps/site.tsstdcommerce| Skill | Focus |
|---|---|
| Framework internals (engine, blocks, runtime) |
| Apps monorepo structure (VTEX, Shopify, website) |
| TanStack Start version of the framework |
| Fresh/Preact to TanStack/React migration |
| VTEX-specific porting guide |