T://bendet

Monorepo Template

prototype : Monorepo Template

standardizedformularefined

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
An isometric render of a tiered dark tower crowned with a small chip, lit by red and cyan circuit traces, with rails running from it to blocks on every side.
SYS_VIEW: the_​shared_​corePlate I. The shared core.

AI-generated with Google

A square circuit board seen from above at an angle, a glowing central tower ringed by six smaller modules joined to it by rails.
SYS_VIEW: the_​workspace_​laid_​outPlate II. The workspace laid out.

AI-generated with Google

A stepped tower of dark slabs lit blue from within, standing at the crossing of rails that run out through a dense city of circuit blocks.
SYS_VIEW: references_​across_​the_​boundaryPlate III. References across the boundary.

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.

Source on GitHub (opens in new tab)