Skip to content
IT glossary
ProgrammingUpdated December 3, 2026

Monorepo

Монорепозиторий

A monorepo puts the source code for multiple projects, such as apps, services, or libraries, in one version-controlled repository. A single commit can update shared code and the projects that use it.

Also known as: монорепа

What is a monorepo?

A monorepo is a single repository that contains multiple projects. For example, an online store might keep its customer-facing site, staff dashboard, and shared component library in the same Git repository. One checkout gives developers a matching revision of all three. With separate repositories, a change to the library and the corresponding updates to each app generally go through separate reviews and must be coordinated across repositories.

How does it work?

Each project declares what it depends on. In a JavaScript or TypeScript codebase, npm, pnpm, or Yarn workspaces can make local packages available to apps without publishing them first. Workspaces are one way to manage a monorepo, not a requirement. The projects can use different languages, build tools, and versions.

As the repo grows, running every build and test on every change gets expensive. A CI pipeline can use the dependency graph to find the projects affected by a change. If a library changes, CI can test the library and its direct and indirect consumers. If only the dashboard changes, it may be safe to skip the storefront tests. A shared build configuration can affect both apps even if neither app directory changed, so directory filters alone can miss work. Build tools can also cache task outputs and reuse them when the task's inputs match.

Example: changing a shared component

store/
  apps/storefront/
  apps/dashboard/
  packages/ui/

Suppose both apps use Button from packages/ui, and the team renames its kind prop to variant. One pull request can include the new component API and all the call-site updates. Reviewers can see the whole change together, and CI can test both apps against the updated library before merging. That does not require shipping the apps together: each can still have its own build artifact and release schedule.

When is it a good fit?

A monorepo is useful when changes regularly span project boundaries or teams benefit from shared development tooling. It doesn't enforce good boundaries on its own. If one app starts importing another app's private modules, the projects become harder to change independently. Also, directory-based review rules can determine who approves a change, but they don't prevent someone with repository read access from seeing other directories. Separate repositories can be a better fit when projects rarely change together and need different read permissions.

A monorepo is not a monolith. The first describes where code is stored; the second describes how an application is structured and deployed. A single repo can house several independently deployed microservices.

How it comes up in interviews

An interviewer might ask how to keep CI fast without missing regressions. Explain how you'd map a change to the tasks that need to run, including tests for transitive consumers and checks affected by shared configuration. If asked to choose between one repo and several, focus on how often teams need cross-project changes, what can be released independently, and who needs access to the source.