Project structure
A map of the codebase — where routes, components, content, and the data layer live.
The app follows the Next.js App Router layout, with a few conventions worth knowing before you start adding features.
Directory layout
src/
app/ App Router routes (marketing, docs, blog, auth, dashboard)
components/ Shared UI
features/ Feature modules (e.g. blog) — components + types together
lib/ auth, db, i18n, and other infrastructure
env.ts Validated environment schema
content/ MDX for docs, blog, legal, and authors
drizzle/ Generated SQL migrations (commit alongside schema changes)
public/ Static assetsRouting
Public pages live under src/app/[locale] so they're locale-aware and
statically generated. The authenticated dashboard lives under src/app/o,
scoped per organization at /o/[org].
Content
Docs, blog posts, legal pages, and authors are MDX files under content/,
loaded through fumadocs. Add a file, and it shows up — no registration step.
content/blog/my-post.mdx → /blog/my-post
content/docs/my-page.mdx → /docs/my-pageData
Database tables are defined per-file under src/lib/db/schema. After changing a
schema, generate and commit a migration:
pnpm db:generateAuthentication
Auth is configured in src/lib/auth.ts (email/password, Google OAuth, and
one-time codes) with organizations and members built in. The dashboard reads the
session server-side and the middleware guards /o routes.