Skip to main content
L0product

Multi-Tenant Routing

Customer org signs in and sees only their data via URL-scoped routes. The routing layer that makes multi-tenancy real for users, not just the database.

1,200
Priority Score
Pain × Demand × Edge × Trend × Conversion
Customer Journey

Why should I care?

Five cards that sell the dream

1Why

One URL separates your data.

What happens when Solar365 signs in and sees Dreamineering's CRM?

The friction: DB-level multi-tenancy exists. Org schema, scoped queries, membership model — all working. But every route is flat under /(app)/. Sign in as Solar365, see Dreamineering's data.

The desire: /org/solar365/dashboard. /org/solar365/crm. Every URL carries the org context. The auth adapter validates membership before rendering a single byte.

The proof: Vercel, Linear, Notion all use this exact pattern. The DB layer is done. This is routing.

Picture
Two office buildings side by side, each glowing a different color — one sees into the other through a shared glass wall. A URL bar floats between them showing /org/solar365/. Dark, cinematic, 16:9
1 / 5

Above: why the customer should care. Below: why the builder should care.

Feature Dev Journey

How do we build it?

Five cards that sell the process

1Job

Route before render.

What is the single job this PRD solves?

Resolve org context from the URL before any child route renders. One layout, one guard, one context — every downstream component inherits.

1 / 5

Kill Signal

Solar365 signs in, creates a contact in CRM. If contact appears in Dreamineering's CRM, data isolation failed — halt everything.

Questions

If the URL says /org/solar365/ but the auth adapter returns Dreamineering's org ID, which one wins — and how do you detect the mismatch before data leaks?

  • Should the org layout guard fail open (render with fallback) or fail closed (redirect to picker)? Cross-tenant exposure is worse than a redirect loop.
  • When a user's org membership is revoked, what happens to their active session at /org/[that-slug]/?
  • Is the org slug the right URL token, or should it be org ID? Slugs are readable but can change. IDs are stable but ugly.