# 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:

- [`docs/architecture/website/WEBSITE_CONTRACT.md`](docs/architecture/website/WEBSITE_CONTRACT.md:1)

## 1) High-level layout

```text
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`](docs/architecture/website/WEBSITE_RSC_PRESENTATION.md:1).

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

Canonical folders (existing in this repo):

```text
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
   builders/              data transformation (DTO → ViewModel → ViewData)
     view-models/
     view-data/
   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
```

