Tenant-safe architecture
How identity, policy, contracts, and PostgreSQL keep writes authoritative.
On this page
Canonical source
This public guide is distilled from docs/CONVENTIONS.md and docs/DATABASE-RUNTIME.md. Keep implementation detail in those repository documents.
One write authority
Authenticated server services derive Clerk identity, parse shared Zod contracts, resolve organization or project access, and own every Drizzle transaction. The browser never supplies authoritative tenant, user, or role identity.
Database invariants before application assumptions
Constraints, tenant-aware indexes, reviewed migrations, bounded queries, and explicit transaction profiles keep correctness close to durable truth. PostgreSQL row-level security is documented as a future defense-in-depth layer, not advertised as active protection.
Was this page helpful?
Feedback is stored only in this browser in the starter implementation.