ignitionstack.pro v1.0 is out! Read the announcement →
Skip to Content

Storefront Templates Module

The /[locale]/loja route showcases paid/free templates pulled from Supabase and rendered with liquid-glass cards. This page documents the data model, components, analytics hooks, and how to extend the module.

Runtime Flow

  1. src/app/[locale]/(pages)/store/page.tsx
    • Calls setRequestLocale(locale).
    • Loads translations under Store.*.
    • Fetches products via getAllProducts() (Server Query that uses ProductRepository).
    • Emits trackServerEvent("page_view", { page: "store" }) for Mixpanel.
    • Renders TemplatesGrid (filters + cards) and a CTA.
  2. TemplatesGrid (client component)
    • Filters stored in local state (search, category, stack, level, priceType).
    • For each change, emits store_filter_applied through useClickTracking (GA4 + Mixpanel).
    • Renders TemplateCard and optionally highlights one via ?template=<id> query string.
  3. CTAs use StoreContactCTA linking to /[locale]/contato and track conversions.

Data Model

src/app/types/template.ts defines the Template type (single source of truth for the store). Key fields:

FieldDescription
id, slugStable identifiers used for filtering and highlight anchors.
price, priceType, stripePriceIdPricing metadata (one-time, subscription, free).
category, stack, levelDrive filters in TemplateFilters. Keep values in sync with translation files (Store.filters.*).
featuresRendered as bullet list inside TemplateCard.
demoUrl, imageCTA + screenshot link.

Data can come from:

Repository & Admin Layer

Translations

Store.* strings in src/i18n/messages/{locale}.json cover hero copy, filters, empty state, CTA. When adding new filters/categories:

  1. Update enums in TemplateFilters.
  2. Extend translation keys (e.g., "filters.categories.{key}").
  3. Add analytics instrumentation if new filter interactions matter.

Analytics & Instrumentation

Testing

Extending the Module

  1. New Template Category – Update Template['category'], TemplateFilters options, translations, and consider adding a new filter icon/tag.
  2. Price Localization – Use Intl.NumberFormat in TemplateCard to display localized pricing (look at Store.priceNote). For multi-currency checkout, see /pricing doc.
  3. Promo Highlights – To spotlight a template, append ?template=<id> to the URL. TemplatesGrid scrolls it into view automatically.
  4. Server Measurements – If needed, add more trackServerEvent calls (e.g., store-contact-cta) in page.tsx.

Keep this page updated whenever the store gains new filters, data fields, or payment flows so marketing, product, and engineering teams stay aligned.