Wiki
Architecture

Monorepo layout

What each app and package is responsible for.

The repository is a pnpm workspace driven by Turborepo. Apps are deployable units; packages are shared libraries consumed by the apps.

web — React (TanStack Start) client · :3001
server — Hono + oRPC HTTP host · :3000
collab — Hocuspocus + Yjs real-time service · :1234
tui — guided terminal installer / ops wizard
docs — this documentation & marketing site · :3002
api — oRPC routers, Zod schemas, access control
auth — Better Auth config, statement & roles
db — Drizzle schema & SQL migrations
editor — shared TipTap schema (web + collab)
ui — shared shadcn/ui primitives and styles
env — typed environment-variable schemas
config — shared TypeScript configuration

Apps

AppRole
apps/webThe primary client — React 19, TanStack Start & Router, Tailwind CSS 4.
apps/serverThin Hono host that mounts the oRPC handler, OpenAPI, and auth routes.
apps/collabNode-only real-time collaboration service (Hocuspocus + Yjs).
apps/tuiSelf-contained installer/ops wizard (OpenTUI + React), shipped as a binary.
apps/docsThe docs + marketing site (Fumadocs on TanStack Start).

Packages

PackageRole
packages/apiBusiness logic and data contracts. All routers, schemas, and access control.
packages/authBetter Auth configuration; the RBAC statement and static roles (single source of truth).
packages/dbDrizzle ORM schema and versioned SQL migrations.
packages/editorThe shared TipTap schema used by both the web editor and the collab service.
packages/uiShared UI primitives (shadcn/ui on base-ui) and Tailwind styles.
packages/envTyped environment-variable schemas (t3-env style).
packages/configShared tsconfig base.

Why this shape

The strict boundary keeps the HTTP surface (apps/server) separate from the business logic (packages/api) separate from the clients. A single oRPC router definition drives both the type-safe RPC surface and the generated OpenAPI document — see API & oRPC.

Tooling

  • pnpm — workspace + catalog for shared dependency versions.
  • Turborepo — task pipeline and caching (build, test, check-types).
  • Vitest — tests.
  • Oxlint / Oxfmt — lint and format.
  • lefthook — git hooks that lint/format staged files on commit.

On this page