Skip to main content
Algoramming
HomeAbout
ProjectsBlogsCareersContact
Let's Talk
01Next move

Software that works quietly, every day —

Ready to build something people stick with?

Send the brief — bullet points are fine. We reply within one business day with a plain-English next step. NDA on request.

Start a projectBook a 30-min call
Studio signalAccepting briefs
Reply
≤ 1 business day
Discovery
Free 30-min call
Engagement
Fixed scope or retainer
Timezone overlap
6+ hours, any region
support@algoramming.comDhaka · GMT (UTC+6)
Reply in one business day
NDA on request
Plain-English scoping note
Senior team, end-to-end
Algoramming Systems Ltd.

An independent product studio in Dhaka, designing and engineering high-performing custom software, mobile, and web apps for ambitious teams worldwide.

Innovation in every step

Company

  • About us
  • Services
  • Projects
  • Blogs
  • Careers
  • Contact

Services

  • Custom software
  • Mobile apps
  • Web applications
  • UI/UX design
  • Product consultation
  • Tech partnership

Get in touch

  • House #12, Road #02, Dag #1677
    Merul Badda, Anandanagar
    Dhaka-1212, Bangladesh
    Open in Maps →
  • +880 1400 629698
  • support@algoramming.com

New posts, in your inbox

We send a short email whenever we publish a new field note or ship a studio update. No fixed schedule, no filler, unsubscribe in one click.

Working with teams in

  • DhakaBangladeshBST
  • DubaiUAEGST
  • DohaQatarAST
  • MansfieldUSAEST
  • Mexico CityMexicoCST
  • MonfalconeItalyCET
  • MelbourneAustraliaAEST
  • VarnaBulgariaEET

© 2026 Algoramming Systems Ltd.All rights reserved.

Privacy PolicyTerms and ConditionsSitemap
Home/Field notes/Monolith to Micro-Frontends: A Pragmatic Scaling Guide
Field note

Monolith to Micro-Frontends: A Pragmatic Scaling Guide

Learn when and how to transition from a monolithic frontend to micro-frontends without hurting your team's velocity or performance.

Written by
Algoramming Systems Ltd.
May 21, 202612 min read2,471 words
  • micro-frontends
  • web architecture
  • react architecture
  • scaling engineering teams
Monolith to Micro-Frontends: A Pragmatic Scaling Guide

Monolith to Micro-Frontends: A Pragmatic Scaling Guide

A fast-growing software companyhas eight developers. They read engineering blogs from Netflix and Spotify. They decide that their monolithic React application is too messy, so theysplit it into five micro-frontends. Within three months, deployment times jump from five minutes to forty-five minutes. Developers spend half their week debugging dependency mismatches, and the user experience degrades as duplicate React instances load across different routes. The team wanted autonomy but got a distributed mess instead.

This scenario plays out in engineering organizations every single week. The promise ofmicro-frontends is highly appealing. You get independent deployments, isolated codebases, and autonomous teams. But for early-stage startups and mid-sized companies, adopting this model too early is an expensive mistake.

This guide laysout a pragmatic approach to web architecture. We will explore why you should start with a monolith, how scaling engineering teams dictatesyour architectural shifts, and how to execute a clean transition to micro-frontends when the time is actually right.## The Monolith is Not Your Enemy

Startups need speed above all else. In the early days of a product,your primary risk is not technical scalability, it is market fit. A monolithic frontend, especially a well-structured react architecture, is the fastest vehicle for finding that fit.

When your codebase lives in a single repository, refactoring is trivial. If you need to change a user authentication flow or update a global button component, you can do it in one pullrequest. Your type safety is guaranteed across the entire application. Your build pipeline is simple: one command compiles the code,and one command deploys it to a static hosting provider like Vercel or Netlify.

A monolith also ensuresa consistent user experience. Because all components share the same runtime, there is no risk of one page loading React 17 while another loads React 18. Fonts, styles, and global states are naturally unified.

For a teamof fewer than fifteen developers, the overhead of managing multiple repositories and build configurations is a distraction. Keep your codebase unified.Group your files by domain or feature folder within your single repository. This approach, often called a modular monolith, gives youthe logical separation you will need later without any of the operational pain today.

To build a clean modular monolith, considerthis folder structure:

  • /src/components: Global UI elements (buttons, inputs)
  • /src/features/billing: All billing components, hooks, and state
  • /src/features/dashboard: All dashboard code, isolated from billing
  • /src/features/profile: Profile-specific logic

