<?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>Forem: fiker</title>
    <description>The latest articles on Forem by fiker (@fikertaddev).</description>
    <link>https://forem.com/fikertaddev</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%2F3813157%2F95ff5e01-7630-4b62-94e2-f47c4ddad2ca.jpg</url>
      <title>Forem: fiker</title>
      <link>https://forem.com/fikertaddev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/fikertaddev"/>
    <language>en</language>
    <item>
      <title># I Built a Scalable Monorepo Boilerplate for Multi-Product Apps (Next.js + NestJS + Turbo)</title>
      <dc:creator>fiker</dc:creator>
      <pubDate>Fri, 03 Apr 2026 06:36:53 +0000</pubDate>
      <link>https://forem.com/fikertaddev/-i-built-a-scalable-monorepo-boilerplate-for-multi-product-apps-nextjs-nestjs-turbo-3c72</link>
      <guid>https://forem.com/fikertaddev/-i-built-a-scalable-monorepo-boilerplate-for-multi-product-apps-nextjs-nestjs-turbo-3c72</guid>
      <description>&lt;p&gt;Most monorepo setups fall into one of two traps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;❌ Everything is duplicated per app → impossible to scale&lt;/li&gt;
&lt;li&gt;❌ Everything is centralized → turns into a “god app”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After hitting both problems, I built a boilerplate that actually scales cleanly across multiple products.&lt;/p&gt;




&lt;h1&gt;
  
  
  🧠 The Idea
&lt;/h1&gt;

&lt;p&gt;Instead of thinking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Each product is its own app”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I flipped it to:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Products are modules. Apps are just runtimes.”&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  🧱 The Architecture
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apps/
  web/        → Next.js runtime
  api/        → NestJS runtime

packages/
  core/       → auth, db, logging, http
  products/   → all business domains
  shared/     → types, utils, validation
  ui/         → design system
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  🔥 Key Concept
&lt;/h1&gt;

&lt;p&gt;Each product looks 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;packages/products/product-a/
  backend/
  frontend/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;backend/&lt;/code&gt; → NestJS modules&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;frontend/&lt;/code&gt; → UI + features&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No duplication. No separate repos. No messy coupling.&lt;/p&gt;




&lt;h1&gt;
  
  
  ⚙️ How It Works
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Backend (NestJS)
&lt;/h3&gt;

&lt;p&gt;Products plug into the API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ProductAModule&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@repo/products/product-a/backend&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Module&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;imports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;ProductAModule&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AppModule&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Frontend (Next.js)
&lt;/h3&gt;

&lt;p&gt;Products plug into the UI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ProductAFeature&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@repo/products/product-a/frontend&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  ⚡ Why This Is Better
&lt;/h1&gt;

&lt;h2&gt;
  
  
  1. No duplication
&lt;/h2&gt;

&lt;p&gt;Auth, DB, and config live in &lt;code&gt;core/&lt;/code&gt; once.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Real scalability
&lt;/h2&gt;

&lt;p&gt;Adding a new product = new folder, not a new app.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Clean boundaries
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;products = business logic&lt;/li&gt;
&lt;li&gt;core = infrastructure&lt;/li&gt;
&lt;li&gt;apps = runtime only&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. Works with Turbo
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;fast builds&lt;/li&gt;
&lt;li&gt;caching&lt;/li&gt;
&lt;li&gt;parallel dev&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🧠 What I Learned (the hard way)
&lt;/h1&gt;

&lt;h3&gt;
  
  
  1. NodeNext breaks &lt;a href="https://github.com/FikerTaddev/App-starter-boilerplate" rel="noopener noreferrer"&gt;monorepos&lt;/a&gt; if you’re not careful
&lt;/h3&gt;

&lt;p&gt;Use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"module"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"commonjs"&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"moduleResolution"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"node"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  2. Every module needs an entry point
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;backend&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ts&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Otherwise imports fail silently.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Path aliases must be correct
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"paths"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"@repo/products/*"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"packages/products/*"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No leading &lt;code&gt;/&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. Never mix core and product logic
&lt;/h3&gt;

&lt;p&gt;That’s how &lt;a href="https://github.com/FikerTaddev/App-starter-boilerplate" rel="noopener noreferrer"&gt;monorepos&lt;/a&gt; rot.&lt;/p&gt;




&lt;h1&gt;
  
  
  🚀 What You Can Build With This
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;SaaS platforms with multiple products&lt;/li&gt;
&lt;li&gt;internal tools ecosystems&lt;/li&gt;
&lt;li&gt;white-label systems&lt;/li&gt;
&lt;li&gt;modular startups (build fast, scale later)&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  📦 Example Use Case
&lt;/h1&gt;

&lt;p&gt;Instead of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;10 repos&lt;/li&gt;
&lt;li&gt;10 APIs&lt;/li&gt;
&lt;li&gt;10 frontends&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1 system&lt;/li&gt;
&lt;li&gt;shared infrastructure&lt;/li&gt;
&lt;li&gt;isolated products&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  ⚠️ What This Is NOT
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Not microservices&lt;/li&gt;
&lt;li&gt;Not a simple starter template&lt;/li&gt;
&lt;li&gt;Not beginner-friendly (and that’s fine)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is for when you actually care about scale and structure.&lt;/p&gt;




&lt;h1&gt;
  
  
  🧭 What’s Next
&lt;/h1&gt;

&lt;p&gt;I’m planning to add:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;automatic product generator CLI&lt;/li&gt;
&lt;li&gt;dynamic module loading (no manual imports)&lt;/li&gt;
&lt;li&gt;per-product database isolation&lt;/li&gt;
&lt;li&gt;CI/CD pipelines per domain&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  💭 Final Thought
&lt;/h1&gt;

&lt;p&gt;Most people scale by adding more apps.&lt;/p&gt;

&lt;p&gt;That’s the wrong move.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Scale by composing systems, not duplicating them.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;If you’re building something similar or thinking about &lt;a href="https://github.com/FikerTaddev/App-starter-boilerplate" rel="noopener noreferrer"&gt;monorepos&lt;/a&gt;, I’d like to hear how you’re structuring yours.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>javascript</category>
      <category>nextjs</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
