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

950 B

Website Data Flow (Strict)

This document defines the apps/website data flow.

Authoritative contract: docs/architecture/website/WEBSITE_CONTRACT.md.

Website scope:

  • apps/website/**

1) Website role

The website is a delivery layer.

It renders truth from the API and forwards user intent to the API.

2) Read flow

RSC page.tsx
  ↓
PageQuery
  ↓
API client (infra)
  ↓
API Transport DTO
  ↓
Page DTO
  ↓
Presenter (client)
  ↓
ViewModel (optional)
  ↓
Presenter (client)
  ↓
ViewData
  ↓
Template

3) Write flow

All writes enter through Server Actions.

User intent
  ↓
Server Action
  ↓
Command Model / Request DTO
  ↓
API
  ↓
Revalidation
  ↓
RSC reload

4) Non-negotiable rules

  1. Templates accept ViewData only.
  2. Page Queries do not format.
  3. Presenters do not call the API.
  4. Client state is UI-only.