Architecture¶
App Router Structure¶
The app uses Next.js App Router with a language-aware segment: app/[lang]/(site)/. The root layout (app/[lang]/(site)/layout.tsx) wires up global providers, metadata, and page chrome.
Key root elements:
- Layout: app/[lang]/(site)/layout.tsx
- Global error, not-found, robots, sitemap: app/global-error.tsx, app/not-found.tsx, app/robots.ts, app/sitemap.ts
- Providers: components/Providers.tsx, app/context/*
Localization¶
- Locales:
dictionaries/config.ts(en,es,pt,fr,et) - Dictionary loading:
dictionaries/index.tsanddictionaries/utils.ts - Static params per locale:
app/[lang]/(site)/layout.tsx
Components¶
The component library is organized by domain in components/.
- Layout: Header/, Footer/, CookieBanner/, ScrollToTop/
- Sections: Hero/, Services/, CaseStudies/, Contact/, Pricing/, etc.
- UX utilities: ui/ (reading progress, skip-to-content, motion, etc.)
Analytics & Consent¶
Consent-aware event tracking lives in utils/analytics.ts. Events are only sent if the cookie consent (cookie-consent) includes analytics: true.
Performance & PWA¶
- Service worker logic in
public/sw.js - Registration and cache management in
components/ServiceWorkerRegistration.tsx - Image optimization via
scripts/optimize-images.js
Metadata & SEO¶
- Metadata and OG images are defined in
app/[lang]/(site)/layout.tsx - Structured data in
components/SEO/StructuredData.tsx - Sitemap includes localized alternates in
app/sitemap.ts