Angular has no built-in module federation, so real micro architecture means composing separately built and deployed Angular applications at runtime. The most common way to do that today is Angular's native support for native federation (or its older sibling, Webpack Module Federation), which lets one shell load a remote app's routes and components without bundling the remote's code at build time. The key condition is that each remote must be independently buildable, expose a defined public surface, and share critical singletons like Angular and RxJS so two copies of the framework do not end up on the same page.
This guide walks through the decisions and setup steps that turn a single Angular application into a shell-and-remotes system: choosing boundaries, scaffolding the workspaces, configuring federation, wiring routing, sharing state without coupling, deploying independently, and testing the seams. Angular versions move fast—Angular 17 through 20 are the relevant recent releases as of late 2026, and the native federation tooling has shifted names and packages along the way—so every configuration step here comes with the check you need to confirm it against your installed version.
What "micro architecture" means in an Angular context
The term covers several ideas that get conflated. Vertical micro frontends split the UI by business capability—checkout, catalog, account—so each team owns a slice of the screen and its release cycle. Horizontal micro frontends split by slot, where a shell composes widgets from many teams onto one page. Microservices on the backend and micro frontends on the frontend are related in spirit (independent deployability, team ownership) but share no code mechanism; the frontend version is a composition problem solved in the browser.
Angular's own architecture guidance pushes toward NgModules or, since standalone components became the default around Angular 15–17, toward a flatter component graph. Neither model gives you independent deployment by itself. What gives you independent deployment is a module federation layer plus a host that resolves remote entry points at runtime. Two other interpretations are worth naming because people ask about them: an internal "micro architecture" of angular feature folders and lazy-loaded routes inside one deployable app (valuable, but not micro frontends), and a monorepo with Nx where many libraries build into one app (also valuable, also not independently deployable on its own). Decide which one you actually need before scaffolding, because the federation path adds real operational cost.
Decide whether you need micro frontends at all
Micro frontends buy organizational scaling at the price of runtime complexity. The honest trade-off looks like this:
| Criterion | Single Angular app with lazy routes | Federated micro frontends |
|---|---|---|
| Independent deploy | No | Yes, per remote |
| Shared framework copy | One | Shared via federation config |
| Team autonomy | Moderate (merge conflicts, release trains) | High (own repos or own pipeline) |
| Failure isolation | Whole app fails together | A remote can fail alone if you handle it |
| Debugging | One source map tree | Crosses app boundaries; harder |
| Initial setup cost | Low | Moderate to high |
| Bundle duplication risk | None | Real if shared config is wrong |
Pick micro frontends when several teams genuinely need to ship on different schedules, when a legacy AngularJS or older Angular area must coexist with a modern shell, or when an acquisition means you must stitch apps together. Stay with a single application if one team owns the code, if the page is performance-critical and tiny, or if you cannot commit to owning the composition layer. Splitting a small app into remotes usually degrades both velocity and performance.
Choose the composition model: runtime federation vs. iframes vs. web components
Three composition mechanisms dominate, and they differ in how much integration you get.
Iframes give perfect isolation—separate DOM, separate JS context, separate CSS—and near-zero framework coupling. They also break shared routing, make modals and overlays awkward, duplicate the Angular runtime per frame, and are painful for accessibility and deep linking. They're a defensible choice for embedding a genuinely foreign app (a vendor dashboard, an old internal tool) and a poor choice for a cohesive product UI.
Web components let an Angular remote export a custom element that any host can mount. Angular supports this well through its elements package, and the resulting tag is framework-agnostic. The downside is that inputs and outputs cross a custom-element boundary, dependency sharing is manual, and change detection across the boundary needs care.
Runtime module federation—Webpack Module Federation or the native federation packages built for Angular's esbuild-based builder—is the mainstream Angular answer. A remote exposes modules; the host declares where to find the remote's entry file and loads exposed routes or components at runtime. You get lazy loading, shared dependency singletons, and integrated routing, at the cost of configuration that must be right. The rest of this guide assumes this model because it's the one Angular users most often mean.
Prerequisites before you scaffold
You need an Angular workspace on a supported version with the esbuild-based application builder (the default since Angular 17), Node.js at a version your Angular release supports, and a package manager you'll use consistently across shell and remotes. Decide up front:
Repository layout. One monorepo with a project per remote (simplest to keep versions aligned) or separate repositories per team (maximum autonomy, more coordination). Monorepos reduce version drift; separate repos reduce cross-team coupling. A domain or path scheme. Which URL prefix belongs to which remote, e.g., /shop for catalog and /account for profile. This drives routing and deployment. A shared contract. The list of exposed entry points and the events or state each remote publishes and consumes. Version policy. All apps should track the same major Angular version. Mixed major versions in federation are where hard-to-diagnose failures originate.
Step-by-step: scaffold the shell and a remote
The commands below use the Angular CLI and native federation packages. Package names for native federation have changed across releases, so treat the install commands as the shape of the step and confirm exact package names against your Angular version's documentation before running them.
1: Create the workspace and shell. Run ng new shell --standalone --routing --style=css, then cd shell. The shell will own top-level layout, authentication, and the route table that points at remotes. 2: Add the federation tooling to the shell. Install the native federation package appropriate to your Angular version (historically @angular-architects/native-federation). Confirm it installs without peer-dependency errors against your Angular version—a peer warning here usually means a version mismatch you'll regret later. 3: Run the federation initializer for the host. The package ships a schematic (for example, ng g @angular-architects/native-federation:init --project shell --port 4200 --type host). It creates a federation config file and a manifest. Check that angular.json now references the federation builder for the build target rather than the plain application builder. 4: Generate the first remote. From the workspace root, ng generate application catalog --standalone --routing. Then run the initializer's remote variant (for example, --project catalog --port 4201 --type remote). A remote config file now lists what the app exposes. 5: Expose a route file, not the whole app. In the remote, create a routes file (for example, src/app/catalog.routes.ts) exporting the remote's routes, and expose it in the federation config under a name like ./Routes. Exposing the bootstrap component instead of routes is a common early mistake; it fights the host's router. 6: Serve both and verify the remote entry loads. Run the remote with ng serve --port 4201 and the shell with ng serve --port 4200. Open the shell and watch the network panel: you should see a request to the remote's remoteEntry.json (native federation) or remoteEntry.js (Webpack). If that request 404s, the remote's serve configuration or port is wrong.
Success check: the shell renders, the remote entry file loads with HTTP 200, and no console error mentions a missing shared dependency. Failure check: if you see "shared module is not available for eager consumption" (Webpack) or duplicate Angular warnings, your shared configuration is incomplete—fix that before continuing.
Wire remote routes into the shell
The host declares the remote and then lazy-loads it through the router. With native federation, the pattern is a dynamic import wrapped by the federation helper:
Declare catalog in the host's federation config with its entry URL. Add a lazy route in the shell: { path: 'catalog', loadChildren: () => loadRemoteModule({ remoteName: 'catalog', exposedModule: './Routes' }).then(m => m.routes) }. For Webpack Module Federation, the equivalent uses loadRemoteModule from the federation runtime or a declared remote in the host config referenced by a dynamic import('catalog/Routes').
Two routing details bite people. First, the remote's internal routes must be relative, so /catalog/items works whether the remote is served standalone at its own port or nested under the host. Second, if the host and remote both configure a wildcard route, the first one registered wins; put the catch-all only in the shell. For deep links, confirm that opening directly in a fresh tab resolves—if it doesn't, the host's server fallback or the remote's baseHref is misconfigured.
You can mount a remote's component rather than its routes using the same dynamic import and rendering the component into a host-provided outlet. Routes are usually simpler and preserve the URL structure users expect.
Share state without tight coupling
The failure mode in micro frontends is shared mutable state that turns independent apps into a distributed monolith. Three patterns work:
Contracts through a shared library. Publish a small types-and-events package (or path alias) containing interfaces and event names. Each remote depends on the contract, not on the other remotes' internals. Keep the contract thin—types only, no runtime singletons—or you reintroduce coupling.
Custom events on the window. A remote dispatches window.dispatchEvent(new CustomEvent('cart:item-added', { detail })) and the shell listens. This is the loosest coupling and survives framework changes. It's also untyped unless you wrap it, so pair it with a typed helper in the contract package.
A shell-owned store behind a facade. The shell owns authentication and user identity; remotes request them through an injected facade or via an exposed service. This works but requires that the facade come from the shared singleton layer, not from a remote's bundle, or you'll get two instances.
Avoid sharing an NgRx store across remotes unless all remotes truly operate on the same state. Prefer remote-local state with event-driven synchronization at the boundaries—cart contents, authentication status, and locale are the usual cross-cutting concerns. A useful test: can a remote run standalone in development with mocked events? If not, the boundary is too tight.
Share dependencies correctly to avoid duplicate Angular
Sharing Angular is not optional. Two copies of the framework on a page produce broken dependency injection, duplicate change-detection zones, and confusing "injector not found" errors. In Webpack Module Federation, you declare shared: { '@angular/core': { singleton: true, strictVersion: true }, rxjs: { singleton: true } } and repeat for the other Angular packages. Native federation handles shared packages through its config and defaults to sharing the framework, but you must verify it.
Check success by inspecting loaded bundles in the network tab: there should be exactly one request for the Angular runtime chunk, not one per remote. Also check the host's federation config's shared section after a version bump—strictVersion can turn a well-intentioned upgrade into a hard runtime error, which is arguably correct behavior but should be anticipated by upgrading all apps together. Pin shared dependency versions across shell and remotes; a mismatch in a minor version of a shared library can surface as subtle runtime behavior differences rather than a clear error.
Deploy and version remotes independently
Deployment is where micro frontends earn their keep or collapse. The shell needs to know where each remote lives, so keep remote URLs in the shell's runtime configuration (a JSON file fetched at startup) rather than baked into the build. That way a remote can move hosts without rebuilding the shell.
Version compatibility is the hard problem. Because the shell and remotes share framework singletons, a remote built against a newer Angular major than the shell can break. Practical rules: track all apps to the same Angular major; deploy the shell's contract changes behind feature flags; and keep a rollback path for each remote. Remote entry files are typically served with cache headers that prevent stale manifests, while hashed assets can be cached aggressively—verify your CDN behavior, because a cached remoteEntry pointing at deleted chunks is a classic post-deploy white screen.
If your host loads a remote that's down, the whole route fails. Wrap remote loading in error handling: a catch that renders a fallback UI and logs the failure keeps the rest of the app usable. This is a real advantage of the architecture—one team's bad deploy need not take down the shell—but only if you've written the catch.
Test the seams, not just the apps
Unit tests inside a remote don't cover composition. Add three layers:
1: Contract tests. Assert that the remote's exposed routes module exports the shape the shell expects, and that event payload types match the shared contract package. 2: Integration tests with both apps running. A Playwright or Cypress run against the shell with remotes served, covering navigation into and out of each remote, deep links, and the fallback UI when a remote URL is deliberately broken. 3: Version-matrix smoke checks. In CI, build the shell against each supported remote version to catch shared-dependency mismatches before production.
Locally, serve remotes on fixed ports so the shell's dev config is stable, and run them with a single command in a monorepo (Nx's task orchestration or a concurrently script) so a new developer gets the whole system in one step.
Common failures and how to diagnose them
Symptom: blank shell with no error. Likely cause: the host's federation manifest doesn't resolve, or the remote URL is wrong. Reversible check: open the remote entry URL directly in a browser tab; confirm it returns the JSON or JS manifest, then recheck the host config.
Symptom: routing loops or the remote renders the shell's layout. Likely cause: the remote's routes include a route that redirects to a path the shell already owns, or the remote's base href is wrong. Check: serve the remote standalone and confirm its routes work there first.
Symptom: "NG0203: inject() must be called from an injection context" or duplicate service instances. Likely cause: Angular was bundled twice. Check: network tab for two framework chunks; fix shared config.
Symptom: styles from the remote leak into the shell. Likely cause: no style encapsulation strategy. Fix: use component-scoped or :host-scoped styles, or a shadow-DOM strategy for stronger isolation. Global stylesheet imports in remotes are the usual leak source.
Symptom: works locally, fails after deploy. Likely cause: stale cached remote entry or mismatched asset paths. Check: response headers on the remote entry file and the host's configured base URL.
Stop condition: if shared-dependency mismatches persist after aligning Angular versions and shared configs, the problem is architectural—usually two teams with incompatible release cadences sharing singletons. At that point, bring in the platform or architecture owner who owns the composition layer before attempting more configuration changes; further ad hoc patching tends to create a fragile setup that fails unpredictably.
When micro architecture is the wrong tool
Seriously consider stopping if the whole system is maintained by fewer than roughly two to three teams, if the page's performance budget is tight and small (every remote boundary adds a runtime request and coordination cost), or if the organization cannot commit to a version policy and a composition owner. The architecture is a team-scaling device; imposed on a single-team codebase, it adds indirection with no payoff. A well-structured single Angular app with feature folders, lazy routes, and a clean shared library captures most of the internal modularity benefits without the deployment complexity. Save micro frontends for where independent deployability genuinely removes a bottleneck.
The practical path is incremental: pick one low-risk slice (a settings area, an internal admin panel), build it as a remote, wire it through the shell, and run it for a release cycle before expanding. That first slice will expose your real contract, versioning, and fallback needs far faster than any design document.