What Is a Monorepo?
A monorepo is a single code repository that contains multiple projects — web app, mobile app, shared libraries, backend services — managed together with shared tooling.
The alternative to a monorepo is a polyrepo: one repository per project. In a polyrepo, changing a shared utility means updating it in repo A, publishing a new version, and bumping the dependency in repos B and C. In a monorepo, you change it once and every project using it gets the update immediately.
What goes in a monorepo:
- Web frontend (Next.js)
- Mobile app (Flutter or React Native)
- Shared type definitions and utilities
- Backend services or API routes
- Design system component library
Monorepo tooling:
- Turborepo — build orchestration, caching, parallel execution (ideal for JS/TS)
- Nx — more opinionated, strong for large enterprise monorepos
- pnpm workspaces — package management layer for Node.js monorepos
When a monorepo makes sense:
- You have multiple apps sharing business logic or type definitions
- A web app and a mobile app that share an API client library
- You want one CI run to test all affected packages on every push
When it adds unnecessary complexity: For a solo MVP with one web app and no shared packages, a monorepo is overhead. Start simple — extract into a monorepo when you have evidence you need shared code across multiple apps.