By keeping features isolated insidetheir own folders, you prevent spaghetti code while maintaining the simplicity of a single build pipeline.

The Real Cost of Micro-Frontends

Micro-frontends solve organizational problems, not technical ones. When you split a frontend, you introducea massive operational tax that many teams fail to calculate beforehand.

First, consider the performance impact. If Team A and Team Bboth build separate applications that are loaded onto the same page, how do you manage dependencies? If you do not configure yourbundler perfectly, users will download multiple copies of massive libraries like React, Lodash, or component suites. This caneasily add 300kb to 500kb of redundant JavaScript to your initial page load, directly hurtingyour core web vitals and search engine rankings.

Second, local development becomes significantly more complex. Instead of running asingle start command and seeing your entire application, developers must now orchestrate multiple local servers. They have to run the host container,the specific micro-frontend they are editing, and mock servers for any missing dependencies.

Third, testing becomes a distributedheadache. A change in a shared utility library can silently break a sibling micro-frontend without triggering a build failure in themodified repository. You are forced to build complex integration test suites that run across multiple repositories, slowing down your deployment pipeline.Before choosing this path, evaluate these trade-offs:

  1. Bundle size growth: Expect an initial increase in pageweight as you coordinate shared dependencies.
  2. Tooling complexity: Your build configurations will require advanced configuration ofWebpack, Vite, or specialized orchestration tools.
  3. Organizational overhead: You will need dedicated infrastructure engineersto maintain the shared pipelines and deployment environments.

The Organizational Trigger: When to Actually Split

You should only considermicro-frontends when your organizational structure forces your hand. This is a direct application of Conway's Law, whichstates that organizations design systems that mirror their own communication structures.

When does this happen? Usually, when you reach aboutthree or four distinct engineering teams (roughly twenty to thirty developers) working on the same frontend. At this scale, the monolith starts tocreate friction:

  1. Deployment bottlenecks: Teams have to wait in a queue to merge their code because themain branch is constantly locked by failing tests from unrelated features.
  2. Communication overhead: Developers spend hours inalignment meetings to make sure their changes do not break another team's domain.
  3. Divergentrelease cycles: The marketing team wants to deploy changes to the public-facing dashboard daily, but the core product team needsa weekly release cadence due to compliance testing.

If your developers are constantly stepping on each other's toes and deploymentfrequency is dropping, the organizational pain has finally surpassed the technical tax of a distributed architecture. That is your cue to beginthe split.

Monolith Phase (1-15 devs) -> Modular Monolith (15-30 devs) -> Micro-Frontends (30+ devs)
   [Single Codebase][Strict Feature Folders]         [Independent Repos]
   [Fastest Delivery]            [Preparation for Split][Autonomous Delivery]

At thirty developers, the cost of communication dominates your engineering budget. Splitting the frontendallows each team to own their pipeline, deploy when they want, and choose the tools that best fit their specific domain.## Architectural Blueprints: Module Federation vs. Build-Time Integration

When you decide to split your react architecture, youmust choose how to stitch the pieces back together. There are two primary approaches: build-time integration and run-timeintegration.

Build-time integration involves publishing each micro-frontend as an npm package and installing them into a container application. This is a common trap. It couples your deployment cycles. If Team A updates their micro-frontend, the containerteam must install the new version, run a full build, and redeploy. This defeats the main purpose of micro-frontends, which is independent deployment.

Run-time integration is the superior path, and Webpack Module Federation (or its Vite equivalent, @originjs/vite-plugin-federation) is the industry standard tool for this.It allows an application to dynamically load code from another application at runtime.

Here is a basic example of a Webpackconfiguration for a host application loading a remote micro-frontend:

// webpack.config.js (HostApplication)
const ModuleFederationPlugin = require("webpack/lib/container/ModuleFederationPlugin");

module.exports = {
  plugins:[
    new ModuleFederationPlugin({
      name: "hostApp",
      remotes: {
        profileMicroApp: "profileApp@https://cdn.example.com/profile/remoteEntry.js",
      },
      shared: {
        react: { singleton: true, requiredVersion: "^18.2.0" },
        "react-dom": { singleton: true, requiredVersion: "^18.2.0" },
      },
    }),
  ],
};```

In this configuration, the `shared` object is critical. It tells the browser to load only one instanceof React and React-DOM, solving the duplicate dependency problem. The host application can now fetch the profile micro-appdynamically from its remote URL without needing a rebuild of the host container when the profile app changes.

## Managing Shared State and CommunicationOne of the biggest mistakes in micro-frontend implementations is treating the separate applications as if they are still part of asingle React state tree. Trying to share a global Redux or Zustand store across micro-frontends creates tight coupling,which ruins your scaling engineering teams goals.

If Team A's micro-frontend depends on the exact state shape ofTeam B's store, they can no longer deploy independently. A change in Team B's store structure will breakTeam A's application in production.

Instead, treat your micro-frontends like separate microservices. They shouldcommunicate via lightweight, decoupled mechanisms. The browser provides excellent native APIs for this.

Custom Events are highly effective for simple, one-way communication:

```javascript
// In the Host or Navigation Micro-Frontend
const dispatchUserLogout= () => {
  const event = new CustomEvent("user-logout", { 
    detail: { userId: "user_12345", timestamp: Date.now() } 
  });
  window.dispatchEvent(event);
};

// In the Profile Micro-Frontend
window.addEventListener("user-logout", (event) => {
  console.log(`Logging out user: ${event.detail.userId}`);
  // Clearlocal session data and redirect the user
});

For persistent state, rely on storage mechanisms like LocalStorage or IndexedDB, or pass essential parameters through the URL query string. The URL is the most resilient, standard, and debuggable statemanager in web architecture. If you must use a shared state library, keep it limited to a thin, read-only configuration layerthat loads once at startup.

Testing and CI/CD in a Distributed Frontend

When you move to a distributed frontend,your CI/CD pipelines must evolve. In a monolith, a type error or a broken import fails the build, preventingbad code from hitting production. In a micro-frontend setup, a remote application can deploy a breaking change, and thehost application will only find out when a user visits the page and the screen goes blank.

To prevent this, youneed a testing strategy built on three pillars:

  1. Unit and Component Testing: Each micro-frontend must have its ownisolated test suite using tools like Jest or Vitest. These tests should run on every pull request within that specific repository.2. Contract Testing: Use tools like Pact to define contracts between the host application and the remote applications.If a remote micro-frontend changes its exported component interface or its custom event payload, the contract test will fail before deployment.
  2. End-to-End Testing with Playwright: Run a nightly or pre-deployment end-to-end test suite that spins up the production versions of all micro-frontends together. This ensures that theintegrated system behaves correctly.

Your deployment pipeline should be completely independent. When a developer merges code in the profile micro-frontend repository, the CI/CD pipeline should build only that project, upload the assets to an S3 bucket or CDN, and update the remote entry file. The host application should not need a rebuild.

                 │
                 ▼
     [Run Unit & Contract Tests]
                 │
                 ▼[Build & Upload Assets to S3/CDN]
                 │
                 ▼[Update Remote Entry File (remoteEntry.js)]
                 │
                 ▼
  [Host App loads new code dynamically] (No Host rebuild required)```

This pipeline ensures that your release cycles remain fast, predictable, and isolated from other teams' schedules.

## HandlingShared Design Systems and Component Libraries

Every company wants a consistent design system. When you transition to micro-frontends,the immediate instinct is to build a massive, shared UI library containing every button, modal, form input, and dropdown,then distribute it as an npm package.

This approach often backfires. A shared component library can become a development bottleneck. If Team A needs a new feature on a button, they must submit a pull request to the design system repository,wait for a review, publish a new npm version, and then update their micro-frontend. This slow loop destroys developervelocity.

To avoid this, keep your shared library extremely lean. Only include foundational, low-volatility elements likecolor tokens, typography styles, and basic spacing rules.

For complex components like tables, forms, or navigation bars,allow teams to build their own local versions first. Once a pattern has stabilized across multiple micro-frontends, you cancarefully migrate it into the shared library. It is far better to tolerate a small amount of duplicate code across teams than toforce everyone to coordinate through a single, slow-moving repository.

If you must distribute components, consider using CSS custom variablesfor styling. This allows you to update the visual design of your entire suite of applications by updating a single CSS file ona CDN, without requiring any JavaScript package updates.

## Step-by-Step Migration Strategy: The Strangler Fig PatternYou should never attempt a big-bang rewrite where you shut down your monolith and build micro-frontends from scratch.This is a recipe for missed deadlines and lost revenue. Instead, use the Strangler Fig pattern to gradually migrate your application.

The goal is to slowly replace parts of the monolithic system with micro-frontends until the monolith is completely goneor reduced to a manageable core.

Here is a step-by-step migration checklist:

1. **Identify a low-risk, isolated domain**: Do not start with your core checkout page. Start with a secondary page,like the user settings dashboard or the help center.
2. **Create the host container**: Build a lightweight applicationthat handles main layout, global navigation, and authentication.
3. **Embed the existing monolith**: Load your monolithinside the host container, perhaps using an iframe or simple routing rules, so the user sees no change.
4.**Extract the first micro-frontend**: Rebuild the chosen low-risk page as an independent application using Module Federation.
5. **Route traffic to the new micro-frontend**: Update the host container's router to loadthe new micro-frontend instead of the monolith's version for that specific path.
6. **Repeat**: Continue this processfor other domains, gradually carving away at the monolith over several months.

This incremental approach minimizes risk. If something goes wrong with thenew micro-frontend, you can quickly roll back the routing rule to point back to the monolith while you debug the issue, keeping production stable.

## Common Pitfalls and How to Avoid Them

Even with a solid plan, many teams fallinto predictable traps during their architectural transition. Recognizing these early can save you months of refactoring.

One common pitfallis CSS pollution. If multiple micro-frontends use global CSS styles, they will inevitably overwrite each other's layouts. A button style in the checkout application might accidentally change the styling of a form in the billing application. To prevent this, enforce CSS isolation. Use CSS Modules, styled-components, or Tailwind CSS with unique prefix configurations to ensure styles arescoped strictly to their respective components.

Another pitfall is runtime error propagation. If a remote micro-frontend crashes,it can crash the entire application, leaving users with a white screen. You must wrap every remote entry point in a ReactError Boundary. If a specific micro-frontend fails, the Error Boundary can catch the error and display a friendly fallback message, allowing the rest of the application to remain functional.

Finally, do not over-engineer the developer experience. If yourlocal setup requires running Docker containers, Kubernetes clusters, and ten terminal tabs, your developers will find workarounds that bypass yoursafety checks. Keep local tooling simple, fast, and close to standard web development workflows.

Before you make the leap, run through this readiness checklist:

* [ ] Do you have more than 20 frontend developers?
*[ ] Is your deployment pipeline a major bottleneck for team velocity?
* [ ] Have you defined clear domainboundaries between your teams?
* [ ] Do you have dedicated platform support to manage the infrastructure?

If you cannotcheck all of these boxes, stick to a modular monolith for now. It will serve you better, run faster, and costsignificantly less to maintain.

> **Key takeaways**
> * Start with a modular monolith; premature split introduces heavyperformance and operational taxes without any real organizational benefit.
> * Use Conway's Law as your guide. Only splityour web architecture when team size (typically 20 to 30 developers) and deployment bottlenecks demand it.
>* Prefer run-time integration tools like Webpack Module Federation over build-time npm packages to preserve independent deployability.
>* Decouple micro-frontends by avoiding shared state stores. Use native Custom Events, LocalStorage, or theURL for communication.
> * Migrate gradually using the Strangler Fig pattern to replace low-risk domains one at a time, keeping your production system stable.

If you are planning a project like this and want to discuss the best architectural pathfor your team, we are happy to talk it through.
Share this
Reply to this note
Working on something?

Have a project in mind?

We design and engineer software, mobile, and web products end-to-end. Send the brief, we will reply within one business day.

Start a project
New posts, in your inbox

Be first to read the next note.

We send a short email whenever we publish a new field note or ship a studio update. No fixed schedule, no filler.

Unsubscribe in one click. We never share your address.

Keep reading

More field notes like this.

All posts
Anatomy of an API Leak:Incident Response and Recovery01 · Related
May 21, 2026·15 min

Anatomy of an API Leak:Incident Response and Recovery

A step-by-step engineering case study of an API credential exposure and how modern product teams automate secret detection and rotation.

Read post
Beyond OpenAI API: Building Local LLM Pipelines for Privacy02 · Related
May 29, 2026·1 min

Beyond OpenAI API: Building Local LLM Pipelines for Privacy

Beyond OpenAI API: Building Local LLM Pipelines for Privacy Sending customer data to a third-party APIis a risk that many startups can no longer afford to take. Whether you are handling medical…

Read post
Why Product-Minded Engineers Outpace Pure Coders03 · Related
May 21, 2026·12 min

Why Product-Minded Engineers Outpace Pure Coders

Discover why developers who combine clean code with product thinking and UI/UX empathy rise fasterto technical leadership positions.

Read post
Liked this note?

Bring us a problem, not just a brief.

We will reply in plain English within one business day, NDA on request. Discovery call is free.

Start a conversationOr browse more field notes