<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Suryansh Sharma</title>
    <description>The latest articles on DEV Community by Suryansh Sharma (@suryansh_yc).</description>
    <link>https://dev.to/suryansh_yc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3071910%2F95b8aa20-611a-45dd-8bc4-23b546d77adf.png</url>
      <title>DEV Community: Suryansh Sharma</title>
      <link>https://dev.to/suryansh_yc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/suryansh_yc"/>
    <language>en</language>
    <item>
      <title>Monorepos!! Nx vs Turborepo vs Lerna – Part 3: Lerna</title>
      <dc:creator>Suryansh Sharma</dc:creator>
      <pubDate>Thu, 05 Jun 2025 11:43:33 +0000</pubDate>
      <link>https://dev.to/suryansh_yc/monorepos-nx-vs-turborepo-vs-lerna-part-3-lerna-51op</link>
      <guid>https://dev.to/suryansh_yc/monorepos-nx-vs-turborepo-vs-lerna-part-3-lerna-51op</guid>
      <description>&lt;p&gt;In our previous post, we walked through setting up a Nx monorepo containing a React web app, a Node.js API, and a React Native mobile app. In this post, we'll achieve the same setup using Lerna as our monorepo tool of choice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started with the Monorepo
&lt;/h2&gt;

&lt;p&gt;Start by creating a new directory for your monorepo, navigating into it, and initializing Lerna. This sets up the foundational structure for your project, including the necessary configuration files and a packages folder where your future sub-projects will reside.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir Lerna
cd Lerna
npx lerna init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwehhe86bwnjgi0bpvar8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwehhe86bwnjgi0bpvar8.png" alt="lerna init folder structure" width="542" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up the React Website
&lt;/h2&gt;

&lt;p&gt;Next, we'll create a packages directory (if it doesn't already exist), navigate into it, and scaffold a new Vite project. This is where we'll add individual packages or apps managed by Lerna.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir packages
cd packages
npm create vite@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, navigate into your new project directory (for example, website), install all required dependencies, and launch the development server to start building and previewing your app in real time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd website
npm install
npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frxh382ty2ofbm50y5hgf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frxh382ty2ofbm50y5hgf.png" alt="react preview" width="800" height="945"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up the Node Backend
&lt;/h2&gt;

&lt;p&gt;Run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd ../
mkdir api
cd api
npm init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands move you up one directory level, create a new api folder, and enter it. Running npm init then initializes a new Node.js project, allowing you to configure your API package from scratch. This is the foundation for building a clean, modular Node.js REST API, following best practices for project organization and scalability.&lt;/p&gt;

&lt;p&gt;Create a new file in the &lt;strong&gt;packages/api&lt;/strong&gt; folder named &lt;strong&gt;index.js&lt;/strong&gt; and paste the following code in it. This is a basic express server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import express from 'express';

const app = express();
const PORT = 3001;

app.get('/', (_req, res) =&amp;gt; {
  res.send('Hello from the API!');
});

