Webapp Architecture
The T3 commercial webapp is a Next.js 16 monorepo app with three processes.
Processes
| Process | Entry | Port |
|---|---|---|
apps/web | Next.js 16 (React 19, Tailwind 4, TypeScript, NextAuth 5) | 3000 |
apps/worker | Background worker (inbox watcher, autopilot scheduler, run queue) | — |
apps/ws | WebSocket sidecar | 3002 |
Start all three with:
bash
pnpm devRoute Structure
All authenticated workspace pages live under /w/[slug]/*. The old (legacy) route group was removed in PR #10.
Workspace Routes (/w/[slug]/)
| Route | Page |
|---|---|
/w/[slug]/ | Workspace home |
/w/[slug]/agents | Agent runs |
/w/[slug]/audit | Audit log |
/w/[slug]/autopilot | Autopilot schedules |
/w/[slug]/benchmark | Benchmarking |
/w/[slug]/board | Kanban board |
/w/[slug]/copilot | AI copilot chat |
/w/[slug]/extract | Term extraction |
/w/[slug]/funds | Fund list |
/w/[slug]/funds/[id] | Fund detail |
/w/[slug]/inbox | Document inbox |
/w/[slug]/investors | Investor list |
/w/[slug]/investors/[id] | Investor detail (minimal — schema carries name/type/classification only) |
/w/[slug]/kyc | KYC tracker |
/w/[slug]/nav | NAV reporting |
/w/[slug]/operations | Operations dashboard |
/w/[slug]/portfolio | Portfolio view |
/w/[slug]/reconcile | Reconciliation list |
/w/[slug]/reconcile/[id] | Reconciliation detail |
/w/[slug]/reporting | Reporting |
/w/[slug]/reviews | Review list |
/w/[slug]/reviews/[reviewSlug] | Review detail |
/w/[slug]/runs | Run history |
/w/[slug]/runs/[id] | Run detail |
/w/[slug]/settings/workspace | Workspace settings |
/w/[slug]/skills | Skills browser |
/w/[slug]/upload | Document upload |
/w/[slug]/upload/queue | Upload queue |
/w/[slug]/waterfall | Waterfall calculator |
Public Routes
| Route | Page |
|---|---|
/ | Landing page |
/signin | Sign in |
/signup | Sign up |
/verify | Magic link verification |
/pitch | Pitch page |
/onboarding | Workspace + fund creation |
Onboarding
Onboarding is wired with the createWorkspaceAndFund server action. It creates the workspace, the first fund, and redirects to /w/[slug]/.
Database
Postgres + Drizzle ORM. Key migrations:
0003—fund(workspace_id, name)UNIQUE constraint0004—inbox_item.fund_idFK
Design
The webapp uses a Ledger-style layout (PR #10 redesign). All workspace pages use a persistent sidebar with a drawer on mobile. See DESIGN.md for the full design system specification.
Mobile breakpoints:
- 375px: sidebar becomes a drawer, tables scroll horizontally, panels stack vertically