Site / Creating a site

How Site, Surface, and Remote divide the work

Every routed screen answers three questions, each owned by one package:

  • Site (foldkit-site): Where are we in the route tree, what metadata does this location have, and which child locations surround it?
  • Surface (foldkit-surface): What may this active location observe in the Model, and which Messages may it send?
  • Remote (foldkit-remote): Which server reads do those active Surfaces require?
  • Your app (Model and update): Application state, Effects, and state transitions.

Everything below compiles down to Foldkit's Router (URL parsing and formatting), Surface.when (activation), Bundle placements (stateful pages), and Remote or SSR (data and rendering).