Files
gridpilot.gg/docs/architecture/website/WEBSITE_FILE_STRUCTURE.md
2026-01-11 14:42:54 +01:00

1.5 KiB
Raw History

Website File Structure (Strict)

This document defines the canonical physical structure for apps/website/**.

It describes where code lives, not the full behavioral rules.

Authoritative contract:

1) High-level layout

apps/website/
  app/                  Next.js routes (RSC pages, layouts, server actions)
  templates/             template components (ViewData only)
  lib/                   website code (clients, services, view-models, etc.)

2) apps/website/app/ (routing)

Routes are implemented via Next.js App Router.

Rules:

  • server page.tsx does composition only
  • templates are pure
  • writes enter via server actions

See docs/architecture/website/WEBSITE_RSC_PRESENTATION.md.

3) apps/website/lib/ (website internals)

Canonical folders (existing in this repo):

apps/website/lib/
  api/                  API clients
  infrastructure/        technical concerns
  services/              UI orchestration (read-only and write orchestration)
  page-queries/          server composition
  types/                 API transport DTOs
  view-models/            client-only classes
  display-objects/        deterministic formatting helpers
  command-models/         transient form models
  blockers/              UX-only prevention
  hooks/                 React-only helpers
  di/                    client-first DI integration