A complete guide to create and configure a Fastify project within a monorepo managed with pnpm workspace. Prerequisites Node.js (v22 or higher) pnpm installed Monorepo Structure The final structure will look like this: app-monorepo/ βββ package.json βββ pnpm-workspace.yaml βββ apps/ β βββ api/ β βββ package.json β βββ tsconfig.json β βββ src/ β β βββ app.ts β β βββ server.ts β β βββ routes/ β β β βββ root.ts β β β βββ users/ β β β βββ index.ts β β βββ plugins/ β β βββ cors.ts β β βββ helmet.ts β β βββ sensible.ts β βββ test/ β βββ helper.ts β βββ tsconfig.json β βββ plugins/ β β βββ sensible.test.ts β βββ routes/ β βββ example.test.ts βββ tsconfig.json Note: Separating app.ts from server.ts is an official Fastify convention. It allows you to test the app without starting the HTTP server.β¦