Monorepo Template
prototype : Monorepo Template
An entry from the chronicle of built things — its purpose, its materials, and the bargains struck along the way.
The starting point extracted after Audiophile was finished: a monorepo wired end to end, so the next project begins at working authentication rather than at an empty folder. Two apps — a React client on React Router 7 and Vite, an Express 5 REST API — sit over four packages holding the Prisma client and schema, the shared domain types and Zod schemas, and the ESLint and TypeScript configs both apps inherit.
Two vertical slices prove the wiring instead of a feature list. Signup and login run JWTs through both cookies and headers, with protected routes on the client and protected endpoints on the API. The navbar reads a public categories endpoint and an authenticated cart badge, and defines what each renders while logged out. A template that merely compiles proves nothing; these are the paths that break first when the seams are wrong.
Turborepo orchestrates the task graph and TypeScript project references carry types across the workspace boundary, so the domain package's Zod schemas are one definition point for what the client sends and what the server validates — the contract cannot drift between the two halves without failing a build.
tech_stackInventory of Materials
- TypeScriptLanguage
- React 19Interface
- Express 5API
- PrismaData mapper
- MongoDBDatabase
- TurborepoTask orchestration
- pnpmWorkspaces

AI-generated with Google

AI-generated with Google

AI-generated with Google
Engineering Tradeoffs
Shipping the auth and cart slices rather than an empty skeleton is what makes the seams checkable, and it is also what dates fastest. Every consumer inherits opinions — TanStack Query, TanStack Form, Radix — it may not want, and removing an opinion is more work than adding one.
Pinning the stack down to exact versions of Node, pnpm and every dependency makes a fresh clone reproducible, and turns the template itself into a maintenance object. The pins are a promise that has to be re-made every few months, or the template quietly becomes a museum piece.
MongoDB behind Prisma means a new project needs no migration step in its first hour, at the price of the narrower half of Prisma's surface — no migration history, and fewer relational features than the SQL connectors offer.