From 1d470a7889f0af678ddabde26d98875a973ca578 Mon Sep 17 00:00:00 2001 From: Nas Date: Fri, 19 Jun 2026 16:36:00 +0200 Subject: [PATCH] refactor: restructure template around a shared data/types layer, harden SEO/a11y/security, and modernize tooling Implements the AUDIT.md roadmap end-to-end. Verified: tsc, eslint (0 problems), vitest (16 passing), clean next build (SSG), and a runtime smoke test of all routes. Architecture & data - Add single source of truth: data/{products,categories}.ts validated by zod schemas (lib/schemas); domain types derived via z.infer and exported from @/types. Remove all inline/duplicated catalog data. - Add async data-access layer (lib/data/products.ts) + derived search index. - Model prices as integer cents; format at the edge with lib/format.ts. Standardize product/cart ids on string. - Centralize brand/SEO/nav in lib/config/site.ts; validate env in lib/env.ts (siteUrl). Unify brand on 'Fashion Oasis' (was 3 spellings). Components & RSC - Extract ProductCard (client island) + ProductGrid (server); sections are now Server Components using CSS animations (motion only on the 404). - Real category filtering on /men, /women, /accessories, /sale (drop the dead CategoryPage template). - Move add-to-cart to a real sibling