The /[locale]/recommendations route showcases curated tools/books/courses with affiliate disclosures. This page explains the data flow, components, and analytics so the feature stays consistent.
| Layer | File | Responsibility |
|---|---|---|
| Route | src/app/[locale]/(pages)/recommendations/page.tsx | Sets locale, SEO metadata, tracks Mixpanel page_view, loads categories/products via fetchRecommendationsData() and fetchRecommendationsByCategory(). |
| Disclaimer | components/recommendations/affiliate-disclaimer.tsx | Renders disclosure + CTA. |
| Category Section | components/recommendations/category-section.tsx | Displays icon, description, and a grid of ProductCards. |
| Product Card | components/recommendations/product-card.tsx | Shows title, description, features, price, CTA buttons (demo/buy). |
| Data Fetchers | src/app/lib/data-fetchers.ts | Reads public/data/recommendations.json (generated by scripts/convert-data-to-json.ts). |
src/app/types/recommendation.ts defines Recommendation objects:
id, category, title, descriptionprice, priceDisplayfeatures[]links.demoUrl, links.buyUrlaffiliate metadata (boolean + disclaimer)Categories live alongside data (categories: CategoryData[]) specifying icon names (mapped in category-section.tsx) and translation keys (Recommendations.categories.{id}.title).
Run:
npm run data:convertThis invokes scripts/convert-data-to-json.ts, writing public/data/recommendations.json (categories + recommendation entries). During SSR, data-fetchers.ts reads the JSON via fs; in the browser it fetches /data/recommendations.json.
ScrollReveal, glass-panel, and the liquid-glass design tokens documented in /components/liquid-glass.lucide-react; categorySection.icon must match one of the mapped components (BookOpen, Laptop, etc.).bg-accent-orange, bg-content-primary) defined in Tailwind config.All copy is translated via src/i18n/messages/{locale}.json under the Recommendations.* namespace:
Recommendations.hero.title, .subtitle, .taglineRecommendations.categories.{id}.title / .descriptionRecommendations.cta.* if you add extra callouts.Whenever you add a category:
recommendations.json data (category + products).iconMap in category-section.tsx).trackServerEvent('page_view', { page: 'recommendations' }) is emitted when the page loads.recommendations_cta_click via useClickTracking (if not already). Use consistent GA4 parameters for outbound affiliate clicks.CategorySection renders products (even if only one at launch).priceDisplay (string) per entry (e.g., “R$ 149”); keep raw price for sorting.utm_source=ignitionstack to buyUrl. For deeper tracking, route clicks through /api/recommendations/track before redirecting.TemplatesGrid filters (search by title, filter by category).src/app/test/unit/components/recommendations/* (if missing, add tests for CategorySection and ProductCard).fetchRecommendationsData/fetchRecommendationsByCategory to ensure JSON structure hasn’t changed./pt/indicacoes).Keep this page updated when new recommendation categories launch or when the underlying data pipeline changes (e.g., moving from static JSON to Supabase tables).