In this lecture, Harkirat introduces monorepos
and the Turborepo framework
, exploring its features like caching
, parallelization
, and dependency management
. He guides through initializing a Turborepo project, running applications, adding different types of apps (Next.js, React, Node.js), and creating shared common modules
across the monorepo.
A monorepo, short for "monolithic repository," is a single repository that contains all the code for multiple projects or components of a larger application. Instead of having separate repositories for frontend, backend, and DevOps code, a monorepo consolidates everything into a single repository.
In a monorepo structure, you'll typically find directories for different parts of the application, such as:
monorepo/
├── frontend/
│ ├── web-app/
│ └── mobile-app/
├── backend/
│ ├── api-server/
│ └── database/
├── devops/
│ ├── ci-cd/
│ └── infrastructure/
└── shared/
├── utils/
└── components/
This structure allows for a centralized location where all the code related to a project or organization can be stored, versioned, and managed together.
Several popular open-source projects and companies adopt the monorepo approach. Here are a couple of examples:
As a full stack engineer, it's not essential to have in-depth knowledge of setting up and managing monorepos from scratch. In most cases, the monorepo structure is already established by the development tools team or the project's initial setup.
However, it's beneficial to understand the best practices and conventions used within a monorepo. This includes: