Documentation Index
Fetch the complete documentation index at: https://docs.tuturuuu.com/llms.txt
Use this file to discover all available pages before exploring further.
apps/web routing has two jobs:
- map browser-friendly URLs onto the App Router file structure
- canonicalize workspace identity before pages and APIs touch the database
platform/architecture/workspaces-permissions.
File Structure Versus Browser URLs
The dashboard uses the App Router structure:workspace-segment is one of:
- a workspace UUID
personalinternal
Proxy Responsibilities
apps/web/src/proxy.ts is the routing coordinator at the edge.
It is responsible for:
- locale negotiation
- auth-cookie propagation during redirects
- onboarding and root-path redirect behavior
- canonical workspace slug redirects
- workspace-aware request preprocessing before the App Router handles the page
Workspace Slug Canonicalization
Two workspace IDs are intentionally rewritten into stable slugs:- the current user’s personal workspace UUID ->
personal ROOT_WORKSPACE_ID->internal
Why this matters
- links are shorter and more stable
- users do not need to memorize internal UUIDs for personal/internal workspaces
- page code can still resolve those slugs back to real UUIDs with shared helpers
Default Workspace Redirect
When an authenticated user hits/, the proxy uses getUserDefaultWorkspace() to find the best landing workspace.
Resolution order:
user_private_details.default_workspace_id, if it still exists and the user is a member- the user’s personal workspace
personalfor a personal workspaceinternalfor the root workspace- the UUID for a normal workspace
Page-Level Workspace Resolution
Server pages should not parse workspace slugs manually. UseWorkspaceWrapper, which calls getWorkspace() and gives the page:
workspace- canonical UUID
wsId isPersonalisRoot
notFound().
This makes page code simpler because the page receives the normalized UUID even when the URL used personal or internal.
API-Level Workspace Resolution
Route handlers should usenormalizeWorkspaceId().
That helper:
- accepts the raw route segment
- converts
personalinto the authenticated user’s personal workspace UUID - converts
internalintoROOT_WORKSPACE_ID - preserves request-scoped auth when passed a request-derived Supabase client
- URLs may use slugs
- database reads and writes should use canonical UUID workspace IDs
Routing And Authorization Are Separate Layers
Routing tells the app which workspace the request targets. Authorization tells the app whether the current actor may view or mutate something inside that workspace. That separation is deliberate:WorkspaceWrapper/getWorkspace()handle membership and identity resolution for pagesnormalizeWorkspaceId()handles route-param normalization for APIsgetPermissions()handles feature-level access control