app.listen(PORT, () =&amp;gt; {
  console.log(`API listening on port ${PORT}`);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now add scripts and packages in the package.json file to run the project. The final &lt;strong&gt;package.json&lt;/strong&gt; file will look like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "name": "api",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "dev": "nodemon index.js",
    "test": "echo \"Error: no test specified\" &amp;amp;&amp;amp; exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "express": "^5.1.0"
  },
  "devDependencies": {
    "nodemon": "^3.1.10"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run &lt;code&gt;npm install&lt;/code&gt; command to install the packages.&lt;br&gt;
Run &lt;code&gt;npm run dev&lt;/code&gt; to start the api.&lt;/p&gt;
&lt;h2&gt;
  
  
  Setting Up the Bare React Native App
&lt;/h2&gt;

&lt;p&gt;To set up a bare React Native project as a package within your Lerna monorepo using npm workspaces, follow these steps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd packages
npx @react-native-community/cli@latest init mobileApp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands navigate into your packages directory and initialize a new bare React Native project named mobileApp.&lt;br&gt;
After initializing your React Native project, you need to install the native iOS dependencies using CocoaPods. This step is essential for the iOS part of your React Native app to work correctly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd mobileApp/iOS
pod install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you have installed the CocoaPods dependencies, you’re ready to start your React Native development server and launch the app on the iOS simulator.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd ../
npm run start
npm run ios
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F84vxar1pwy09ccvffuem.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F84vxar1pwy09ccvffuem.png" alt="mobileApp preview" width="714" height="1646"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Resolving Git Submodule Errors
&lt;/h3&gt;

&lt;p&gt;Now that the app is up and running, it's time to commit your changes.&lt;br&gt;
However, there's a small issue with the starter template—it initializes a Git repository inside the newly created apps/mobileApp folder. To get ride of that git submodule, from the root folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm -rf apps/mobileApp/.git
git add .
git commit -m "create mobileApp"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We now have a working mobile app located in the apps folder, fully integrated into the monorepo with a clean Git setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;By following these steps, you’ve successfully set up a scalable monorepo using Lerna and npm workspaces, and added both web (Vite), API (Node.js), and mobile (React Native) projects under a single repository. This unified workflow streamlines dependency management, code sharing, and collaboration across your entire stack. Whether you’re building for web, API, or mobile, this monorepo approach will help you stay organized, boost productivity, and simplify project maintenance as your codebase grows. Happy coding!&lt;/p&gt;

&lt;p&gt;You can find all the code in the &lt;a href="https://github.com/suryansh-yc/lerna-monorepo" rel="noopener noreferrer"&gt;Github Repo&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Monorepos!! Nx vs Turborepo vs Lerna – Part 2: Nx</title>
      <dc:creator>Suryansh Sharma</dc:creator>
      <pubDate>Mon, 26 May 2025 06:44:58 +0000</pubDate>
      <link>https://dev.to/suryansh_yc/monorepos-nx-vs-turborepo-vs-lerna-part-2-nx-1jco</link>
      <guid>https://dev.to/suryansh_yc/monorepos-nx-vs-turborepo-vs-lerna-part-2-nx-1jco</guid>
      <description>&lt;p&gt;In our previous post, we walked through setting up a Turborepo monorepo containing a React web app, a Node.js API, and a React Native mobile app. In this post, we'll achieve the same setup using Nx as our monorepo tool of choice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started with the Monorepo
&lt;/h2&gt;

&lt;p&gt;We will start by creating an Nx workspace. Follow the official documenttion of &lt;a href="https://nx.dev/getting-started/installation" rel="noopener noreferrer"&gt;Nx&lt;/a&gt;. You can use the package manager of your choice, i will be using the npm packae manager.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-nx-workspace@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will guide you through the setup, asking whether you want a monorepo or a standalone app and whether you want to start with a blank or a preconfigured setup.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjytvx15ynzqoqfhox4s7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjytvx15ynzqoqfhox4s7.png" alt="create-nx-worpsce command output cli" width="800" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you've created your workspace, you can&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;run single tasks with &lt;code&gt;npx nx &amp;lt;target&amp;gt; &amp;lt;project&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;run multiple tasks with &lt;code&gt;npx nx run-many -t &amp;lt;target1&amp;gt; &amp;lt;target2&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also install the &lt;a href="https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console" rel="noopener noreferrer"&gt;Nx Console&lt;/a&gt; official extension on vscode to start commands from there rather then using cli.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk9zshjkl7ryum1k5w7yq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk9zshjkl7ryum1k5w7yq.png" alt="Nx Console Extension" width="558" height="566"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the &lt;code&gt;npx nx dev website&lt;/code&gt; or click on the run icon on the dev command to run the project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; NX   @nx-monorepo/website:serve  
    VITE v6.3.5  ready in 96 ms
    ➜  Local:   http://localhost:4200/
    ➜  press h + enter to show help
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcitp74uk7plt63qs156z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcitp74uk7plt63qs156z.png" alt="Nx Vite Starter Website" width="800" height="723"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above command created an nx workspace with a React website so we just need to add Nodejs API and React Native app now.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up the Node Backend
&lt;/h2&gt;

&lt;p&gt;We are going to use the &lt;a href="https://nx.dev/nx-api/node" rel="noopener noreferrer"&gt;@nx/node&lt;/a&gt; plugin to add a Nodejs API to our monorepo.&lt;br&gt;
In any Nx workspace, you can install @nx/node by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx nx add @nx/node
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will install the correct version of @nx/node. You can add a new application with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx nx g @nx/node:application apps/&amp;lt;your api name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1zqdtfvch7nh4tndyhg3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1zqdtfvch7nh4tndyhg3.png" alt="Add nodejs application output cli" width="800" height="303"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can run your application with &lt;code&gt;npx nx serve api&lt;/code&gt; or using the Nx Console extension.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbgll8clvjb8wmdj2pfku.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbgll8clvjb8wmdj2pfku.png" alt="Nodejs serve command cli" width="800" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see the &lt;code&gt;{"message":"Hello API"}&lt;/code&gt; response on &lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up the React Native App
&lt;/h2&gt;

&lt;p&gt;We are going to use the &lt;a href="https://nx.dev/nx-api/react-native" rel="noopener noreferrer"&gt;@nx/react-native&lt;/a&gt; plugin to add a React Native App to our monorepo. In any Nx workspace, you can install @nx/react-native by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx nx add @nx/react-native
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will install the correct version of @nx/react-native. You can add a new application with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx nx g @nx/react-native:app apps/&amp;lt;your-app-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb21nn80gv4jaoukis554.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb21nn80gv4jaoukis554.png" alt="react-native output cli" width="800" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can run your application with &lt;code&gt;npx nx start run-ios&lt;/code&gt; or using the Nx Console extension.&lt;/p&gt;

&lt;p&gt;This is the final folder structure of the project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp2dkhzqohzlsradrczy5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp2dkhzqohzlsradrczy5.png" alt="final folder" width="570" height="964"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;With the initial Nx setup complete, we now have a fully functional monorepo that integrates our React web app, React Native mobile app, and Node.js API. This structure allows us to share configurations, utilities, and React hooks across all platforms, streamlining development and promoting consistency and code reuse throughout the codebase.&lt;/p&gt;

&lt;p&gt;You can find all the code in the &lt;a href="https://github.com/suryansh-yc/nx_monorepo" rel="noopener noreferrer"&gt;Github Repo&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Monorepos!! Nx vs Turborepo vs Lerna – Part 1: Turborepo</title>
      <dc:creator>Suryansh Sharma</dc:creator>
      <pubDate>Wed, 14 May 2025 16:11:42 +0000</pubDate>
      <link>https://dev.to/suryansh_yc/monorepos-nx-vs-turborepo-vs-lerna-part-1-turborepo-167f</link>
      <guid>https://dev.to/suryansh_yc/monorepos-nx-vs-turborepo-vs-lerna-part-1-turborepo-167f</guid>
      <description>&lt;p&gt;As a developer, choosing the right tooling is critical when adopting a monorepo structure especially when aiming for scalability, efficiency, and code sharing. I recently went through this decision making process at &lt;a href="https://github.com/YosemiteCrew/Yosemite-Crew" rel="noopener noreferrer"&gt;Yosemite Crew&lt;/a&gt;, where we are building an Open Source Operating System for Animal Health. &lt;/p&gt;

&lt;p&gt;This post is the first in a series where we'll walk through setting up a React website, an Express API, and a React Native app using three different monorepo tools. At the end of the series, we'll compare the pros and cons of each approach, and I’ll explain why Turborepo was ultimately the best fit for our use case.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started with the Monorepo
&lt;/h2&gt;

&lt;p&gt;We are going to use pnpm(follow the official documentation to install &lt;a href="https://pnpm.io/installation" rel="noopener noreferrer"&gt;pnpm&lt;/a&gt;) as our package manager and vercel's turborepo to handle the monorepo.&lt;br&gt;
To begin, we'll follow the official &lt;a href="https://turborepo.com/docs/getting-started/installation" rel="noopener noreferrer"&gt;Turborepo&lt;/a&gt; documentation. Start by creating your monorepo using pnpm and the Turborepo vite-react template.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pnpm dlx create-turbo@latest -e with-vite-react
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste the above command in any terminal and then it will prompt you two questions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Where would you like to create your Turborepo? react-node-native
Which package manager do you want to use? 
npm 
❯ pnpm 
  - yarn (not installed)
  - Bun (beta) (not installed)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enter the project name in the first prompt and select pnpm as the package manager in the second.&lt;/p&gt;

&lt;p&gt;After you answer the two setup questions, the installation process will begin. This may take a few minutes, depending on your internet speed.&lt;br&gt;
Once the setup is complete, open your code editor. You should see the boilerplate structure, which includes one app(web) and three packages(eslint-config, typescript-config, and ui).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxy3hnbh9o36bvndfenm5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxy3hnbh9o36bvndfenm5.png" alt="Folder structure of a with-vite-react Turporepo template" width="640" height="1104"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We can use the web app which comes with the template but i prefer building all my apps from scratch so we will delete the web and create one of our own.&lt;/p&gt;
&lt;h2&gt;
  
  
  Setting Up the React Web App
&lt;/h2&gt;

&lt;p&gt;We are going to use the &lt;a href="https://vite.dev/guide/" rel="noopener noreferrer"&gt;Vite Starter&lt;/a&gt; for this Web App.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pnpm create vite
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use any package name you want just remember to add &lt;strong&gt;/apps/&lt;/strong&gt; before it. Then select React and Typescript.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;◇  Project name:
│  /apps/website
│
◇  Select a framework:
│  React
│
◇  Select a variant:
│  TypeScript
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can check out the new React app in the apps folder. From the root folder run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pnpm install
pnpm dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will start the website and serve it on port 5173.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;website:dev:   VITE v6.3.5  ready in 1607 ms
website:dev: 
website:dev:   ➜  Local:   http://localhost:5173/
website:dev:   ➜  Network: use --host to expose
website:dev:   ➜  press h + enter to show help
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can see the Vite + React on your &lt;a href="https://localhost:5173" rel="noopener noreferrer"&gt;https://localhost:5173&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnz0fhhcdpcua1xsjwt73.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnz0fhhcdpcua1xsjwt73.png" alt="Vite + React Website Preview" width="800" height="797"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up the Node Backend
&lt;/h2&gt;

&lt;p&gt;Inside your monorepo root, run these commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir apps/api
cd apps/api
pnpm init
cd ../../
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install the express and nodemon package to build a basic backend.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pnpm add express --filter api
pnpm add nodemon -D --filter api
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a new file in the &lt;strong&gt;apps/api&lt;/strong&gt; folder named &lt;strong&gt;index.js&lt;/strong&gt; and paste the following code in it. This is a basic express server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import express from 'express';

const app = express();
const PORT = 3001;

app.get('/', (_req, res) =&amp;gt; {
  res.send('Hello from the API!');
});

app.listen(PORT, () =&amp;gt; {
  console.log(`API listening on port ${PORT}`);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now add scripts in the package.json file to run the project. The final &lt;strong&gt;package.json&lt;/strong&gt; file will look like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "name": "api",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "dev": "nodemon index.js",
    "test": "echo \"Error: no test specified\" &amp;amp;&amp;amp; exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "express": "^5.1.0"
  },
  "devDependencies": {
    "nodemon": "^3.1.10"
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now from the root folder run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pnpm dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will start both the react website and node api on ports 5173 and 3001 respectively.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;api:dev: 
api:dev: &amp;gt; api@1.0.0 dev /Users/suryansh/Projects/react-node-native/apps/api
api:dev: &amp;gt; nodemon index.js
api:dev: 
website:dev: 
website:dev: &amp;gt; website@0.0.0 dev /Users/suryansh/Projects/react-node-native/apps/website
website:dev: &amp;gt; vite
website:dev: 
api:dev: [nodemon] 3.1.10
api:dev: [nodemon] to restart at any time, enter `rs`
api:dev: [nodemon] watching path(s): *.*
api:dev: [nodemon] watching extensions: js,mjs,cjs,json
api:dev: [nodemon] starting `node index.js`
api:dev: (node:36402) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///Users/suryansh/Projects/react-node-native/apps/api/index.js is not specified and it doesn't parse as CommonJS.
api:dev: Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
api:dev: To eliminate this warning, add "type": "module" to /Users/suryansh/Projects/react-node-native/apps/api/package.json.
api:dev: (Use `node --trace-warnings ...` to show where the warning was created)
api:dev: API listening on port 3001
website:dev: 8:19:28 pm [vite] (client) Re-optimizing dependencies because lockfile has changed
website:dev: 
website:dev:   VITE v6.3.5  ready in 139 ms
website:dev: 
website:dev:   ➜  Local:   http://localhost:5173/
website:dev:   ➜  Network: use --host to expose
website:dev:   ➜  press h + enter to show help
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also run the api or website only using the filter flag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pnpm dev --filter api
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Setting Up the Bare React Native App
&lt;/h2&gt;

&lt;p&gt;For this section, we’re going with the standard &lt;a href="https://reactnative.dev/docs/getting-started-without-a-framework" rel="noopener noreferrer"&gt;React Native starter&lt;/a&gt;, without any framework integrations.&lt;br&gt;
Run the following command in the apps folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd apps
pnpm dlx @react-native-community/cli@latest init mobileApp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Choose y at the question to install CocoaPods now.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;✔ Downloading template
✔ Copying template
✔ Processing template
✔ Installing dependencies
✔ Do you want to install CocoaPods now? Needed for running iOS project … yes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The react native starter will then install all the required files and dependencies.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fygo4z8ypdcwofgy6pqn0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fygo4z8ypdcwofgy6pqn0.png" alt="React Native started folder structure" width="496" height="1026"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At this stage, all of our mobile app files are located in apps/mobileApp.&lt;br&gt;
However, there's a small issue: since we used &lt;strong&gt;@react-native-community/cli@latest&lt;/strong&gt; to initialize the project, it defaulted to using npm instead of pnpm. To fix this, we need to clean up a few files:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In &lt;strong&gt;apps/mobileApp&lt;/strong&gt;, delete the &lt;strong&gt;package-lock.json&lt;/strong&gt; file and the &lt;strong&gt;node_modules&lt;/strong&gt; folder.&lt;/li&gt;
&lt;li&gt;Then, navigate to &lt;strong&gt;apps/mobileApp/ios&lt;/strong&gt; and remove the &lt;strong&gt;Podfile.lock&lt;/strong&gt; file and the entire &lt;strong&gt;Pods&lt;/strong&gt; directory.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once everything has been cleared, you can reinstall the dependencies using pnpm in the root folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pnpm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then re-install the Pods&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd appd/mobileApp/ios
pod install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point, you have a fresh React Native mobile app set up with pnpm. To start the app, open two separate terminal windows and run the following from the &lt;strong&gt;/apps/mobileApp&lt;/strong&gt; folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pnpm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pnpm ios
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should install the app on the iOS simulator, but you'll likely see a blank screen along with an error message in the Metro server console:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2or1b5n40uuigl5iuvvr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2or1b5n40uuigl5iuvvr.png" alt="Module Not Found Error" width="708" height="1522"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This error occurs because we're using pnpm to manage our dependencies. Unlike npm, pnpm uses symlinks in its node_modules, which Metro doesn't support out of the box. As a result, Metro fails to resolve the modules correctly.&lt;br&gt;
To fix this, you need to enable symlink support in Metro. The solution depends on the version of React Native you're using.&lt;/p&gt;

&lt;p&gt;For &lt;strong&gt;React Native versions≥0.72&lt;/strong&gt;, update your &lt;strong&gt;metro.config.js&lt;/strong&gt; file to this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
const path = require('path');

/**
 * Metro configuration
 * &amp;lt;https://reactnative.dev/docs/metro&amp;gt;
 *
 * @type {import('metro-config').MetroConfig}
 */
const config = {
  resolver: {
    unstable_enableSymlinks: true, // this enable the use of Symlinks
  },
  // this specifies the folder where are located the node_modules for the project
  watchFolders: [path.join(__dirname, '..', '..')],
};
module.exports = mergeConfig(getDefaultConfig(__dirname), config);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For &lt;strong&gt;older React Native versions&lt;/strong&gt;, the Symlinks option does not exist on Metro itself. We will need some external packages to the rescue.&lt;br&gt;
Install the two packages &lt;strong&gt;@rnx-kit/metro-config&lt;/strong&gt; and &lt;strong&gt;@rnx-kit/metro-resolver-symlinks&lt;/strong&gt; and update your &lt;strong&gt;metro.config.js&lt;/strong&gt; file as follow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const path = require('path');
const {makeMetroConfig} = require('@rnx-kit/metro-config');
const MetroSymlinksResolver = require('@rnx-kit/metro-resolver-symlinks');

module.exports = makeMetroConfig({
  projectRoot: __dirname,
  resolver: MetroSymlinksResolver(),
  watchFolders: [path.join(__dirname, '..', '..')],
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After applying the necessary changes, close the app and restart the Metro server using the &lt;strong&gt;--reset-cache&lt;/strong&gt; flag. Then, reopen the app. You should now see the default React Native starter screen.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fybax38fhmy6p1p0ep5ih.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fybax38fhmy6p1p0ep5ih.png" alt="React Native Started Template Preview" width="708" height="1522"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Resolving Git Submodule Errors
&lt;/h3&gt;

&lt;p&gt;Now that the app is up and running, it's time to commit your changes.&lt;br&gt;
However, there's a small issue with the starter template—it initializes a Git repository inside the newly created apps/mobileApp folder. To get ride of that git submodule, from the root folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm -rf apps/mobileApp/.git
git add .
git commit -m "create mobileApp"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We now have a working mobile app located in the apps folder, fully integrated into the monorepo with a clean Git setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;With the initial setup complete, we now have a fully functional monorepo that brings together our React (web), React Native (mobile), and Node.js (API) applications. This structure enables us to share configurations, JavaScript utilities, and React hooks across platforms, greatly enhancing development efficiency and ensuring consistent code quality throughout the project.&lt;/p&gt;

&lt;p&gt;You can find all the code in the &lt;a href="https://github.com/suryansh-yc/react-node-native" rel="noopener noreferrer"&gt;Github Repo&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Optimizing Dev Collaboration: Monorepo or Multi-Repo?</title>
      <dc:creator>Suryansh Sharma</dc:creator>
      <pubDate>Thu, 24 Apr 2025 15:49:59 +0000</pubDate>
      <link>https://dev.to/suryansh_yc/optimizing-dev-collaboration-monorepo-or-multi-repo-47ik</link>
      <guid>https://dev.to/suryansh_yc/optimizing-dev-collaboration-monorepo-or-multi-repo-47ik</guid>
      <description>&lt;p&gt;Architectural decisions shape how teams scale. And one of the earliest and most debated is choosing between a monolith, monorepo, or multi-repo. I had to make the same decision as a Founding Engineer at &lt;a href="https://github.com/YosemiteCrew/Yosemite-Crew" rel="noopener noreferrer"&gt;Yosemite Crew&lt;/a&gt;. We are trying to build an Open Source Operating System for Animal Health where we are developing a PMS for vets and providing developers a plugin like feature to develop on top of our PMS.&lt;/p&gt;

&lt;p&gt;In this article, we’ll delve into the advantages and disadvantages of all the approaches, helping you make an informed decision to enhance collaboration within your dev teams.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is a monorepo?
&lt;/h1&gt;

&lt;p&gt;A monorepo consolidates &lt;strong&gt;multiple projects or components into a single repository&lt;/strong&gt;, promoting code reuse and simplifying dependency management while maintaining consistency across teams and services.&lt;/p&gt;

&lt;p&gt;A related concept is the &lt;strong&gt;monolithic application&lt;/strong&gt;. While a monolith bundles all functionality into a single, tightly integrated codebase, a monorepo can house multiple independent projects within the same repository. Major tech companies like &lt;strong&gt;Google, Meta, Microsoft, Uber, Airbnb, and Twitter&lt;/strong&gt; all use large-scale monorepos, each with its own strategies to handle massive codebases, high-frequency changes, and complex build and version control systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;A monorepo fosters collaboration by &lt;strong&gt;centralizing codebases&lt;/strong&gt;, making it easier for developers to access, review, and contribute to various components without the need to switch between multiple repositories. This creates a more unified and efficient team environment.&lt;/li&gt;
&lt;li&gt;In a monorepo, &lt;strong&gt;managing project dependencies is typically more straightforward&lt;/strong&gt;. Shared dependencies are centralized, reducing the likelihood of version conflicts and simplifying the process of updating libraries across the entire codebase.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monorepos promote consistent coding practices and encourage code reuse&lt;/strong&gt;. When similar functionality is needed across multiple projects, developers can implement it in a single location, reducing redundancy and ensuring consistency throughout the codebase.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Refactoring code across multiple projects is simpler in a monorepo&lt;/strong&gt;. Developers can make changes and immediately test their effects on different components, ensuring a smoother and more cohesive transition.&lt;/li&gt;
&lt;li&gt;With all related projects housed in one place, navigating a monorepo is more intuitive. This improves &lt;strong&gt;code discoverability, allowing developers to easily learn from each other’s work and fostering a culture of knowledge sharing.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Disadvantages
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;One of the key drawbacks of monorepos is performance. &lt;strong&gt;Storing code from different functions and contexts in a single repository can slow down operations like code pulls&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;When a repository contains multiple sub-projects, &lt;strong&gt;managing continuous integration (CI) and continuous delivery (CD) processes can become challenging&lt;/strong&gt;. It's also crucial to determine whether there are dedicated DevOps teams or individuals available to support this type of code management.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monorepos can also complicate security, as they grant developers who may only be working on a specific portion of the project full access to the entire codebase&lt;/strong&gt;. Ideally, there should be clear separation between the different projects within a monorepo, and each project should have its own versioning strategy in place from the start to streamline integration, team coordination, and maintenance.&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  What is a multi-repo?
&lt;/h1&gt;

&lt;p&gt;A multi-repo is a software development strategy where different projects or components of a larger application are &lt;strong&gt;stored and managed in separate repositories&lt;/strong&gt;. Each project or component has its own version control system, allowing teams to work independently on different parts of the system. This contrasts with a monorepo, where all the code resides in a single repository.&lt;/p&gt;

&lt;p&gt;Multi-repo setups are often preferred to establish clear boundaries between projects, enabling teams to work autonomously while minimizing the potential for conflicts when making changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Multi-repositories give teams full control over their own projects. &lt;strong&gt;Each team can define its own workflow, tooling, and release schedule, promoting a strong sense of ownership and accountability&lt;/strong&gt;. This isolation helps maintain the stability and reliability of critical applications.&lt;/li&gt;
&lt;li&gt;In a multi-repo setup, issues within one project are less likely to impact others, &lt;strong&gt;minimizing the risk of widespread outages across the system&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;As projects expand, &lt;strong&gt;multi-repos provide greater scalability&lt;/strong&gt;. Teams can manage their own repositories independently, reducing the likelihood that a single monolithic repository will become cumbersome and slow down development.&lt;/li&gt;
&lt;li&gt;With multiple repositories, &lt;strong&gt;teams can optimize their continuous integration and continuous delivery (CI/CD) pipelines&lt;/strong&gt;. Changes to one project only trigger build and deployment processes for the relevant components, improving efficiency.&lt;/li&gt;
&lt;li&gt;Developers can concentrate on their specific project's codebase, reducing cognitive load and minimizing distractions from unrelated changes. This focused approach can enhance code quality and accelerate development cycles.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Disadvantages
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Applying clean code practices and refactoring can be challenging in a multi-repo setup&lt;/strong&gt;. While there are initial workarounds to help standardize processes across teams, code duplication becomes a significant risk.&lt;/li&gt;
&lt;li&gt;Unit and integration tests are generally easy to manage in a multi-repo environment, but running &lt;strong&gt;end-to-end tests can be more complicated&lt;/strong&gt;. Since the codebase is split across multiple repositories, pulling in dependencies from different sources becomes necessary. Fortunately, this can be addressed by having dedicated Quality Assurance (QA) team members who focus on testing the complete application flow.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Managing dependencies can lead to friction between teams if there isn't a clear strategy for periodically updating and implementing the latest versions.&lt;/strong&gt;
4.&lt;strong&gt;Isolation between teams can hinder effective engineering practices and communication&lt;/strong&gt;. Without a strong onboarding culture, integrating new team members successfully can be difficult and disruptive.&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Ultimately, choosing between a monorepo and a multi-repo strategy comes down to finding the right balance between collaboration and autonomy&lt;/strong&gt;. Each approach offers distinct benefits and trade-offs, so it's important to consider your team's structure, project complexity, and long-term objectives.&lt;/p&gt;

&lt;p&gt;In my case we are building an open source project so it will be much easier for developers to contribute in a monorepo. Now the next question arises, what tool or build system should we use for a monorepo? NX, learn or turborepo. That's a discussion for another time.&lt;/p&gt;

&lt;p&gt;Take a look and star ⭐ our monorepo and of course contributions are always welcome. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/YosemiteCrew/Yosemite-Crew" rel="noopener noreferrer"&gt;Yosemite Crew Github&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
