Directory structure
Where every top-level folder lives and why.
src/ map
| Path | Responsibility |
|---|---|
app/[locale] | Route groups: landing, auth, app, admin, docs, blog |
modules/_core | Domain errors, locale/currency catalogs, helpers |
modules/<domain> | Types, zod, schema helpers, use-cases/ |
presentation | shadcn, custom DataTable, theme, branding, fonts |
providers | Client providers (theme, nuqs, docs, i18n, tooltip) |
integrations | Vendor adapters (never dump business UI here) |
platform | env, db, testing |
hooks | Shared React hooks |
utils | cn and tiny helpers |
routes.ts | Path constants |
proxy.ts | Middleware entry |
Colocation in routes
Prefer route-private folders:
_components/— UI for that route_lib/— parsers, mappers, local helpers
Example: admin users tab parsers live in admin/users/_lib/search-params.ts.