As projects grow, the multi-repo approach breaks down. Here's why monorepos make sense and how Turborepo makes them manageable.
Imagine you have:
frontend-app repobackend-api reposhared-types repodesign-system repoMaking a change to shared-types:
1. Publish new version of shared-types
2. Update frontend-app to use new version
3. Update backend-api to use new version
4. Coordinate the deployment order
5. Debug version mismatch issues
6. Repeat for every change
This is painful. The coordination overhead kills velocity.
Everything in one repository:
my-workspace/
├── apps/
│ ├── web/ (Next.js app)
│ └── api/ (Express API)
├── packages/
│ ├── ui/ (Design system)
│ ├── config/ (Shared config: tsconfig, eslint)
│ └── types/ (Shared TypeScript types)
├── package.json
└── turbo.json
A change to packages/types is immediately available to all apps. No publishing. No version bumping. One PR changes everything consistently.
npx create-turbo@latest// turbo.json
{
"pipeline": {
"build": {
"dependsOn": ["^build"], // Build deps first
"outputs": ["dist/**", ".next/**"]
},
"dev": {
"cache": false,
"persistent": true
},
"lint": {
"outputs": []
},
"test": {
"outputs": ["coverage/**"]
}
}
}Turborepo hashes your source files and caches build outputs. If nothing changed, it restores from cache instantly.
# First run: builds everything
turbo run build
# Second run, nothing changed:
# >>> FULL TURBO
# All tasks complete in 40ms (restored from cache)In CI, Turborepo remote cache (or open-source alternatives like Nx Cloud) means unchanged packages never rebuild across runs.
// packages/types/index.ts
export interface User {
id: string;
name: string;
email: string;
}
// apps/web — imports directly, no publishing
import { User } from "@myorg/types";
// apps/api — same import, always in sync
import { User } from "@myorg/types";When you update the User type, TypeScript catches every breakage across all apps simultaneously. No missed consumers.
For teams of 2+, the initial setup cost pays back within the first cross-repo change. For teams of 5+, it's essentially mandatory for sanity.