Sample Code - Micro Frontends in Action

October 9, 2025 ยท View on GitHub

This is the example code that goes along with the Manning book Micro Frontends in Action.

Hosted examples

You can interact with the running examples here:
https://the-tractor.store ๐Ÿšœ

Local machine

Prerequisites

  1. Clone this git repository or download & extract the zip to your local machine.

  2. Make sure you have Node.js (v18 or newer) installed.

    $ node -v
    v18.x.x
    
  3. Go into the main directory and install all required dependencies.

    cd micro-frontends-in-action-code
    npm install
    
  4. Install Nginx on your machine. The nginx executable only has to be present - no configuration required.

    • macOS (via Homebrew): brew install nginx
    • Debian/Ubuntu: sudo apt-get install nginx
    • Windows: Binaries included in this repository. No installation required.

    Five examples require Nginx:

    • 04_routing
    • 05_ssi
    • 06_timeouts_down
    • 16_universal
    • 18_asset_registration_include

Running the code

All examples involve starting up multiple applications which are owned by different teams. There is an NPM run for each directory. You can start examples like this: npm run [name_of_example].

The following command will start example #5:

npm run 05_ssi

The script starts all applications and shows a combined log output.
NOTE: Nginx stdout do not work on Windows.

console output

It waits until the servers are ready and opens the example page in your default browser.

example running in your browser

You can stop the example by hitting [CMD] + C in your terminal.

NOTE: The code should run on all platforms. However, if you're having troubles feel free to create an issue.

Folder structure and ports

Each example has its own folder (e.g. 05_ssi). Each example folder contains a subfolder that contains the actual application (e.g. nginx, decide, inspire).

Different port numbers are used to indicate ownership. This following table shows which teams owns which application. Make sure ports 3000 to 3003 are not allocated by another process on your machine.

PortTeamResponsibility
3000- shared -infrastructure (web-server, app shell)
3001Team Decideproduct page
3002Team Inspirehomepage, search, recommendations
3003Team Checkoutcart, checkout process

List of all examples

Here is a list of all run commands with a reference to the chapter they belong to.

run scriptnamechapter
npm run 01_pages_linksPages & Links2
npm run 02_iframeiFrames2
npm run 03_ajaxNamespaces3
npm run 04_routingServer-side Routing3
npm run 05_ssiServer-side Integration4
npm run 06_timeouts_down
npm run 06_timeouts_short_delay
npm run 06_timeouts_long_delay
Timeouts & Fallbacks4
npm run 07_podiumPodium4
npm run 08_web_componentsClient-side Composition5
npm run 09_shadow_domStyle Isolation & ShadowDOM5
npm run 10_parent_child_communicationParent-Child Communication6
npm run 11_child_parent_communicationChild-Parent Communication6
npm run 12_fragment_fragment_communicationFragment-Fragment Communication6
npm run 13_client_side_flat_routingClient-side Routing (Flat)7
npm run 14_client_side_two_level_routingClient-side Routing (Two-Tiered)7
npm run 15_single_spaSingle SPA7
npm run 16_universalUniversal Rendering8
npm run 17_asset_client_redirectAsset Client-side Redirect10
npm run 18_asset_registration_includeAsset Registration Include10
npm run 19_shared_vendor_webpack_dllShared Vendor Libraries via Webpack DLLPlugin11
npm run 20_shared_vendor_rollup_absolute_importsShared Vendor Libraries via Rollup.js and Absolute ES Module Imports11
npm run 21_local_developmentLocal Development14