<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Dotnet on TECHFOR by Suriya Sonphu</title><link>http://suriyasonphu.com/en/tags/dotnet/</link><description>Recent content in Dotnet on TECHFOR by Suriya Sonphu</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Fri, 08 Aug 2025 00:00:00 +0000</lastBuildDate><atom:link href="http://suriyasonphu.com/en/tags/dotnet/index.xml" rel="self" type="application/rss+xml"/><item><title>Building Full Stack Web Applications: Vue.js + Tailwind CSS + ASP.NET Core 9 Minimal API with Modular Monolith Architecture</title><link>http://suriyasonphu.com/en/post/2025-08-08-fullstack-vue-tailwind-dotnet-modular-monolith/</link><pubDate>Fri, 08 Aug 2025 00:00:00 +0000</pubDate><guid>http://suriyasonphu.com/en/post/2025-08-08-fullstack-vue-tailwind-dotnet-modular-monolith/</guid><description>&lt;img src="http://suriyasonphu.com/post/2025-08-08-fullstack-vue-tailwind-dotnet-modular-monolith/fullstack-cover.svg" alt="Featured image of post Building Full Stack Web Applications: Vue.js + Tailwind CSS + ASP.NET Core 9 Minimal API with Modular Monolith Architecture" />&lt;h2 id="introduction-what-is-full-stack-development">Introduction: What is Full Stack Development?
&lt;/h2>&lt;p>&lt;strong>Full Stack Development&lt;/strong> refers to the development of both the frontend (client-side) and backend (server-side) portions of a web application. A full stack developer is someone who can work on both the user interface that users interact with and the server logic that powers the application behind the scenes.&lt;/p>
&lt;h3 id="key-components-of-full-stack-development">Key Components of Full Stack Development:
&lt;/h3>&lt;ul>
&lt;li>
&lt;p>&lt;strong>Frontend (Client-side)&lt;/strong>: What users see and interact with&lt;/p>
&lt;ul>
&lt;li>User Interface (UI)&lt;/li>
&lt;li>User Experience (UX)&lt;/li>
&lt;li>Client-side logic and interactions&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Backend (Server-side)&lt;/strong>: The engine that powers the application&lt;/p>
&lt;ul>
&lt;li>Server logic and APIs&lt;/li>
&lt;li>Database management&lt;/li>
&lt;li>Authentication and security&lt;/li>
&lt;li>Business logic&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Database&lt;/strong>: Where data is stored and managed&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>DevOps&lt;/strong>: Deployment and infrastructure management&lt;/p>
&lt;/li>
&lt;/ul>
&lt;p>In this tutorial, we&amp;rsquo;ll build a complete full stack application using modern technologies: &lt;strong>Vue.js&lt;/strong> for the frontend, &lt;strong>Tailwind CSS&lt;/strong> for styling, and &lt;strong>ASP.NET Core 9 Minimal API&lt;/strong> for the backend, all organized using &lt;strong>Modular Monolith&lt;/strong> architecture.&lt;/p>
&lt;h2 id="what-is-vuejs">What is Vue.js?
&lt;/h2>&lt;p>&lt;strong>Vue.js&lt;/strong> is a progressive JavaScript framework for building user interfaces and single-page applications (SPAs). Created by Evan You in 2014, Vue.js has become one of the most popular frontend frameworks alongside React and Angular.&lt;/p>
&lt;h3 id="key-features-of-vuejs">Key Features of Vue.js:
&lt;/h3>&lt;ol>
&lt;li>&lt;strong>Progressive Framework&lt;/strong>: You can adopt Vue.js incrementally - use it for just one part of your page or build entire applications&lt;/li>
&lt;li>&lt;strong>Reactive Data Binding&lt;/strong>: Automatic UI updates when data changes&lt;/li>
&lt;li>&lt;strong>Component-Based Architecture&lt;/strong>: Build encapsulated components that manage their own state&lt;/li>
&lt;li>&lt;strong>Virtual DOM&lt;/strong>: Efficient rendering for optimal performance&lt;/li>
&lt;li>&lt;strong>Easy Learning Curve&lt;/strong>: Simple syntax that&amp;rsquo;s easy for beginners to understand&lt;/li>
&lt;/ol>
&lt;h3 id="vuejs-advantages">Vue.js Advantages:
&lt;/h3>&lt;ul>
&lt;li>&lt;strong>Small bundle size&lt;/strong>: Fast loading times&lt;/li>
&lt;li>&lt;strong>Excellent documentation&lt;/strong>: Comprehensive and beginner-friendly&lt;/li>
&lt;li>&lt;strong>Great ecosystem&lt;/strong>: Rich set of tools and libraries&lt;/li>
&lt;li>&lt;strong>TypeScript support&lt;/strong>: Full TypeScript integration&lt;/li>
&lt;li>&lt;strong>Composition API&lt;/strong>: Modern way to organize component logic&lt;/li>
&lt;/ul>
&lt;h3 id="example-vuejs-component">Example Vue.js Component:
&lt;/h3>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-vue" data-lang="vue">&lt;span style="display:flex;">&lt;span>&amp;lt;&lt;span style="color:#f92672">template&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">div&lt;/span> &lt;span style="color:#a6e22e">class&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;user-profile&amp;#34;&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">h2&lt;/span>&amp;gt;{{ &lt;span style="color:#a6e22e">user&lt;/span>.&lt;span style="color:#a6e22e">name&lt;/span> }}&amp;lt;/&lt;span style="color:#f92672">h2&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">p&lt;/span>&amp;gt;{{ &lt;span style="color:#a6e22e">user&lt;/span>.&lt;span style="color:#a6e22e">email&lt;/span> }}&amp;lt;/&lt;span style="color:#f92672">p&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">button&lt;/span> &lt;span style="color:#f92672">@click&lt;/span>&lt;span style="color:#e6db74">=&amp;#34;updateProfile&amp;#34;&lt;/span>&amp;gt;&lt;span style="color:#a6e22e">Update&lt;/span> &lt;span style="color:#a6e22e">Profile&lt;/span>&amp;lt;/&lt;span style="color:#f92672">button&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;/&lt;span style="color:#f92672">div&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&amp;lt;/&lt;span style="color:#f92672">template&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&amp;lt;&lt;span style="color:#f92672">script&lt;/span> &lt;span style="color:#a6e22e">setup&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">import&lt;/span> { &lt;span style="color:#a6e22e">ref&lt;/span>, &lt;span style="color:#a6e22e">reactive&lt;/span> } &lt;span style="color:#a6e22e">from&lt;/span> &lt;span style="color:#e6db74">&amp;#39;vue&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">const&lt;/span> &lt;span style="color:#a6e22e">user&lt;/span> &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#a6e22e">reactive&lt;/span>({
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">name&lt;/span>&lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#e6db74">&amp;#39;John Doe&amp;#39;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">email&lt;/span>&lt;span style="color:#f92672">:&lt;/span> &lt;span style="color:#e6db74">&amp;#39;john@example.com&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>})
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">const&lt;/span> &lt;span style="color:#a6e22e">updateProfile&lt;/span> &lt;span style="color:#f92672">=&lt;/span> () =&amp;gt; {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// Update user profile logic
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#a6e22e">console&lt;/span>.&lt;span style="color:#a6e22e">log&lt;/span>(&lt;span style="color:#e6db74">&amp;#39;Profile updated!&amp;#39;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&amp;lt;/&lt;span style="color:#f92672">script&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Reference&lt;/strong>: &lt;a class="link" href="https://vuejs.org/" target="_blank" rel="noopener"
>Vue.js Official Documentation&lt;/a>&lt;/p>
&lt;h2 id="what-is-tailwind-css">What is Tailwind CSS?
&lt;/h2>&lt;p>&lt;strong>Tailwind CSS&lt;/strong> is a utility-first CSS framework that provides low-level utility classes to build custom designs directly in your markup. Instead of writing custom CSS, you compose designs by combining small, single-purpose utility classes.&lt;/p>
&lt;h3 id="key-features-of-tailwind-css">Key Features of Tailwind CSS:
&lt;/h3>&lt;ol>
&lt;li>&lt;strong>Utility-First&lt;/strong>: Pre-built classes for common CSS properties&lt;/li>
&lt;li>&lt;strong>Responsive Design&lt;/strong>: Built-in responsive design utilities&lt;/li>
&lt;li>&lt;strong>Customizable&lt;/strong>: Highly configurable design system&lt;/li>
&lt;li>&lt;strong>Performance&lt;/strong>: Remove unused CSS automatically&lt;/li>
&lt;li>&lt;strong>Developer Experience&lt;/strong>: Excellent IDE support and debugging tools&lt;/li>
&lt;/ol>
&lt;h3 id="tailwind-css-advantages">Tailwind CSS Advantages:
&lt;/h3>&lt;ul>
&lt;li>&lt;strong>Rapid Development&lt;/strong>: Build interfaces quickly without writing custom CSS&lt;/li>
&lt;li>&lt;strong>Consistent Design&lt;/strong>: Built-in design system ensures consistency&lt;/li>
&lt;li>&lt;strong>Mobile-First&lt;/strong>: Responsive design by default&lt;/li>
&lt;li>&lt;strong>Small Bundle Size&lt;/strong>: Only includes the CSS you actually use&lt;/li>
&lt;li>&lt;strong>No Context Switching&lt;/strong>: Style components without leaving your HTML&lt;/li>
&lt;/ul>
&lt;h3 id="example-tailwind-css-usage">Example Tailwind CSS Usage:
&lt;/h3>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-html" data-lang="html">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&amp;lt;!-- Traditional CSS approach --&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&amp;lt;&lt;span style="color:#f92672">div&lt;/span> &lt;span style="color:#a6e22e">class&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;card&amp;#34;&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">h2&lt;/span> &lt;span style="color:#a6e22e">class&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;card-title&amp;#34;&lt;/span>&amp;gt;Hello World&amp;lt;/&lt;span style="color:#f92672">h2&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">p&lt;/span> &lt;span style="color:#a6e22e">class&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;card-description&amp;#34;&lt;/span>&amp;gt;This is a description&amp;lt;/&lt;span style="color:#f92672">p&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">button&lt;/span> &lt;span style="color:#a6e22e">class&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;btn btn-primary&amp;#34;&lt;/span>&amp;gt;Click me&amp;lt;/&lt;span style="color:#f92672">button&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&amp;lt;/&lt;span style="color:#f92672">div&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&amp;lt;!-- Tailwind CSS approach --&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&amp;lt;&lt;span style="color:#f92672">div&lt;/span> &lt;span style="color:#a6e22e">class&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;bg-white p-6 rounded-lg shadow-md&amp;#34;&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">h2&lt;/span> &lt;span style="color:#a6e22e">class&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;text-2xl font-bold text-gray-900 mb-2&amp;#34;&lt;/span>&amp;gt;Hello World&amp;lt;/&lt;span style="color:#f92672">h2&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">p&lt;/span> &lt;span style="color:#a6e22e">class&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;text-gray-600 mb-4&amp;#34;&lt;/span>&amp;gt;This is a description&amp;lt;/&lt;span style="color:#f92672">p&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">button&lt;/span> &lt;span style="color:#a6e22e">class&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded&amp;#34;&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> Click me
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;/&lt;span style="color:#f92672">button&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&amp;lt;/&lt;span style="color:#f92672">div&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="common-tailwind-css-classes">Common Tailwind CSS Classes:
&lt;/h3>&lt;ul>
&lt;li>&lt;strong>Layout&lt;/strong>: &lt;code>flex&lt;/code>, &lt;code>grid&lt;/code>, &lt;code>container&lt;/code>, &lt;code>mx-auto&lt;/code>&lt;/li>
&lt;li>&lt;strong>Spacing&lt;/strong>: &lt;code>p-4&lt;/code> (padding), &lt;code>m-2&lt;/code> (margin), &lt;code>space-y-4&lt;/code>&lt;/li>
&lt;li>&lt;strong>Typography&lt;/strong>: &lt;code>text-xl&lt;/code>, &lt;code>font-bold&lt;/code>, &lt;code>text-center&lt;/code>&lt;/li>
&lt;li>&lt;strong>Colors&lt;/strong>: &lt;code>bg-blue-500&lt;/code>, &lt;code>text-red-600&lt;/code>, &lt;code>border-gray-300&lt;/code>&lt;/li>
&lt;li>&lt;strong>Responsive&lt;/strong>: &lt;code>sm:text-lg&lt;/code>, &lt;code>md:grid-cols-2&lt;/code>, &lt;code>lg:px-8&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Reference&lt;/strong>: &lt;a class="link" href="https://tailwindcss.com/" target="_blank" rel="noopener"
>Tailwind CSS Official Documentation&lt;/a>&lt;/p>
&lt;h2 id="what-is-aspnet-core-9-minimal-api">What is ASP.NET Core 9 Minimal API?
&lt;/h2>&lt;p>&lt;strong>ASP.NET Core Minimal API&lt;/strong> is a streamlined approach to building HTTP APIs with ASP.NET Core. Introduced in .NET 6 and enhanced in subsequent versions including .NET 9, Minimal APIs allow you to create APIs with minimal ceremony and boilerplate code.&lt;/p>
&lt;h3 id="key-features-of-minimal-api">Key Features of Minimal API:
&lt;/h3>&lt;ol>
&lt;li>&lt;strong>Reduced Boilerplate&lt;/strong>: Less code to write compared to traditional controllers&lt;/li>
&lt;li>&lt;strong>Performance&lt;/strong>: High performance with minimal overhead&lt;/li>
&lt;li>&lt;strong>Simple Syntax&lt;/strong>: Easy to understand and write&lt;/li>
&lt;li>&lt;strong>Built-in Features&lt;/strong>: Automatic model binding, validation, and OpenAPI support&lt;/li>
&lt;li>&lt;strong>Hosting&lt;/strong>: Integrated with ASP.NET Core hosting model&lt;/li>
&lt;/ol>
&lt;h3 id="minimal-api-advantages">Minimal API Advantages:
&lt;/h3>&lt;ul>
&lt;li>&lt;strong>Fast Development&lt;/strong>: Quickly create APIs with minimal setup&lt;/li>
&lt;li>&lt;strong>Microservices Friendly&lt;/strong>: Perfect for small, focused services&lt;/li>
&lt;li>&lt;strong>Cloud Native&lt;/strong>: Optimized for containerized environments&lt;/li>
&lt;li>&lt;strong>Modern C# Features&lt;/strong>: Leverages latest C# language features&lt;/li>
&lt;li>&lt;strong>Integration&lt;/strong>: Works seamlessly with other .NET libraries&lt;/li>
&lt;/ul>
&lt;h3 id="example-minimal-api">Example Minimal API:
&lt;/h3>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-csharp" data-lang="csharp">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">using&lt;/span> Microsoft.EntityFrameworkCore;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">var&lt;/span> builder = WebApplication.CreateBuilder(args);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// Add services to the container&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>builder.Services.AddDbContext&amp;lt;AppDbContext&amp;gt;(options =&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> options.UseSqlite(&lt;span style="color:#e6db74">&amp;#34;DataSource=app.db&amp;#34;&lt;/span>));
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>builder.Services.AddEndpointsApiExplorer();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>builder.Services.AddSwaggerGen();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">var&lt;/span> app = builder.Build();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// Configure the HTTP request pipeline&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">if&lt;/span> (app.Environment.IsDevelopment())
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> app.UseSwagger();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> app.UseSwaggerUI();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>app.UseHttpsRedirection();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// Define API endpoints&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>app.MapGet(&lt;span style="color:#e6db74">&amp;#34;/api/products&amp;#34;&lt;/span>, &lt;span style="color:#66d9ef">async&lt;/span> (AppDbContext db) =&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">await&lt;/span> db.Products.ToListAsync())
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> .WithName(&lt;span style="color:#e6db74">&amp;#34;GetProducts&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> .WithOpenApi();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>app.MapGet(&lt;span style="color:#e6db74">&amp;#34;/api/products/{id}&amp;#34;&lt;/span>, &lt;span style="color:#66d9ef">async&lt;/span> (&lt;span style="color:#66d9ef">int&lt;/span> id, AppDbContext db) =&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">await&lt;/span> db.Products.FindAsync(id) &lt;span style="color:#66d9ef">is&lt;/span> Product product
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ? Results.Ok(product)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> : Results.NotFound())
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> .WithName(&lt;span style="color:#e6db74">&amp;#34;GetProduct&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> .WithOpenApi();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>app.MapPost(&lt;span style="color:#e6db74">&amp;#34;/api/products&amp;#34;&lt;/span>, &lt;span style="color:#66d9ef">async&lt;/span> (Product product, AppDbContext db) =&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> db.Products.Add(product);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">await&lt;/span> db.SaveChangesAsync();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> Results.Created(&lt;span style="color:#e6db74">$&amp;#34;/api/products/{product.Id}&amp;#34;&lt;/span>, product);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>})
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>.WithName(&lt;span style="color:#e6db74">&amp;#34;CreateProduct&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>.WithOpenApi();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>app.Run();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// Models&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">public&lt;/span> &lt;span style="color:#66d9ef">class&lt;/span> &lt;span style="color:#a6e22e">Product&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">public&lt;/span> &lt;span style="color:#66d9ef">int&lt;/span> Id { &lt;span style="color:#66d9ef">get&lt;/span>; &lt;span style="color:#66d9ef">set&lt;/span>; }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">public&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span> Name { &lt;span style="color:#66d9ef">get&lt;/span>; &lt;span style="color:#66d9ef">set&lt;/span>; } = &lt;span style="color:#66d9ef">string&lt;/span>.Empty;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">public&lt;/span> &lt;span style="color:#66d9ef">decimal&lt;/span> Price { &lt;span style="color:#66d9ef">get&lt;/span>; &lt;span style="color:#66d9ef">set&lt;/span>; }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">public&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span> Description { &lt;span style="color:#66d9ef">get&lt;/span>; &lt;span style="color:#66d9ef">set&lt;/span>; } = &lt;span style="color:#66d9ef">string&lt;/span>.Empty;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">public&lt;/span> &lt;span style="color:#66d9ef">class&lt;/span> &lt;span style="color:#a6e22e">AppDbContext&lt;/span> : DbContext
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">public&lt;/span> AppDbContext(DbContextOptions&amp;lt;AppDbContext&amp;gt; options) : &lt;span style="color:#66d9ef">base&lt;/span>(options) { }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">public&lt;/span> DbSet&amp;lt;Product&amp;gt; Products { &lt;span style="color:#66d9ef">get&lt;/span>; &lt;span style="color:#66d9ef">set&lt;/span>; }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Reference&lt;/strong>: &lt;a class="link" href="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis" target="_blank" rel="noopener"
>ASP.NET Core Minimal APIs Documentation&lt;/a>&lt;/p>
&lt;h2 id="example-project-e-commerce-product-catalog">Example Project: E-commerce Product Catalog
&lt;/h2>&lt;p>Let&amp;rsquo;s build a simple e-commerce product catalog that demonstrates how all these technologies work together in a modular monolith architecture.&lt;/p>
&lt;h3 id="project-structure">Project Structure:
&lt;/h3>&lt;pre tabindex="0">&lt;code>ECommerceApp/
├── frontend/ # Vue.js + Tailwind CSS
│ ├── src/
│ │ ├── components/
│ │ ├── views/
│ │ ├── services/
│ │ └── main.js
│ ├── index.html
│ └── package.json
├── backend/ # ASP.NET Core 9 Minimal API
│ ├── Modules/
│ │ ├── Products/
│ │ ├── Orders/
│ │ └── Users/
│ ├── Shared/
│ │ ├── Database/
│ │ └── Infrastructure/
│ ├── Program.cs
│ └── ECommerceApp.csproj
└── README.md
&lt;/code>&lt;/pre>&lt;h3 id="frontend-implementation-vuejs--tailwind">Frontend Implementation (Vue.js + Tailwind):
&lt;/h3>&lt;p>&lt;strong>ProductList.vue:&lt;/strong>&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-vue" data-lang="vue">&lt;span style="display:flex;">&lt;span>&amp;lt;&lt;span style="color:#f92672">template&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">div&lt;/span> &lt;span style="color:#a6e22e">class&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;container mx-auto px-4 py-8&amp;#34;&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">h1&lt;/span> &lt;span style="color:#a6e22e">class&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;text-3xl font-bold text-gray-900 mb-8&amp;#34;&lt;/span>&amp;gt;&lt;span style="color:#a6e22e">Product&lt;/span> &lt;span style="color:#a6e22e">Catalog&lt;/span>&amp;lt;/&lt;span style="color:#f92672">h1&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">div&lt;/span> &lt;span style="color:#a6e22e">class&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6&amp;#34;&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">div&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">v-for&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;product in products&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">:key&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;product.id&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">class&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">div&lt;/span> &lt;span style="color:#a6e22e">class&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;p-6&amp;#34;&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">h3&lt;/span> &lt;span style="color:#a6e22e">class&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;text-xl font-semibold text-gray-900 mb-2&amp;#34;&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {{ &lt;span style="color:#a6e22e">product&lt;/span>.&lt;span style="color:#a6e22e">name&lt;/span> }}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;/&lt;span style="color:#f92672">h3&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">p&lt;/span> &lt;span style="color:#a6e22e">class&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;text-gray-600 mb-4&amp;#34;&lt;/span>&amp;gt;{{ &lt;span style="color:#a6e22e">product&lt;/span>.&lt;span style="color:#a6e22e">description&lt;/span> }}&amp;lt;/&lt;span style="color:#f92672">p&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">div&lt;/span> &lt;span style="color:#a6e22e">class&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;flex justify-between items-center&amp;#34;&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">span&lt;/span> &lt;span style="color:#a6e22e">class&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;text-2xl font-bold text-blue-600&amp;#34;&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">$&lt;/span>{{ &lt;span style="color:#a6e22e">product&lt;/span>.&lt;span style="color:#a6e22e">price&lt;/span> }}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;/&lt;span style="color:#f92672">span&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;&lt;span style="color:#f92672">button&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">@click&lt;/span>&lt;span style="color:#e6db74">=&amp;#34;addToCart(product)&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">class&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">Add&lt;/span> &lt;span style="color:#a6e22e">to&lt;/span> &lt;span style="color:#a6e22e">Cart&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;/&lt;span style="color:#f92672">button&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;/&lt;span style="color:#f92672">div&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;/&lt;span style="color:#f92672">div&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;/&lt;span style="color:#f92672">div&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;/&lt;span style="color:#f92672">div&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &amp;lt;/&lt;span style="color:#f92672">div&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&amp;lt;/&lt;span style="color:#f92672">template&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&amp;lt;&lt;span style="color:#f92672">script&lt;/span> &lt;span style="color:#a6e22e">setup&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">import&lt;/span> { &lt;span style="color:#a6e22e">ref&lt;/span>, &lt;span style="color:#a6e22e">onMounted&lt;/span> } &lt;span style="color:#a6e22e">from&lt;/span> &lt;span style="color:#e6db74">&amp;#39;vue&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">import&lt;/span> { &lt;span style="color:#a6e22e">productService&lt;/span> } &lt;span style="color:#a6e22e">from&lt;/span> &lt;span style="color:#e6db74">&amp;#39;../services/productService&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">const&lt;/span> &lt;span style="color:#a6e22e">products&lt;/span> &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#a6e22e">ref&lt;/span>([])
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">const&lt;/span> &lt;span style="color:#a6e22e">fetchProducts&lt;/span> &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#a6e22e">async&lt;/span> () =&amp;gt; {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">try&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">const&lt;/span> &lt;span style="color:#a6e22e">response&lt;/span> &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#a6e22e">await&lt;/span> &lt;span style="color:#a6e22e">productService&lt;/span>.&lt;span style="color:#a6e22e">getAll&lt;/span>()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">products&lt;/span>.&lt;span style="color:#a6e22e">value&lt;/span> &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#a6e22e">response&lt;/span>.&lt;span style="color:#a6e22e">data&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> } &lt;span style="color:#66d9ef">catch&lt;/span> (&lt;span style="color:#a6e22e">error&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">console&lt;/span>.&lt;span style="color:#a6e22e">error&lt;/span>(&lt;span style="color:#e6db74">&amp;#39;Error fetching products:&amp;#39;&lt;/span>, &lt;span style="color:#a6e22e">error&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">const&lt;/span> &lt;span style="color:#a6e22e">addToCart&lt;/span> &lt;span style="color:#f92672">=&lt;/span> (&lt;span style="color:#a6e22e">product&lt;/span>) =&amp;gt; {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// Add to cart logic
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span> &lt;span style="color:#a6e22e">console&lt;/span>.&lt;span style="color:#a6e22e">log&lt;/span>(&lt;span style="color:#e6db74">&amp;#39;Added to cart:&amp;#39;&lt;/span>, &lt;span style="color:#a6e22e">product&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">onMounted&lt;/span>(() =&amp;gt; {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">fetchProducts&lt;/span>()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>})
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&amp;lt;/&lt;span style="color:#f92672">script&lt;/span>&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Product Service:&lt;/strong>&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-javascript" data-lang="javascript">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// services/productService.js
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>&lt;span style="color:#66d9ef">import&lt;/span> &lt;span style="color:#a6e22e">axios&lt;/span> &lt;span style="color:#a6e22e">from&lt;/span> &lt;span style="color:#e6db74">&amp;#39;axios&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">const&lt;/span> &lt;span style="color:#a6e22e">API_BASE_URL&lt;/span> &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#39;https://localhost:7070/api&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">export&lt;/span> &lt;span style="color:#66d9ef">const&lt;/span> &lt;span style="color:#a6e22e">productService&lt;/span> &lt;span style="color:#f92672">=&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">async&lt;/span> &lt;span style="color:#a6e22e">getAll&lt;/span>() {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#66d9ef">await&lt;/span> &lt;span style="color:#a6e22e">axios&lt;/span>.&lt;span style="color:#a6e22e">get&lt;/span>(&lt;span style="color:#e6db74">`&lt;/span>&lt;span style="color:#e6db74">${&lt;/span>&lt;span style="color:#a6e22e">API_BASE_URL&lt;/span>&lt;span style="color:#e6db74">}&lt;/span>&lt;span style="color:#e6db74">/products`&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> },
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">async&lt;/span> &lt;span style="color:#a6e22e">getById&lt;/span>(&lt;span style="color:#a6e22e">id&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#66d9ef">await&lt;/span> &lt;span style="color:#a6e22e">axios&lt;/span>.&lt;span style="color:#a6e22e">get&lt;/span>(&lt;span style="color:#e6db74">`&lt;/span>&lt;span style="color:#e6db74">${&lt;/span>&lt;span style="color:#a6e22e">API_BASE_URL&lt;/span>&lt;span style="color:#e6db74">}&lt;/span>&lt;span style="color:#e6db74">/products/&lt;/span>&lt;span style="color:#e6db74">${&lt;/span>&lt;span style="color:#a6e22e">id&lt;/span>&lt;span style="color:#e6db74">}&lt;/span>&lt;span style="color:#e6db74">`&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> },
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">async&lt;/span> &lt;span style="color:#a6e22e">create&lt;/span>(&lt;span style="color:#a6e22e">product&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#66d9ef">await&lt;/span> &lt;span style="color:#a6e22e">axios&lt;/span>.&lt;span style="color:#a6e22e">post&lt;/span>(&lt;span style="color:#e6db74">`&lt;/span>&lt;span style="color:#e6db74">${&lt;/span>&lt;span style="color:#a6e22e">API_BASE_URL&lt;/span>&lt;span style="color:#e6db74">}&lt;/span>&lt;span style="color:#e6db74">/products`&lt;/span>, &lt;span style="color:#a6e22e">product&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="backend-implementation-aspnet-core-9-minimal-api">Backend Implementation (ASP.NET Core 9 Minimal API):
&lt;/h3>&lt;p>&lt;strong>Program.cs:&lt;/strong>&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-csharp" data-lang="csharp">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">using&lt;/span> Microsoft.EntityFrameworkCore;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">using&lt;/span> ECommerceApp.Modules.Products;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">using&lt;/span> ECommerceApp.Modules.Orders;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">using&lt;/span> ECommerceApp.Shared.Database;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">var&lt;/span> builder = WebApplication.CreateBuilder(args);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// Add services to the container&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>builder.Services.AddDbContext&amp;lt;AppDbContext&amp;gt;(options =&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> options.UseSqlite(builder.Configuration.GetConnectionString(&lt;span style="color:#e6db74">&amp;#34;DefaultConnection&amp;#34;&lt;/span>)));
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// Add CORS&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>builder.Services.AddCors(options =&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> options.AddPolicy(&lt;span style="color:#e6db74">&amp;#34;AllowFrontend&amp;#34;&lt;/span>, policy =&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> policy.WithOrigins(&lt;span style="color:#e6db74">&amp;#34;http://localhost:3000&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> .AllowAnyHeader()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> .AllowAnyMethod();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> });
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>});
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>builder.Services.AddEndpointsApiExplorer();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>builder.Services.AddSwaggerGen();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// Register module services&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>builder.Services.AddProductModule();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>builder.Services.AddOrderModule();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">var&lt;/span> app = builder.Build();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// Configure the HTTP request pipeline&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">if&lt;/span> (app.Environment.IsDevelopment())
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> app.UseSwagger();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> app.UseSwaggerUI();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>app.UseHttpsRedirection();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>app.UseCors(&lt;span style="color:#e6db74">&amp;#34;AllowFrontend&amp;#34;&lt;/span>);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// Map module endpoints&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>app.MapProductEndpoints();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>app.MapOrderEndpoints();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>app.Run();
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Product Module:&lt;/strong>&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-csharp" data-lang="csharp">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// Modules/Products/ProductModule.cs&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">using&lt;/span> Microsoft.EntityFrameworkCore;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">using&lt;/span> ECommerceApp.Shared.Database;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">namespace&lt;/span> ECommerceApp.Modules.Products;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">public&lt;/span> &lt;span style="color:#66d9ef">static&lt;/span> &lt;span style="color:#66d9ef">class&lt;/span> &lt;span style="color:#a6e22e">ProductModule&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">public&lt;/span> &lt;span style="color:#66d9ef">static&lt;/span> IServiceCollection AddProductModule(&lt;span style="color:#66d9ef">this&lt;/span> IServiceCollection services)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> services.AddScoped&amp;lt;IProductService, ProductService&amp;gt;();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> services;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">public&lt;/span> &lt;span style="color:#66d9ef">static&lt;/span> WebApplication MapProductEndpoints(&lt;span style="color:#66d9ef">this&lt;/span> WebApplication app)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">var&lt;/span> &lt;span style="color:#66d9ef">group&lt;/span> = app.MapGroup(&lt;span style="color:#e6db74">&amp;#34;/api/products&amp;#34;&lt;/span>).WithTags(&lt;span style="color:#e6db74">&amp;#34;Products&amp;#34;&lt;/span>);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">group&lt;/span>.MapGet(&lt;span style="color:#e6db74">&amp;#34;/&amp;#34;&lt;/span>, GetProducts);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">group&lt;/span>.MapGet(&lt;span style="color:#e6db74">&amp;#34;/{id}&amp;#34;&lt;/span>, GetProduct);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">group&lt;/span>.MapPost(&lt;span style="color:#e6db74">&amp;#34;/&amp;#34;&lt;/span>, CreateProduct);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">group&lt;/span>.MapPut(&lt;span style="color:#e6db74">&amp;#34;/{id}&amp;#34;&lt;/span>, UpdateProduct);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">group&lt;/span>.MapDelete(&lt;span style="color:#e6db74">&amp;#34;/{id}&amp;#34;&lt;/span>, DeleteProduct);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> app;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">private&lt;/span> &lt;span style="color:#66d9ef">static&lt;/span> &lt;span style="color:#66d9ef">async&lt;/span> Task&amp;lt;IResult&amp;gt; GetProducts(IProductService productService)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">var&lt;/span> products = &lt;span style="color:#66d9ef">await&lt;/span> productService.GetAllAsync();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> Results.Ok(products);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">private&lt;/span> &lt;span style="color:#66d9ef">static&lt;/span> &lt;span style="color:#66d9ef">async&lt;/span> Task&amp;lt;IResult&amp;gt; GetProduct(&lt;span style="color:#66d9ef">int&lt;/span> id, IProductService productService)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">var&lt;/span> product = &lt;span style="color:#66d9ef">await&lt;/span> productService.GetByIdAsync(id);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> product != &lt;span style="color:#66d9ef">null&lt;/span> ? Results.Ok(product) : Results.NotFound();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">private&lt;/span> &lt;span style="color:#66d9ef">static&lt;/span> &lt;span style="color:#66d9ef">async&lt;/span> Task&amp;lt;IResult&amp;gt; CreateProduct(Product product, IProductService productService)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">var&lt;/span> createdProduct = &lt;span style="color:#66d9ef">await&lt;/span> productService.CreateAsync(product);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> Results.Created(&lt;span style="color:#e6db74">$&amp;#34;/api/products/{createdProduct.Id}&amp;#34;&lt;/span>, createdProduct);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">private&lt;/span> &lt;span style="color:#66d9ef">static&lt;/span> &lt;span style="color:#66d9ef">async&lt;/span> Task&amp;lt;IResult&amp;gt; UpdateProduct(&lt;span style="color:#66d9ef">int&lt;/span> id, Product product, IProductService productService)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> (id != product.Id) &lt;span style="color:#66d9ef">return&lt;/span> Results.BadRequest();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">var&lt;/span> updatedProduct = &lt;span style="color:#66d9ef">await&lt;/span> productService.UpdateAsync(product);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> updatedProduct != &lt;span style="color:#66d9ef">null&lt;/span> ? Results.Ok(updatedProduct) : Results.NotFound();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">private&lt;/span> &lt;span style="color:#66d9ef">static&lt;/span> &lt;span style="color:#66d9ef">async&lt;/span> Task&amp;lt;IResult&amp;gt; DeleteProduct(&lt;span style="color:#66d9ef">int&lt;/span> id, IProductService productService)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">var&lt;/span> success = &lt;span style="color:#66d9ef">await&lt;/span> productService.DeleteAsync(id);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> success ? Results.NoContent() : Results.NotFound();
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="why-is-modular-monolith-important">Why is Modular Monolith Important?
&lt;/h2>&lt;p>&lt;strong>Modular Monolith&lt;/strong> combines the benefits of both monolithic and microservices architectures, making it an excellent choice for many applications, especially when starting a new project.&lt;/p>
&lt;h3 id="benefits-of-modular-monolith">Benefits of Modular Monolith:
&lt;/h3>&lt;ol>
&lt;li>&lt;strong>Simplicity&lt;/strong>: Single deployment unit, easier to develop and debug&lt;/li>
&lt;li>&lt;strong>Performance&lt;/strong>: No network latency between modules&lt;/li>
&lt;li>&lt;strong>Consistency&lt;/strong>: Single database transactions across modules&lt;/li>
&lt;li>&lt;strong>Development Speed&lt;/strong>: Faster development with shared code and libraries&lt;/li>
&lt;li>&lt;strong>Easy Refactoring&lt;/strong>: Can be split into microservices later if needed&lt;/li>
&lt;/ol>
&lt;h3 id="key-principles">Key Principles:
&lt;/h3>&lt;ol>
&lt;li>&lt;strong>Clear Module Boundaries&lt;/strong>: Each module has well-defined responsibilities&lt;/li>
&lt;li>&lt;strong>Loose Coupling&lt;/strong>: Modules communicate through well-defined interfaces&lt;/li>
&lt;li>&lt;strong>High Cohesion&lt;/strong>: Related functionality stays together within a module&lt;/li>
&lt;li>&lt;strong>Shared Infrastructure&lt;/strong>: Common concerns like logging, configuration, database&lt;/li>
&lt;/ol>
&lt;h3 id="when-to-use-modular-monolith">When to Use Modular Monolith:
&lt;/h3>&lt;ul>
&lt;li>&lt;strong>Starting a new project&lt;/strong>: Begin with monolith, split later if needed&lt;/li>
&lt;li>&lt;strong>Small to medium teams&lt;/strong>: Easier coordination and development&lt;/li>
&lt;li>&lt;strong>Uncertain domain boundaries&lt;/strong>: Learn the domain before splitting&lt;/li>
&lt;li>&lt;strong>Performance requirements&lt;/strong>: Lower latency than distributed systems&lt;/li>
&lt;li>&lt;strong>Consistency requirements&lt;/strong>: Need ACID transactions across modules&lt;/li>
&lt;/ul>
&lt;h3 id="example-module-structure">Example Module Structure:
&lt;/h3>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-csharp" data-lang="csharp">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// Modules/Products/&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">├──&lt;/span> ProductModule.cs &lt;span style="color:#960050;background-color:#1e0010">#&lt;/span> Module configuration and endpoints
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">├──&lt;/span> Models/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">│&lt;/span> &lt;span style="color:#960050;background-color:#1e0010">├──&lt;/span> Product.cs &lt;span style="color:#960050;background-color:#1e0010">#&lt;/span> Product entity
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">│&lt;/span> &lt;span style="color:#960050;background-color:#1e0010">└──&lt;/span> ProductDto.cs &lt;span style="color:#960050;background-color:#1e0010">#&lt;/span> Data transfer objects
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">├──&lt;/span> Services/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">│&lt;/span> &lt;span style="color:#960050;background-color:#1e0010">├──&lt;/span> IProductService.cs &lt;span style="color:#960050;background-color:#1e0010">#&lt;/span> Service &lt;span style="color:#66d9ef">interface&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">│&lt;/span> &lt;span style="color:#960050;background-color:#1e0010">└──&lt;/span> ProductService.cs &lt;span style="color:#960050;background-color:#1e0010">#&lt;/span> Service implementation
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">└──&lt;/span> Data/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#960050;background-color:#1e0010">└──&lt;/span> ProductRepository.cs &lt;span style="color:#960050;background-color:#1e0010">#&lt;/span> Data access layer
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// Modules/Orders/&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">├──&lt;/span> OrderModule.cs
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">├──&lt;/span> Models/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">├──&lt;/span> Services/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">└──&lt;/span> Data/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// Shared/&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">├──&lt;/span> Database/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">│&lt;/span> &lt;span style="color:#960050;background-color:#1e0010">└──&lt;/span> AppDbContext.cs &lt;span style="color:#960050;background-color:#1e0010">#&lt;/span> Shared database context
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">├──&lt;/span> Infrastructure/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">│&lt;/span> &lt;span style="color:#960050;background-color:#1e0010">├──&lt;/span> Logging/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">│&lt;/span> &lt;span style="color:#960050;background-color:#1e0010">└──&lt;/span> Configuration/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">└──&lt;/span> Common/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#960050;background-color:#1e0010">└──&lt;/span> BaseEntity.cs &lt;span style="color:#960050;background-color:#1e0010">#&lt;/span> Shared &lt;span style="color:#66d9ef">base&lt;/span> classes
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="migration-path-to-microservices">Migration Path to Microservices:
&lt;/h3>&lt;p>If your application grows and you need to split into microservices, the modular structure makes this transition easier:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Identify Module Boundaries&lt;/strong>: Modules become service boundaries&lt;/li>
&lt;li>&lt;strong>Extract Database&lt;/strong>: Give each service its own database&lt;/li>
&lt;li>&lt;strong>Add Communication Layer&lt;/strong>: Replace direct calls with HTTP/messaging&lt;/li>
&lt;li>&lt;strong>Deploy Independently&lt;/strong>: Each service gets its own deployment pipeline&lt;/li>
&lt;/ol>
&lt;h2 id="conclusion">Conclusion
&lt;/h2>&lt;p>Building full stack applications with &lt;strong>Vue.js&lt;/strong>, &lt;strong>Tailwind CSS&lt;/strong>, and &lt;strong>ASP.NET Core 9 Minimal API&lt;/strong> using &lt;strong>Modular Monolith&lt;/strong> architecture provides:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Modern Development Experience&lt;/strong>: Latest technologies and best practices&lt;/li>
&lt;li>&lt;strong>Rapid Development&lt;/strong>: Quick iteration and deployment&lt;/li>
&lt;li>&lt;strong>Scalable Architecture&lt;/strong>: Can grow from monolith to microservices&lt;/li>
&lt;li>&lt;strong>Great Developer Experience&lt;/strong>: Excellent tooling and documentation&lt;/li>
&lt;li>&lt;strong>Performance&lt;/strong>: Fast and efficient applications&lt;/li>
&lt;/ul>
&lt;p>This approach is perfect for beginners starting their coding journey because it provides:&lt;/p>
&lt;ul>
&lt;li>Clear separation of concerns&lt;/li>
&lt;li>Modern development practices&lt;/li>
&lt;li>Scalable architecture&lt;/li>
&lt;li>Excellent learning resources&lt;/li>
&lt;/ul>
&lt;p>Start with this stack, learn the fundamentals, and gradually expand your knowledge as your applications grow in complexity.&lt;/p>
&lt;h2 id="references">References
&lt;/h2>&lt;ul>
&lt;li>&lt;a class="link" href="https://vuejs.org/" target="_blank" rel="noopener"
>Vue.js Official Documentation&lt;/a>&lt;/li>
&lt;li>&lt;a class="link" href="https://tailwindcss.com/" target="_blank" rel="noopener"
>Tailwind CSS Documentation&lt;/a>&lt;/li>
&lt;li>&lt;a class="link" href="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis" target="_blank" rel="noopener"
>ASP.NET Core Minimal APIs&lt;/a>&lt;/li>
&lt;li>&lt;a class="link" href="https://docs.microsoft.com/en-us/dotnet/" target="_blank" rel="noopener"
>.NET 9 Documentation&lt;/a>&lt;/li>
&lt;li>&lt;a class="link" href="https://www.milanjovanovic.tech/blog/modular-monolith-architecture" target="_blank" rel="noopener"
>Modular Monolith Architecture&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Modular Monolith: Architecture that combines the benefits of Monolith and Microservices</title><link>http://suriyasonphu.com/en/post/2025-07-27-modular-monolith-architecture/</link><pubDate>Sun, 27 Jul 2025 00:00:00 +0000</pubDate><guid>http://suriyasonphu.com/en/post/2025-07-27-modular-monolith-architecture/</guid><description>&lt;img src="http://suriyasonphu.com/post/2025-07-27-modular-monolith-architecture/modular-monolith-cover.png" alt="Featured image of post Modular Monolith: Architecture that combines the benefits of Monolith and Microservices" />&lt;h2 id="what-is-modular-monolith-and-why-its-an-interesting-alternative">What is Modular Monolith and Why It&amp;rsquo;s an Interesting Alternative
&lt;/h2>&lt;p>Modular Monolith is a software architecture that combines the benefits of &lt;strong>Monolith&lt;/strong> and &lt;strong>Microservices&lt;/strong> by organizing code into modules with clear bounded contexts while maintaining single deployment unit.&lt;/p>
&lt;h3 id="problems-with-traditional-monolith">Problems with Traditional Monolith
&lt;/h3>&lt;p>&lt;strong>Traditional Monolith&lt;/strong> often suffers from:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Tightly Coupled Code&lt;/strong>: All parts are tightly bound, making changes difficult&lt;/li>
&lt;li>&lt;strong>Single Point of Failure&lt;/strong>: If one part fails, the entire system fails&lt;/li>
&lt;li>&lt;strong>Technology Lock-in&lt;/strong>: Must use the same technology stack throughout&lt;/li>
&lt;li>&lt;strong>Difficult to Scale&lt;/strong>: Cannot scale specific parts independently&lt;/li>
&lt;/ul>
&lt;h3 id="problems-with-microservices">Problems with Microservices
&lt;/h3>&lt;p>While &lt;strong>Microservices&lt;/strong> solve many monolith problems, they introduce additional complexity:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Distributed System Complexity&lt;/strong>: Complexity of distributed systems&lt;/li>
&lt;li>&lt;strong>Network Latency&lt;/strong>: Delays from network communication&lt;/li>
&lt;li>&lt;strong>Data Consistency&lt;/strong>: Data consistency challenges&lt;/li>
&lt;li>&lt;strong>Operational Overhead&lt;/strong>: Requires strong DevOps teams&lt;/li>
&lt;li>&lt;strong>Development Complexity&lt;/strong>: Complexity in development and debugging&lt;/li>
&lt;/ul>
&lt;h3 id="modular-monolith-a-balanced-solution">Modular Monolith: A Balanced Solution
&lt;/h3>&lt;p>Modular Monolith offers a balanced approach:&lt;/p>
&lt;p>&lt;strong>✅ Benefits:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Modularity&lt;/strong>: Clear module separation by business domain&lt;/li>
&lt;li>&lt;strong>Loose Coupling&lt;/strong>: Modules communicate through defined interfaces&lt;/li>
&lt;li>&lt;strong>Single Deployment&lt;/strong>: Easy to deploy and maintain&lt;/li>
&lt;li>&lt;strong>Easier Testing&lt;/strong>: Easier to test than distributed systems&lt;/li>
&lt;li>&lt;strong>Gradual Migration&lt;/strong>: Can be extracted to microservices in the future&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>⚠️ Considerations:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Technology Constraint&lt;/strong>: Still limited by primary technology&lt;/li>
&lt;li>&lt;strong>Shared Database&lt;/strong>: May have data coupling issues&lt;/li>
&lt;li>&lt;strong>Resource Scaling&lt;/strong>: Cannot scale individual modules separately&lt;/li>
&lt;/ul>
&lt;h2 id="architecture-of-modular-monolith-e-commerce-application">Architecture of Modular Monolith E-commerce Application
&lt;/h2>&lt;p>I created a &lt;a class="link" href="https://github.com/suriyasonp/modular-monolith-ecommerce" target="_blank" rel="noopener"
>Modular Monolith E-commerce Application&lt;/a> using C# and ASP.NET Core to demonstrate the application of these principles in real system development.&lt;/p>
&lt;h3 id="-architecture-overview">🏗️ Architecture Overview
&lt;/h3>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>ECommerceApp/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>├── src/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ ├── ECommerceApp/ # Main Web API Application
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ ├── Controllers/ # API Controllers
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ ├── Program.cs # Application entry point
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ └── ECommerceApp.csproj
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ ├── ECommerceApp.Shared/ # Shared Kernel
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ ├── Events/ # Domain Events
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ ├── Kernel/ # Base entities, interfaces
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ └── ECommerceApp.Shared.csproj
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ └── Modules/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ ├── Orders/ # Orders Module
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ ├── Application/ # Use cases, commands, queries
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ ├── Domain/ # Domain entities, events
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ ├── Infrastructure/ # Data access, repositories
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ ├── OrdersModule.cs # Module registration
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ └── ECommerceApp.Modules.Orders.csproj
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ ├── Products/ # Products Module
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ ├── Application/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ ├── Domain/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ ├── Infrastructure/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ ├── ProductsModule.cs
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ │ └── ECommerceApp.Modules.Products.csproj
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ └── Customers/ # Customers Module
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ ├── Domain/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ ├── Infrastructure/
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ ├── CustomersModule.cs
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>│ └── ECommerceApp.Modules.Customers.csproj
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="-key-principles-of-modular-monolith">🎯 Key Principles of Modular Monolith
&lt;/h3>&lt;p>&lt;strong>1. Modules&lt;/strong>
Each module represents a distinct business capability such as Orders, Products, Customers&lt;/p>
&lt;p>&lt;strong>2. Encapsulation&lt;/strong>
Modules hide internal details and expose only necessary functionality through interfaces&lt;/p>
&lt;p>&lt;strong>3. Shared Kernel&lt;/strong>
Common functionality such as base entities, common utilities, domain events&lt;/p>
&lt;p>&lt;strong>4. Communication&lt;/strong>
Modules communicate through interfaces or domain events, avoiding direct dependencies&lt;/p>
&lt;p>&lt;strong>5. Single Deployment&lt;/strong>
All modules are deployed together as a single unit&lt;/p>
&lt;h2 id="getting-started">Getting Started
&lt;/h2>&lt;h3 id="prerequisites">Prerequisites
&lt;/h3>&lt;ul>
&lt;li>.NET 8.0 SDK&lt;/li>
&lt;li>Visual Studio Code or Visual Studio&lt;/li>
&lt;/ul>
&lt;h3 id="quick-start">Quick Start
&lt;/h3>&lt;p>&lt;strong>1. Clone Repository:&lt;/strong>&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>git clone https://github.com/suriyasonp/modular-monolith-ecommerce.git
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>cd modular-monolith-ecommerce
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>2. Run Application:&lt;/strong>&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Method 1: Using script (Recommended)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>./run.sh
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Method 2: Manual run&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>dotnet build
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>dotnet run --project src/ECommerceApp/ECommerceApp.csproj
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>3. Access API:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Swagger UI&lt;/strong>: &lt;a class="link" href="http://localhost:5000/swagger/index.html" target="_blank" rel="noopener"
>http://localhost:5000/swagger/index.html&lt;/a>&lt;/li>
&lt;li>&lt;strong>API Base URL&lt;/strong>: &lt;a class="link" href="http://localhost:5000/api" target="_blank" rel="noopener"
>http://localhost:5000/api&lt;/a>&lt;/li>
&lt;li>&lt;strong>Sample Products&lt;/strong>: Data will be automatically seeded on startup&lt;/li>
&lt;/ul>
&lt;h3 id="testing-the-application">Testing the Application
&lt;/h3>&lt;p>&lt;strong>Quick Test Script:&lt;/strong>&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>./test-api.sh
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="key-api-endpoints">Key API Endpoints
&lt;/h2>&lt;h3 id="products-api">Products API
&lt;/h3>&lt;ul>
&lt;li>&lt;code>GET /api/products&lt;/code> - Get all products&lt;/li>
&lt;li>&lt;code>GET /api/products/{id}&lt;/code> - Get product by ID&lt;/li>
&lt;li>&lt;code>POST /api/products&lt;/code> - Create new product&lt;/li>
&lt;li>&lt;code>PUT /api/products/{id}/price&lt;/code> - Update product price&lt;/li>
&lt;li>&lt;code>PUT /api/products/{id}/stock&lt;/code> - Update product stock&lt;/li>
&lt;/ul>
&lt;h3 id="customers-api">Customers API
&lt;/h3>&lt;ul>
&lt;li>&lt;code>GET /api/customers&lt;/code> - Get all customers&lt;/li>
&lt;li>&lt;code>GET /api/customers/{id}&lt;/code> - Get customer by ID&lt;/li>
&lt;li>&lt;code>POST /api/customers&lt;/code> - Create new customer&lt;/li>
&lt;/ul>
&lt;h3 id="orders-api">Orders API
&lt;/h3>&lt;ul>
&lt;li>&lt;code>GET /api/orders&lt;/code> - Get all orders&lt;/li>
&lt;li>&lt;code>GET /api/orders/{id}&lt;/code> - Get order by ID&lt;/li>
&lt;li>&lt;code>GET /api/orders/customer/{customerId}&lt;/code> - Get orders by customer&lt;/li>
&lt;li>&lt;code>POST /api/orders&lt;/code> - Create new order&lt;/li>
&lt;li>&lt;code>POST /api/orders/{id}/confirm&lt;/code> - Confirm order&lt;/li>
&lt;li>&lt;code>POST /api/orders/{id}/ship&lt;/code> - Ship order&lt;/li>
&lt;li>&lt;code>POST /api/orders/{id}/deliver&lt;/code> - Deliver order&lt;/li>
&lt;/ul>
&lt;h2 id="benefits-and-drawbacks-of-modular-monolith">Benefits and Drawbacks of Modular Monolith
&lt;/h2>&lt;h3 id="-benefits">✅ Benefits
&lt;/h3>&lt;h4 id="1-deployment-simplicity">1. Deployment Simplicity
&lt;/h4>&lt;ul>
&lt;li>Deploy as single unit, reducing infrastructure complexity&lt;/li>
&lt;li>No need to worry about service discovery or load balancing&lt;/li>
&lt;li>Easy rollbacks&lt;/li>
&lt;/ul>
&lt;h4 id="2-performance">2. Performance
&lt;/h4>&lt;ul>
&lt;li>No network latency between modules&lt;/li>
&lt;li>Communication is in-process calls&lt;/li>
&lt;li>Cross-module transactions are straightforward&lt;/li>
&lt;/ul>
&lt;h4 id="3-development-and-debugging">3. Development and Debugging
&lt;/h4>&lt;ul>
&lt;li>Easier to debug than distributed systems&lt;/li>
&lt;li>Better IDE support&lt;/li>
&lt;li>Simpler end-to-end testing&lt;/li>
&lt;/ul>
&lt;h4 id="4-operational-costs">4. Operational Costs
&lt;/h4>&lt;ul>
&lt;li>Lower infrastructure requirements&lt;/li>
&lt;li>No need for large DevOps teams&lt;/li>
&lt;li>Simpler monitoring and logging&lt;/li>
&lt;/ul>
&lt;h4 id="5-future-flexibility">5. Future Flexibility
&lt;/h4>&lt;ul>
&lt;li>Can be extracted to microservices when necessary&lt;/li>
&lt;li>Well-designed modules are easily extractable&lt;/li>
&lt;/ul>
&lt;h3 id="-drawbacks">⚠️ Drawbacks
&lt;/h3>&lt;h4 id="1-technology-constraints">1. Technology Constraints
&lt;/h4>&lt;ul>
&lt;li>Must use the same primary technology&lt;/li>
&lt;li>Difficult to use different tech stacks&lt;/li>
&lt;/ul>
&lt;h4 id="2-scaling">2. Scaling
&lt;/h4>&lt;ul>
&lt;li>Cannot scale individual modules separately&lt;/li>
&lt;li>Resource utilization may not be optimal&lt;/li>
&lt;/ul>
&lt;h4 id="3-database-coupling">3. Database Coupling
&lt;/h4>&lt;ul>
&lt;li>Shared database may create coupling issues&lt;/li>
&lt;li>Schema migrations need careful consideration&lt;/li>
&lt;/ul>
&lt;h4 id="4-team-independence">4. Team Independence
&lt;/h4>&lt;ul>
&lt;li>Teams still need to coordinate deployments&lt;/li>
&lt;li>Shared codebase may be problematic for large teams&lt;/li>
&lt;/ul>
&lt;h2 id="when-to-use-modular-monolith">When to Use Modular Monolith
&lt;/h2>&lt;h3 id="-suitable-for">🎯 Suitable for
&lt;/h3>&lt;h4 id="1-small-to-medium-teams-2-20-people">1. Small to Medium Teams (2-20 people)
&lt;/h4>&lt;ul>
&lt;li>Limited resources for infrastructure complexity&lt;/li>
&lt;li>Need high development velocity&lt;/li>
&lt;/ul>
&lt;h4 id="2-new-applications">2. New Applications
&lt;/h4>&lt;ul>
&lt;li>Uncertain about domain boundaries&lt;/li>
&lt;li>Need rapid prototyping and iteration&lt;/li>
&lt;/ul>
&lt;h4 id="3-unclear-requirements">3. Unclear Requirements
&lt;/h4>&lt;ul>
&lt;li>Business requirements change frequently&lt;/li>
&lt;li>Need flexibility for adjustments&lt;/li>
&lt;/ul>
&lt;h4 id="4-limited-devops-capability">4. Limited DevOps Capability
&lt;/h4>&lt;ul>
&lt;li>Team not ready for distributed systems&lt;/li>
&lt;li>Infrastructure automation not mature&lt;/li>
&lt;/ul>
&lt;h3 id="-not-suitable-for">🚫 Not Suitable for
&lt;/h3>&lt;h4 id="1-large-organizations-with-many-teams">1. Large Organizations with Many Teams
&lt;/h4>&lt;ul>
&lt;li>Teams need high independence&lt;/li>
&lt;li>Different release cycles&lt;/li>
&lt;/ul>
&lt;h4 id="2-very-different-requirements">2. Very Different Requirements
&lt;/h4>&lt;ul>
&lt;li>Different scalability requirements per module&lt;/li>
&lt;li>Need different technologies&lt;/li>
&lt;/ul>
&lt;h4 id="3-high-compliance-and-security-constraints">3. High Compliance and Security Constraints
&lt;/h4>&lt;ul>
&lt;li>Need isolation between components&lt;/li>
&lt;li>Strict regulatory requirements&lt;/li>
&lt;/ul>
&lt;h2 id="migration-path-planning">Migration Path Planning
&lt;/h2>&lt;h3 id="phase-1-start-with-modular-monolith">Phase 1: Start with Modular Monolith
&lt;/h3>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>Traditional Monolith → Modular Monolith
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Activities:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Identify domain boundaries&lt;/li>
&lt;li>Create modules by business capabilities&lt;/li>
&lt;li>Implement interfaces for inter-module communication&lt;/li>
&lt;li>Add domain events infrastructure&lt;/li>
&lt;/ul>
&lt;h3 id="phase-2-improve-module-independence">Phase 2: Improve Module Independence
&lt;/h3>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>Tightly Coupled Modules → Loosely Coupled Modules
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Activities:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Separate databases per module&lt;/li>
&lt;li>Use event-driven communication&lt;/li>
&lt;li>Implement distributed tracing&lt;/li>
&lt;li>Add per-module monitoring&lt;/li>
&lt;/ul>
&lt;h3 id="phase-3-selective-microservices-extraction">Phase 3: Selective Microservices Extraction
&lt;/h3>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>Modular Monolith → Hybrid Architecture
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Activities:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Identify modules suitable for extraction&lt;/li>
&lt;li>Extract modules with different scaling needs&lt;/li>
&lt;li>Implement API gateways&lt;/li>
&lt;li>Setup service mesh&lt;/li>
&lt;/ul>
&lt;h2 id="conclusion">Conclusion
&lt;/h2>&lt;p>Modular Monolith is a suitable architecture for many types of organizations, especially teams that want the benefits of modularity but are not ready for the complexity of microservices.&lt;/p>
&lt;h3 id="-key-takeaways">🔑 Key Takeaways
&lt;/h3>&lt;p>&lt;strong>1. Start Simple&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Use Modular Monolith as starting point&lt;/li>
&lt;li>Focus on domain modeling and clean boundaries&lt;/li>
&lt;li>Improve gradually&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>2. Design for Change&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Use interfaces for inter-module communication&lt;/li>
&lt;li>Implement domain events infrastructure&lt;/li>
&lt;li>Prepare monitoring and observability&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>3. Plan Migration Path&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Identify modules that may need extraction in the future&lt;/li>
&lt;li>Design data access patterns that support separation&lt;/li>
&lt;li>Build culture of modular thinking&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>4. Focus on Business Value&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Don&amp;rsquo;t let technical complexity overshadow business goals&lt;/li>
&lt;li>Use architecture appropriate for team and context&lt;/li>
&lt;li>Remember: Architecture is means, not end&lt;/li>
&lt;/ul>
&lt;h3 id="-next-steps">🚀 Next Steps
&lt;/h3>&lt;ol>
&lt;li>&lt;strong>Study the Code&lt;/strong>: Visit the &lt;a class="link" href="https://github.com/suriyasonp/modular-monolith-ecommerce" target="_blank" rel="noopener"
>repository&lt;/a> to understand implementation details&lt;/li>
&lt;li>&lt;strong>Try Running&lt;/strong>: Execute &lt;code>./test-api.sh&lt;/code> to see all functionality&lt;/li>
&lt;li>&lt;strong>Add Features&lt;/strong>: Try creating new modules following established patterns&lt;/li>
&lt;li>&lt;strong>Apply to Production&lt;/strong>: Adapt for production environment&lt;/li>
&lt;/ol>
&lt;p>Modular Monolith is not a silver bullet, but it&amp;rsquo;s an effective tool for building maintainable, scalable, and evolvable systems in the long term.&lt;/p>
&lt;h2 id="references">References
&lt;/h2>&lt;ol>
&lt;li>&lt;a class="link" href="https://github.com/suriyasonp/modular-monolith-ecommerce" target="_blank" rel="noopener"
>Modular Monolith E-commerce Repository&lt;/a> - Implementation Example&lt;/li>
&lt;li>&lt;a class="link" href="https://domainlanguage.com/ddd/" target="_blank" rel="noopener"
>Domain-Driven Design&lt;/a> - Eric Evans&lt;/li>
&lt;li>&lt;a class="link" href="https://www.kamilgrzybek.com/design/modular-monolith-primer/" target="_blank" rel="noopener"
>Modular Monoliths&lt;/a> - Kamil Grzybek&lt;/li>
&lt;li>&lt;a class="link" href="https://samnewman.io/books/building_microservices/" target="_blank" rel="noopener"
>Building Microservices&lt;/a> - Sam Newman&lt;/li>
&lt;li>&lt;a class="link" href="https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html" target="_blank" rel="noopener"
>Clean Architecture&lt;/a> - Robert C. Martin&lt;/li>
&lt;li>&lt;a class="link" href="https://docs.microsoft.com/en-us/aspnet/core/" target="_blank" rel="noopener"
>ASP.NET Core Documentation&lt;/a> - Microsoft Docs&lt;/li>
&lt;li>&lt;a class="link" href="https://blog.bytebytego.com/p/monolith-vs-microservices-vs-modular" target="_blank" rel="noopener"
>Monolith vs Microservices vs Modular Monoliths&lt;/a> - Monolith vs Microservices vs Modular Monoliths&lt;/li>
&lt;/ol>
&lt;hr></description></item></channel></rss>