Develop and extend
Concept Available

Web App Architecture and Data Flow

Pages compose features; feature modules own behavior; shared infrastructure owns transport and query keys. Organization identity stays explicit in URLs and query-cache isolation is part of the tenancy contract.

For
Frontend developers
On this page
  1. Routing and providers
  2. API and query contracts
  3. Loading and errors
  4. UI conventions
  5. Streaming exception
01

Routing and providers

The root layout composes URL-state, query, tooltip, and application providers. Public authentication routes bypass protected context. Organization View uses /dashboard/[orgId], while Platform View uses /dashboard/platform with no active Organization.

02

API and query contracts

Use the shared API singleton, feature-local Zod schemas, and centralized query keys. The client sends cookies and transforms snake_case responses to camelCase. New Organization-scoped queries must include Organization identity in their key or join the provider eviction set used during a real Organization switch.

03

Loading and errors

Use route loading and error files for page-blocking router work. Component-owned queries keep their initial loading, retry, search, pagination, and refetch states local. A hook error does not automatically reach an App Router error boundary.

04

UI conventions

Prefer Server Components until client-owned behavior is required. Use branded ConfirmationDialog for confirmation flows and shared shadcn Select primitives for option selectors. Mutations invalidate affected list and detail families; avoid effect chains for user-triggered workflows.

05

Streaming exception

Agent logs use a dedicated Next route handler that proxies server-sent events and a feature hook that owns reconnection. Keep this explicit exception separate from the normal API client.

Documentation