App routing
Pages load initial data on the server; client feature components handle interaction and later refreshes.
Route map
| URL | Feature / first load |
|---|---|
| / | Public landing, or redirect signed-in staff to /dashboard. |
| /sign-in, /sign-up | Clerk widgets; /account-setup explains missing staff metadata. |
| /dashboard | Inbox, initially queryInbox. |
| /reviews | WorkCatalog with queue=false, initially queryCatalog. |
| /reviews/[reviewKey] | UUID validation, loadReviewForActor, ReviewProvider(initial), ReviewWorkspace. |
| /approval-queue | WorkCatalog with queue=true; supervisor, manager, PEC. |
| /search | ReviewSearch, initially querySearchPage from URL parameters. |
| /imports | SnapNegativeIntake; client obtains saved versions when inspecting files. |
| /reports | ReportsPage, initially currentFfyFilters + queryReport. |
| /exports | ExportsPage, initially queryExportMonths. |
| /policy | PolicyPage, initially listPolicies. |
| /docs | Public codebase wiki with searchable navigation, article sections and linked source files. |
| /demo-switch | Client consumes a development View as ticket. |
Layouts and providers
src/proxy.ts installs Clerk middleware. The root layout reads the session and
supplies Clerk, session, appearance, and notification providers. Staff segment layouts use
ProtectedPage to check sign-in and any page capability. It also supplies a
navigation-capable ReviewProvider loadReview={false}. The detail page mounts
its own provider with the loaded review.
React cache deduplicates matching session reads within a server render. This
is not a cross-user cache. List components accept initial data tagged with actor/query
scope; later filter or role changes use the API.
Changing a route
Keep server data loading in the page and interactive state in the feature. Check its protected layout, API authorization, navigation link, and loading state. The shell’s desk layout sends Home to Reviews. Review GET validates UUIDs and records touches; it does not seed missing rows or redirect old number-based links.