# module-federation/module-federation-examples architecture

> Architecture diagram of the GitHub repository module-federation/module-federation-examples, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/module-federation/module-federation-examples
- Repository: https://github.com/module-federation/module-federation-examples

## Overview

This repository is a catalog of Module Federation examples, not one application. Its principal demonstrated workflow is a user selecting a remote component in a host, which loads it at runtime and renders it with loading and failure handling. Other examples explore synchronous remote imports, cross-framework and component sharing, routing, and server-side rendering. The graph highlights these product branches and a few concrete internal stages. Evidence is limited to the README and sampled source/index references; unsampled example wiring is not inferred.

Main entry points: [`advanced-api/dynamic-remotes-synchronous-imports/app1/src/App.tsx`](https://github.com/module-federation/module-federation-examples/blob/master/advanced-api/dynamic-remotes-synchronous-imports/app1/src/App.tsx) (Synchronous host), [`advanced-api/dynamic-remotes/app1/src/App.tsx`](https://github.com/module-federation/module-federation-examples/blob/master/advanced-api/dynamic-remotes/app1/src/App.tsx) (Dynamic host), [`comprehensive-demo-react16/app-01/src/pages/index-page.jsx`](https://github.com/module-federation/module-federation-examples/blob/master/comprehensive-demo-react16/app-01/src/pages/index-page.jsx) (Federated home), [`complete-react-case/component-app/App.jsx`](https://github.com/module-federation/module-federation-examples/blob/master/complete-react-case/component-app/App.jsx) (Component host)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dynamic["Dynamic remotes"]
  node_runtime_host["Dynamic host<br/>[App.tsx]"]
  node_plugin_setup["Runtime plugins<br/>[runtime-plugins.js]"]
  node_remote_apps["Remote apps<br/>[App.js]"]
  node_sync_host["Synchronous host<br/>[App.tsx]"]
  node_sync_config["Remote config<br/>[moduleConfig.js]"]
  node_sync_widget["Remote widget<br/>[Widget.js]"]
  node_sync_errors["Remote error handling<br/>[ErrorBoundary.tsx]"]
end

subgraph group_integration["Federation patterns"]
  node_component_host["Component host<br/>[App.jsx]"]
  node_shared_dialog["Shared dialog<br/>[Dialog.jsx]"]
  node_shared_button["Shared button<br/>[Button.jsx]"]
end

subgraph group_demos["Application demos"]
  node_demo_routes["Demo routes<br/>[Routes.jsx]"]
  node_demo_home["Federated home<br/>[index-page.jsx]"]
  node_demo_markdown["Markdown view<br/>[Markdown.jsx]"]
  node_demo_page["Page layout<br/>[Page.jsx]"]
  node_svelte_page["Svelte example<br/>[svelte-page.jsx]"]
end

subgraph group_rendering["Server rendering"]
  node_ssr_host["Angular SSR host<br/>[server.js]"]
  node_ssr_client["Angular client app<br/>[app.module.ts]"]
  node_ssr_remote["Apollo federated app<br/>[render.tsx]"]
end

node_user(("User"))

node_user -->|"selects remote"| node_runtime_host
node_runtime_host -->|"configures plugins"| node_plugin_setup
node_runtime_host -.->|"loads remote"| node_remote_apps
node_sync_host -->|"reads config"| node_sync_config
node_sync_host -->|"renders widget"| node_sync_widget
node_sync_host -->|"wraps remote"| node_sync_errors
node_component_host -->|"renders dialog"| node_shared_dialog
node_component_host -->|"renders button"| node_shared_button
node_demo_routes -->|"routes to"| node_demo_home
node_demo_home -->|"renders markdown"| node_demo_markdown
node_demo_home -->|"uses layout"| node_demo_page
node_demo_routes -->|"routes to"| node_svelte_page

click node_runtime_host "https://github.com/module-federation/module-federation-examples/blob/master/advanced-api/dynamic-remotes/app1/src/App.tsx"
click node_plugin_setup "https://github.com/module-federation/module-federation-examples/blob/master/advanced-api/dynamic-remotes/runtime-plugins.js"
click node_remote_apps "https://github.com/module-federation/module-federation-examples/blob/master/advanced-api/dynamic-remotes/app2/src/App.js"
click node_sync_host "https://github.com/module-federation/module-federation-examples/blob/master/advanced-api/dynamic-remotes-synchronous-imports/app1/src/App.tsx"
click node_sync_config "https://github.com/module-federation/module-federation-examples/blob/master/advanced-api/dynamic-remotes-synchronous-imports/moduleConfig.js"
click node_sync_widget "https://github.com/module-federation/module-federation-examples/blob/master/advanced-api/dynamic-remotes-synchronous-imports/app1/src/Widget.js"
click node_sync_errors "https://github.com/module-federation/module-federation-examples/blob/master/advanced-api/dynamic-remotes-synchronous-imports/app1/src/components/ErrorBoundary.tsx"
click node_component_host "https://github.com/module-federation/module-federation-examples/blob/master/complete-react-case/component-app/App.jsx"
click node_shared_dialog "https://github.com/module-federation/module-federation-examples/blob/master/complete-react-case/component-app/src/Dialog.jsx"
click node_shared_button "https://github.com/module-federation/module-federation-examples/blob/master/complete-react-case/component-app/src/Button.jsx"
click node_demo_routes "https://github.com/module-federation/module-federation-examples/blob/master/comprehensive-demo-react16/app-01/src/Routes.jsx"
click node_demo_home "https://github.com/module-federation/module-federation-examples/blob/master/comprehensive-demo-react16/app-01/src/pages/index-page.jsx"
click node_demo_markdown "https://github.com/module-federation/module-federation-examples/blob/master/comprehensive-demo-react16/app-01/src/Markdown.jsx"
click node_demo_page "https://github.com/module-federation/module-federation-examples/blob/master/comprehensive-demo-react16/app-01/src/Page.jsx"
click node_svelte_page "https://github.com/module-federation/module-federation-examples/blob/master/comprehensive-demo-react16/app-01/src/pages/svelte-page.jsx"
click node_ssr_host "https://github.com/module-federation/module-federation-examples/blob/master/angular-universal-ssr/host-app/server.js"
click node_ssr_client "https://github.com/module-federation/module-federation-examples/blob/master/angular-universal-ssr/client-app/src/app/app.module.ts"
click node_ssr_remote "https://github.com/module-federation/module-federation-examples/blob/master/apollo-client/app1/src/server/render.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_runtime_host,node_plugin_setup,node_remote_apps,node_sync_host,node_sync_config,node_sync_widget,node_sync_errors,node_user toneBlue
class node_component_host,node_shared_dialog,node_shared_button toneAmber
class node_demo_routes,node_demo_home,node_demo_markdown,node_demo_page,node_svelte_page toneMint
class node_ssr_host,node_ssr_client,node_ssr_remote toneRose
```

## Components

### Dynamic remotes

- [Dynamic host](https://github.com/module-federation/module-federation-examples/blob/master/advanced-api/dynamic-remotes/app1/src/App.tsx): `advanced-api/dynamic-remotes/app1/src/App.tsx`
- [Runtime plugins](https://github.com/module-federation/module-federation-examples/blob/master/advanced-api/dynamic-remotes/runtime-plugins.js): `advanced-api/dynamic-remotes/runtime-plugins.js`
- [Remote apps](https://github.com/module-federation/module-federation-examples/blob/master/advanced-api/dynamic-remotes/app2/src/App.js): `advanced-api/dynamic-remotes/app2/src/App.js`
- [Synchronous host](https://github.com/module-federation/module-federation-examples/blob/master/advanced-api/dynamic-remotes-synchronous-imports/app1/src/App.tsx): `advanced-api/dynamic-remotes-synchronous-imports/app1/src/App.tsx`
- [Remote config](https://github.com/module-federation/module-federation-examples/blob/master/advanced-api/dynamic-remotes-synchronous-imports/moduleConfig.js): `advanced-api/dynamic-remotes-synchronous-imports/moduleConfig.js`
- [Remote widget](https://github.com/module-federation/module-federation-examples/blob/master/advanced-api/dynamic-remotes-synchronous-imports/app1/src/Widget.js): `advanced-api/dynamic-remotes-synchronous-imports/app1/src/Widget.js`
- [Remote error handling](https://github.com/module-federation/module-federation-examples/blob/master/advanced-api/dynamic-remotes-synchronous-imports/app1/src/components/ErrorBoundary.tsx): `advanced-api/dynamic-remotes-synchronous-imports/app1/src/components/ErrorBoundary.tsx`

### Federation patterns

- [Component host](https://github.com/module-federation/module-federation-examples/blob/master/complete-react-case/component-app/App.jsx): `complete-react-case/component-app/App.jsx`
- [Shared dialog](https://github.com/module-federation/module-federation-examples/blob/master/complete-react-case/component-app/src/Dialog.jsx): `complete-react-case/component-app/src/Dialog.jsx`
- [Shared button](https://github.com/module-federation/module-federation-examples/blob/master/complete-react-case/component-app/src/Button.jsx): `complete-react-case/component-app/src/Button.jsx`

### Application demos

- [Demo routes](https://github.com/module-federation/module-federation-examples/blob/master/comprehensive-demo-react16/app-01/src/Routes.jsx): `comprehensive-demo-react16/app-01/src/Routes.jsx`
- [Federated home](https://github.com/module-federation/module-federation-examples/blob/master/comprehensive-demo-react16/app-01/src/pages/index-page.jsx): `comprehensive-demo-react16/app-01/src/pages/index-page.jsx`
- [Markdown view](https://github.com/module-federation/module-federation-examples/blob/master/comprehensive-demo-react16/app-01/src/Markdown.jsx): `comprehensive-demo-react16/app-01/src/Markdown.jsx`
- [Page layout](https://github.com/module-federation/module-federation-examples/blob/master/comprehensive-demo-react16/app-01/src/Page.jsx): `comprehensive-demo-react16/app-01/src/Page.jsx`
- [Svelte example](https://github.com/module-federation/module-federation-examples/blob/master/comprehensive-demo-react16/app-01/src/pages/svelte-page.jsx): `comprehensive-demo-react16/app-01/src/pages/svelte-page.jsx`

### Server rendering

- [Angular SSR host](https://github.com/module-federation/module-federation-examples/blob/master/angular-universal-ssr/host-app/server.js): `angular-universal-ssr/host-app/server.js`
- [Angular client app](https://github.com/module-federation/module-federation-examples/blob/master/angular-universal-ssr/client-app/src/app/app.module.ts): `angular-universal-ssr/client-app/src/app/app.module.ts`
- [Apollo federated app](https://github.com/module-federation/module-federation-examples/blob/master/apollo-client/app1/src/server/render.tsx): `apollo-client/app1/src/server/render.tsx`

### Other components

- **User**

## Connections

- User → Dynamic host: selects remote (evidence: `advanced-api/dynamic-remotes/app1/src/App.tsx`)
- Dynamic host → Runtime plugins: configures plugins (evidence: `advanced-api/dynamic-remotes/app1/src/App.tsx`)
- Dynamic host → Remote apps: loads remote
- Synchronous host → Remote config: reads config (evidence: `advanced-api/dynamic-remotes-synchronous-imports/app1/src/App.tsx`)
- Synchronous host → Remote widget: renders widget (evidence: `advanced-api/dynamic-remotes-synchronous-imports/app1/src/App.tsx`)
- Synchronous host → Remote error handling: wraps remote (evidence: `advanced-api/dynamic-remotes-synchronous-imports/app1/src/App.tsx`)
- Component host → Shared dialog: renders dialog (evidence: `complete-react-case/component-app/App.jsx`)
- Component host → Shared button: renders button (evidence: `complete-react-case/component-app/App.jsx`)
- Demo routes → Federated home: routes to (evidence: `comprehensive-demo-react16/app-01/src/Routes.jsx`)
- Federated home → Markdown view: renders markdown (evidence: `comprehensive-demo-react16/app-01/src/pages/index-page.jsx`)
- Federated home → Page layout: uses layout (evidence: `comprehensive-demo-react16/app-01/src/pages/index-page.jsx`)
- Demo routes → Svelte example: routes to (evidence: `comprehensive-demo-react16/app-01/src/Routes.jsx`)
