Dependency rules
What each layer may import.
Allowed directions
app → modules, presentation, integrations (thin), routes, providers
modules → _core, platform/db, integrations/auth (as needed)
presentation → utils, integrations/i18n (nav), not Drizzle
integrations → platform/env, vendor SDKs
platform → env schemas, DB driversHard no
- Domain/use-case files importing React client components
- UI importing Drizzle tables directly for business rules
- Redefining
admin/customerrole strings outsideauth.access.ts - Scattering path literals — use
ROUTES
Practical test
If a change requires editing five unrelated folders for one concept, the ownership boundary is wrong — colocate under the owning module or route _lib.