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.

What are Monorepos

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.

Examples of Monorepos

Several popular open-source projects and companies adopt the monorepo approach. Here are a couple of examples:

  1. Daily Code (https://github.com/code100x/daily-code): This repository contains code for a daily coding challenge website. It includes both the frontend and backend code in a single repository.
  2. Cal.com (https://github.com/calcom/cal.com): Cal.com is an open-source scheduling platform. Their monorepo contains the code for the web application, backend services, and various integrations.

Importance for Full Stack Engineers

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: