Context
The capstone ships three role portals plus a public marketing/catalog surface, and later a REST API and a background worker. The team is four students working in parallel for eighteen weeks, so the cost of a contributor waiting on someone else's layer is the real risk, not raw runtime performance.
The design direction is taken from a Next.js agency template (see docs/design/DESIGN-DNA.md), and the team's previous project already runs Next 16 + React 19 + Tailwind 4 — that is where their muscle memory is.
Decision
- pnpm workspaces + Turborepo.
apps/*for deployables,packages/*for shared code. apps/webis Next.js 16 (App Router).- TypeScript end to end so
packages/sharedcan hold one Zod schema that both the browser and the API validate against.
Alternatives considered
- Vite SPA + NestJS. Fewer moving parts and the cleanest fit for "one documented REST API, many clients". Rejected because the public landing and course catalog genuinely benefit from SSR, and because the team is already fluent in Next — an unfamiliar framework costs more weeks than SSR saves.
- Next.js as a full-stack backend (no Nest). Still open for phase 2. Deferred: it changes nothing about the web app, so the decision can wait until team skill levels are confirmed.
- Single-package repo. Rejected — the worker and API are coming, and retrofitting a workspace later means rewriting every import path.
Consequences
- Easy: shared types, one lint/format/commit pipeline, one
pnpm dev. - Hard: if
apps/apiis added as a separate NestJS service, Next must stay presentation only — no business logic in route handlers or server actions, one auth system in the API, not two. That rule is inAGENTS.mdand is the main way this decision can go wrong. - Workspace packages ship raw TypeScript and are compiled by the consumer via
transpilePackages. Fast in dev; if a non-Next consumer appears,packages/uineeds a build step.