Skip to content

refactor: restructure template around a shared data/types layer, hard…#1

Merged
nasroykh merged 1 commit into
mainfrom
refactor
Jun 19, 2026
Merged

refactor: restructure template around a shared data/types layer, hard…#1
nasroykh merged 1 commit into
mainfrom
refactor

Conversation

@nasroykh

Copy link
Copy Markdown
Owner

…en 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 (no nested interactive).
  • Split Footer newsletter into a client leaf; add mobile nav, theme toggle, validated contact form (react-hook-form + zod).
  • Rewrite cart store: numeric subtotal/line totals, quantity clamping, pure addToCart action; fix hydration-safe rendering.

SEO / a11y / theming

  • Per-page metadata + canonical/OG via lib/seo.ts; Product + BreadcrumbList JSON-LD; generateStaticParams + dynamicParams=false (true 404s); product routes in sitemap.
  • Wire dark mode (next-themes + ThemeProvider + toggle), fix @custom-variant.
  • Skip link, prefers-reduced-motion, cart aria labels, success/warning/rating tokens, local SVG placeholder art (drop placehold.co dependency).

Tooling, infra & docs

  • Remove 7 unused deps + 7 dead ui/ files; consolidate hooks into lib/hooks.
  • next.config: security headers, poweredByHeader:false, image formats, optimizePackageImports; tsconfig ES2022 + stricter flags; Prettier, EditorConfig, .nvmrc, engines/packageManager, CI workflow.
  • Dockerfile: Node 24, drop dead deps stage, fix HEALTHCHECK to /api/health (+ real health route); fix compose/Makefile/validate-script.
  • Vitest unit tests; fix ESLint 10 + eslint-plugin-react crash.
  • Sweep docs (README/LLMS/CLAUDE/DOCKER): correct versions, remove the non-existent 'Radix UI', document build-time env semantics. Add AUDIT.md, LICENSE, CONTRIBUTING.

…en 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 <button> (no nested interactive).
- Split Footer newsletter into a client leaf; add mobile nav, theme toggle,
  validated contact form (react-hook-form + zod).
- Rewrite cart store: numeric subtotal/line totals, quantity clamping, pure
  addToCart action; fix hydration-safe rendering.

SEO / a11y / theming
- Per-page metadata + canonical/OG via lib/seo.ts; Product + BreadcrumbList
  JSON-LD; generateStaticParams + dynamicParams=false (true 404s); product
  routes in sitemap.
- Wire dark mode (next-themes + ThemeProvider + toggle), fix @custom-variant.
- Skip link, prefers-reduced-motion, cart aria labels, success/warning/rating
  tokens, local SVG placeholder art (drop placehold.co dependency).

Tooling, infra & docs
- Remove 7 unused deps + 7 dead ui/ files; consolidate hooks into lib/hooks.
- next.config: security headers, poweredByHeader:false, image formats,
  optimizePackageImports; tsconfig ES2022 + stricter flags; Prettier,
  EditorConfig, .nvmrc, engines/packageManager, CI workflow.
- Dockerfile: Node 24, drop dead deps stage, fix HEALTHCHECK to /api/health
  (+ real health route); fix compose/Makefile/validate-script.
- Vitest unit tests; fix ESLint 10 + eslint-plugin-react crash.
- Sweep docs (README/LLMS/CLAUDE/DOCKER): correct versions, remove the
  non-existent 'Radix UI', document build-time env semantics. Add AUDIT.md,
  LICENSE, CONTRIBUTING.
@nasroykh nasroykh self-assigned this Jun 19, 2026
@nasroykh nasroykh merged commit fe328a5 into main Jun 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant