Skip to the content.

Fullstack > Architecture > 🌐 Micro Frontends

Micro Frontends is an architectural style where a frontend app is decomposed into individual, semi-independent β€œmicro-apps” that are owned by different teams and developed, tested, and deployed independently.

This approach extends the principles of microservices to the frontend, helping to scale frontend development across multiple teams and codebases.


❓ Why Micro Frontends?

Micro Frontends solve key challenges in large frontend applications:


🧩 Micro Frontend Components

1️⃣ Micro App

Each micro app is a self-contained frontend module responsible for a distinct feature or domain of the application. Examples include:

Each micro app can be:


2️⃣ Shell (Container Application)

The Shell (also called Host or Container) is the main application responsible for:

The shell can use integration strategies like:


3️⃣ Routing and Composition

Routing in a micro frontend setup can be handled:

Apps are composed into the shell:


4️⃣ Shared Libraries and Dependencies

To avoid duplication and reduce bundle size, micro apps can share:

These shared dependencies are typically declared as singletons when using Module Federation.


🌍 Micro Frontends in Fullstack Applications

With Angular


πŸ”— Integration Strategies


πŸ“‚ Folder Structure Example


microfrontends-app/
β”œβ”€β”€ shell-app/
β”‚   β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ webpack.config.js
β”‚   β”œβ”€β”€ angular.json
β”œβ”€β”€ user-profile-app/
β”‚   β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ webpack.config.js
β”‚   β”œβ”€β”€ angular.json
β”œβ”€β”€ orders-app/
β”‚   β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ webpack.config.js
β”‚   β”œβ”€β”€ angular.json
└── shared-lib/
    β”œβ”€β”€ src/