Repository files navigation

Developer Experience Platform

TypeScriptReactModule FederationTurborepoQuality

DXP is a production-style Developer Experience Platform built to demonstrate how large engineering organizations compose independently owned frontend products into one governed internal platform.

It is not a single-page CRUD demo. It is a runtime-composed micro-frontend system with a Webpack 5 host shell, Rsbuild-powered remotes, a typed federation contract, registry-driven routing, RBAC, error isolation, observability hooks, shared design tokens, strict TypeScript, CI, and repeatable MFE scaffolding.

Why This Project Matters

Modern platform teams win by setting strong boundaries: product teams need autonomy, while the platform needs reliability, security, design consistency, and operational visibility. This repo models that tradeoff.

  • The shell owns platform concerns: authentication context, route orchestration, navigation chrome, RBAC, registry validation, remote loading, error boundaries, and telemetry.
  • MFEs own product concerns: feature flags, experiments, logs, API exploration, and documentation.
  • Shared packages define the contracts and primitives that keep the system coherent without coupling every team to every other team.
  • CI and local hooks enforce the basics: lint, type-check, tests, build, import hygiene, accessibility rules, and strict TypeScript.

System At A Glance

flowchart LR
Registry["Runtime registry.json\napps/registry"]
Shell["Shell host\nWebpack 5 + React Router"]
Loader["Dynamic federation loader\nscript injection + share scope init"]
Contracts["@dxp/federation-contracts\nTypeScript + Zod"]
UI["@dxp/ui\nRadix + Tailwind tokens"]
Obs["@dxp/observability\nSentry wrapper + load metrics"]
Flags["Feature Flags MFE\nport 3001"]
Experiments["Experiments MFE\nport 3002"]
Logs["Logs MFE\nport 3003"]
API["API Explorer MFE\nport 3004"]
Docs["Docs MFE\nport 3005"]
Registry --> Shell
Shell --> Loader
Loader --> Flags
Loader --> Experiments
Loader --> Logs
Loader --> API
Loader --> Docs
Contracts --> Shell
Contracts --> Flags
Contracts --> Experiments
Contracts --> Logs
Contracts --> API
Contracts --> Docs
UI --> Shell
UI --> Flags
UI --> Experiments
UI --> Logs
UI --> API
UI --> Docs
Obs --> Shell
Obs --> Logs
Loading

What It Demonstrates

AreaImplementation
Runtime compositionThe shell has an intentionally empty remotes map and loads every MFE from apps/registry/registry.json.
Team boundariesEach MFE exposes only ./App, implemented as a mount(container, props) contract.
Contract safety@dxp/federation-contracts exports TypeScript interfaces and Zod schemas used by the shell and remotes.
ResilienceRemote loading has a 10 second timeout, retry behavior, script cleanup, per-MFE error boundaries, and retry UI.
Access controlShell-level ProtectedRoute enforces registry permissions before mounting a remote.
Design consistency@dxp/ui provides reusable primitives and a shared Tailwind token preset.
ObservabilityMFE load performance is measured and forwarded through the Sentry wrapper package.
Developer velocitytools/create-mfe scaffolds a new remote with Rsbuild, Module Federation, tests, Tailwind, and contract wiring.
Quality gatesTurborepo orchestrates lint, type-check, tests, and builds across apps and packages.

Product Surfaces

AppRouteOwnership StoryHighlights
@dxp/shell/Platform hostRuntime registry fetch, dynamic routing, RBAC, layout, global and per-MFE error boundaries.
@dxp/mfe-feature-flags/flagsRelease engineeringFlag list, environment toggles, admin-only delete, immutable keys, Zod-validated create/update flows.
@dxp/mfe-experiments/experimentsProduct experimentationExperiment lifecycle, variant allocation validation, Recharts conversion analysis, p-value significance display.
@dxp/mfe-logs/logsObservability10,000 synthetic log entries, debounced filtering, cursor pagination, TanStack Virtual rendering, detail dialog.
@dxp/mfe-api-explorer/api-explorerInternal developer toolingMethod/path/header builder, Zod request validation, proxied request execution, response viewer, session-scoped history.
@dxp/mfe-docs/docsInternal docsZod-validated nested docs manifest, Fuse.js search, Markdown/GFM rendering, docs navigation tree.
@dxp/registry:4000/registry.jsonPlatform configSource of truth for routes, scopes, remote URLs, versions, permissions, and enabled state.

Runtime Composition Flow

When a user navigates to an MFE route, the shell follows a platform-controlled sequence:

  1. Fetch registry.json with @dxp/registry-client.
  2. Validate the registry with RegistrySchema from @dxp/federation-contracts.
  3. Filter navigation by enabled and permissions.
  4. Inject the remote remoteEntry.js script at route activation time.
  5. Initialize Webpack's default share scope.
  6. Resolve window[scope].get(module).
  7. Validate the remote's default export with MFEMountFnSchema.
  8. Mount the remote into an isolated container with auth, router, and theme context.
  9. Track load duration and isolate failures with an MFE-specific error boundary.
  10. Call unmount() on cleanup so React roots and theme state are released.

The shell can add, remove, disable, or retarget an MFE by changing registry config. No static remote import or shell route edit is required.

Monorepo Layout

.
+-- apps
| +-- shell # Webpack 5 Module Federation host
| +-- registry # Runtime registry.json served on port 4000
| +-- mfe-api-explorer # API testing tool remote
| +-- mfe-docs # Searchable documentation remote
| +-- mfe-experiments # Experiment management remote
| +-- mfe-feature-flags # Feature flag management remote
| +-- mfe-logs # Virtualized log exploration remote
+-- packages
| +-- auth-context # AuthProvider, useAuth, mock users, JWT-shaped tokens
| +-- federation-contracts # Cross-team MFE manifest and mount contract
| +-- observability # Sentry initialization, error capture, load metrics
| +-- registry-client # Registry fetch, retry, cache fallback, React Query hook
| +-- ui # Shared UI primitives, design tokens, Tailwind preset
| +-- eslint-config # Shared base/react/storybook lint config
| +-- prettier-config # Shared Prettier config
| +-- tsconfig-base # Strict TypeScript base config
+-- tools
+-- create-mfe # CLI for scaffolding new remotes

Tech Stack

LayerTechnology
LanguageTypeScript 5, strict mode, moduleResolution: bundler
UIReact 18, React Router 6, Tailwind CSS
Host bundlerWebpack 5 Module Federation
Remote bundlerRsbuild + @module-federation/rsbuild-plugin
Server stateTanStack Query
Runtime validationZod
Design primitivesRadix UI, class-variance-authority, shared DXP tokens
Charts and searchRecharts, Fuse.js
Large listsTanStack Virtual
ObservabilitySentry wrapper package
TestingVitest, React Testing Library, MSW where appropriate
Toolingpnpm workspaces, Turborepo, ESLint 9, Prettier, Lefthook

Getting Started

Requirements

  • Node.js 20+
  • pnpm 9+

Install

pnpm install

Run The Platform

pnpm dev

Open the shell at:

http://localhost:3000

Local services use these ports:

ServicePort
Shell3000
Feature Flags MFE3001
Experiments MFE3002
Logs MFE3003
API Explorer MFE3004
Docs MFE3005
Registry4000

If you want a smaller loop, run one workspace directly:

pnpm --filter @dxp/shell dev
pnpm --filter @dxp/mfe-feature-flags dev
pnpm --filter @dxp/registry dev

Common Commands

CommandWhat it does
pnpm devStarts all persistent dev servers through Turbo.
pnpm buildBuilds packages and applications in dependency order.
pnpm testRuns all test suites.
pnpm lintRuns ESLint across workspaces.
pnpm type-checkRuns TypeScript checks across workspaces.
pnpm formatFormats supported source, config, and Markdown files.
pnpm create-mfe <name> --port <port>Scaffolds a new Module Federation remote.

Creating A New MFE

pnpm create-mfe billing --port 3006

The scaffolded app includes:

  • rsbuild.config.ts with Module Federation remote config.
  • src/mount.tsx with the default MFEMountFn export.
  • src/App.tsx using a fresh QueryClient per mount.
  • MemoryRouter so the shell remains the URL owner.
  • Tailwind config extending @dxp/ui/tailwind.
  • Vitest config with 80% coverage thresholds.
  • Mock MFEProps and test setup.

To integrate it into the shell, add a registry entry:

{
"name": "billing",
"route": "/billing",
"scope": "billing",
"module": "./App",
"url": "http://localhost:3006/remoteEntry.js",
"permissions": ["admin", "dev"],
"enabled": true,
"version": "0.1.0",
"canaryPercent": 0
}

Quality Bar

This repo is intentionally strict because distributed frontends fail at boundaries.

  • TypeScript enables strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes, noImplicitReturns, and isolatedModules.
  • ESLint rejects any, non-null assertions, import cycles, duplicate imports, and common React/accessibility issues.
  • MFE test configs enforce 80% coverage thresholds for lines, functions, branches, and statements.
  • Each MFE includes a mount contract test so the shell can trust the remote boundary.
  • Registry and domain schemas are Zod-validated before data is trusted.
  • CI runs install, lint, type-check, tests, and build on pushes and pull requests to main and dev.
  • Lefthook runs formatting/linting before commit and type-check/tests before push.

Environment Variables

VariableDefaultPurpose
REGISTRY_URLhttp://localhost:4000/registry.jsonRegistry endpoint used by the shell.
SENTRY_DSNemptyEnables Sentry reporting when provided.
APP_ENVdevelopmentRuntime environment label.
APP_VERSION0.0.0Version label attached to the shell build.

Reviewer Notes

This project is designed to make senior engineering judgment visible:

  • It separates platform ownership from product ownership.
  • It treats runtime JSON, remote exports, storage, and forms as untrusted inputs.
  • It makes failure local instead of letting one remote take down the whole shell.
  • It avoids shared global MFE state by giving each remote an isolated router and query cache.
  • It encodes repeatability with scaffolding instead of relying on tribal knowledge.
  • It shows practical tradeoffs: runtime federation for independent delivery, shared packages for consistency, and schema validation at every boundary.

Current Roadmap

  • Add visual documentation for @dxp/ui components.
  • Expand end-to-end coverage around federation loading, RBAC, and API Explorer token safety.
  • Implement canary routing behavior for the modeled canaryPercent registry field.
  • Add generated architecture screenshots or a short demo recording for portfolio presentation.

About

Runtime-composable micro-frontend platform simulating large-scale frontend architecture. Independently deployed apps are dynamically discovered and orchestrated via a registry-driven system, enabling team autonomy, failure isolation, and scalable UI composition.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

Developer Experience Platform

TypeScriptReactModule FederationTurborepoQuality

DXP is a production-style Developer Experience Platform built to demonstrate how large engineering organizations compose independently owned frontend products into one governed internal platform.

It is not a single-page CRUD demo. It is a runtime-composed micro-frontend system with a Webpack 5 host shell, Rsbuild-powered remotes, a typed federation contract, registry-driven routing, RBAC, error isolation, observability hooks, shared design tokens, strict TypeScript, CI, and repeatable MFE scaffolding.

Why This Project Matters

Modern platform teams win by setting strong boundaries: product teams need autonomy, while the platform needs reliability, security, design consistency, and operational visibility. This repo models that tradeoff.

  • The shell owns platform concerns: authentication context, route orchestration, navigation chrome, RBAC, registry validation, remote loading, error boundaries, and telemetry.
  • MFEs own product concerns: feature flags, experiments, logs, API exploration, and documentation.
  • Shared packages define the contracts and primitives that keep the system coherent without coupling every team to every other team.
  • CI and local hooks enforce the basics: lint, type-check, tests, build, import hygiene, accessibility rules, and strict TypeScript.

System At A Glance

flowchart LR
Registry["Runtime registry.json\napps/registry"]
Shell["Shell host\nWebpack 5 + React Router"]
Loader["Dynamic federation loader\nscript injection + share scope init"]
Contracts["@dxp/federation-contracts\nTypeScript + Zod"]
UI["@dxp/ui\nRadix + Tailwind tokens"]
Obs["@dxp/observability\nSentry wrapper + load metrics"]
Flags["Feature Flags MFE\nport 3001"]
Experiments["Experiments MFE\nport 3002"]
Logs["Logs MFE\nport 3003"]
API["API Explorer MFE\nport 3004"]
Docs["Docs MFE\nport 3005"]
Registry --> Shell
Shell --> Loader
Loader --> Flags
Loader --> Experiments
Loader --> Logs
Loader --> API
Loader --> Docs
Contracts --> Shell
Contracts --> Flags
Contracts --> Experiments
Contracts --> Logs
Contracts --> API
Contracts --> Docs
UI --> Shell
UI --> Flags
UI --> Experiments
UI --> Logs
UI --> API
UI --> Docs
Obs --> Shell
Obs --> Logs
Loading

What It Demonstrates

AreaImplementation
Runtime compositionThe shell has an intentionally empty remotes map and loads every MFE from apps/registry/registry.json.
Team boundariesEach MFE exposes only ./App, implemented as a mount(container, props) contract.
Contract safety@dxp/federation-contracts exports TypeScript interfaces and Zod schemas used by the shell and remotes.
ResilienceRemote loading has a 10 second timeout, retry behavior, script cleanup, per-MFE error boundaries, and retry UI.
Access controlShell-level ProtectedRoute enforces registry permissions before mounting a remote.
Design consistency@dxp/ui provides reusable primitives and a shared Tailwind token preset.
ObservabilityMFE load performance is measured and forwarded through the Sentry wrapper package.
Developer velocitytools/create-mfe scaffolds a new remote with Rsbuild, Module Federation, tests, Tailwind, and contract wiring.
Quality gatesTurborepo orchestrates lint, type-check, tests, and builds across apps and packages.

Product Surfaces

AppRouteOwnership StoryHighlights
@dxp/shell/Platform hostRuntime registry fetch, dynamic routing, RBAC, layout, global and per-MFE error boundaries.
@dxp/mfe-feature-flags/flagsRelease engineeringFlag list, environment toggles, admin-only delete, immutable keys, Zod-validated create/update flows.
@dxp/mfe-experiments/experimentsProduct experimentationExperiment lifecycle, variant allocation validation, Recharts conversion analysis, p-value significance display.
@dxp/mfe-logs/logsObservability10,000 synthetic log entries, debounced filtering, cursor pagination, TanStack Virtual rendering, detail dialog.
@dxp/mfe-api-explorer/api-explorerInternal developer toolingMethod/path/header builder, Zod request validation, proxied request execution, response viewer, session-scoped history.
@dxp/mfe-docs/docsInternal docsZod-validated nested docs manifest, Fuse.js search, Markdown/GFM rendering, docs navigation tree.
@dxp/registry:4000/registry.jsonPlatform configSource of truth for routes, scopes, remote URLs, versions, permissions, and enabled state.

Runtime Composition Flow

When a user navigates to an MFE route, the shell follows a platform-controlled sequence:

  1. Fetch registry.json with @dxp/registry-client.
  2. Validate the registry with RegistrySchema from @dxp/federation-contracts.
  3. Filter navigation by enabled and permissions.
  4. Inject the remote remoteEntry.js script at route activation time.
  5. Initialize Webpack's default share scope.
  6. Resolve window[scope].get(module).
  7. Validate the remote's default export with MFEMountFnSchema.
  8. Mount the remote into an isolated container with auth, router, and theme context.
  9. Track load duration and isolate failures with an MFE-specific error boundary.
  10. Call unmount() on cleanup so React roots and theme state are released.

The shell can add, remove, disable, or retarget an MFE by changing registry config. No static remote import or shell route edit is required.

Monorepo Layout

.
+-- apps
| +-- shell # Webpack 5 Module Federation host
| +-- registry # Runtime registry.json served on port 4000
| +-- mfe-api-explorer # API testing tool remote
| +-- mfe-docs # Searchable documentation remote
| +-- mfe-experiments # Experiment management remote
| +-- mfe-feature-flags # Feature flag management remote
| +-- mfe-logs # Virtualized log exploration remote
+-- packages
| +-- auth-context # AuthProvider, useAuth, mock users, JWT-shaped tokens
| +-- federation-contracts # Cross-team MFE manifest and mount contract
| +-- observability # Sentry initialization, error capture, load metrics
| +-- registry-client # Registry fetch, retry, cache fallback, React Query hook
| +-- ui # Shared UI primitives, design tokens, Tailwind preset
| +-- eslint-config # Shared base/react/storybook lint config
| +-- prettier-config # Shared Prettier config
| +-- tsconfig-base # Strict TypeScript base config
+-- tools
+-- create-mfe # CLI for scaffolding new remotes

Tech Stack

LayerTechnology
LanguageTypeScript 5, strict mode, moduleResolution: bundler
UIReact 18, React Router 6, Tailwind CSS
Host bundlerWebpack 5 Module Federation
Remote bundlerRsbuild + @module-federation/rsbuild-plugin
Server stateTanStack Query
Runtime validationZod
Design primitivesRadix UI, class-variance-authority, shared DXP tokens
Charts and searchRecharts, Fuse.js
Large listsTanStack Virtual
ObservabilitySentry wrapper package
TestingVitest, React Testing Library, MSW where appropriate
Toolingpnpm workspaces, Turborepo, ESLint 9, Prettier, Lefthook

Getting Started

Requirements

  • Node.js 20+
  • pnpm 9+

Install

pnpm install

Run The Platform

pnpm dev

Open the shell at:

http://localhost:3000

Local services use these ports:

ServicePort
Shell3000
Feature Flags MFE3001
Experiments MFE3002
Logs MFE3003
API Explorer MFE3004
Docs MFE3005
Registry4000

If you want a smaller loop, run one workspace directly:

pnpm --filter @dxp/shell dev
pnpm --filter @dxp/mfe-feature-flags dev
pnpm --filter @dxp/registry dev

Common Commands

CommandWhat it does
pnpm devStarts all persistent dev servers through Turbo.
pnpm buildBuilds packages and applications in dependency order.
pnpm testRuns all test suites.
pnpm lintRuns ESLint across workspaces.
pnpm type-checkRuns TypeScript checks across workspaces.
pnpm formatFormats supported source, config, and Markdown files.
pnpm create-mfe <name> --port <port>Scaffolds a new Module Federation remote.

Creating A New MFE

pnpm create-mfe billing --port 3006

The scaffolded app includes:

  • rsbuild.config.ts with Module Federation remote config.
  • src/mount.tsx with the default MFEMountFn export.
  • src/App.tsx using a fresh QueryClient per mount.
  • MemoryRouter so the shell remains the URL owner.
  • Tailwind config extending @dxp/ui/tailwind.
  • Vitest config with 80% coverage thresholds.
  • Mock MFEProps and test setup.

To integrate it into the shell, add a registry entry:

{
"name": "billing",
"route": "/billing",
"scope": "billing",
"module": "./App",
"url": "http://localhost:3006/remoteEntry.js",
"permissions": ["admin", "dev"],
"enabled": true,
"version": "0.1.0",
"canaryPercent": 0
}

Quality Bar

This repo is intentionally strict because distributed frontends fail at boundaries.

  • TypeScript enables strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes, noImplicitReturns, and isolatedModules.
  • ESLint rejects any, non-null assertions, import cycles, duplicate imports, and common React/accessibility issues.
  • MFE test configs enforce 80% coverage thresholds for lines, functions, branches, and statements.
  • Each MFE includes a mount contract test so the shell can trust the remote boundary.
  • Registry and domain schemas are Zod-validated before data is trusted.
  • CI runs install, lint, type-check, tests, and build on pushes and pull requests to main and dev.
  • Lefthook runs formatting/linting before commit and type-check/tests before push.

Environment Variables

VariableDefaultPurpose
REGISTRY_URLhttp://localhost:4000/registry.jsonRegistry endpoint used by the shell.
SENTRY_DSNemptyEnables Sentry reporting when provided.
APP_ENVdevelopmentRuntime environment label.
APP_VERSION0.0.0Version label attached to the shell build.

Reviewer Notes

This project is designed to make senior engineering judgment visible:

  • It separates platform ownership from product ownership.
  • It treats runtime JSON, remote exports, storage, and forms as untrusted inputs.
  • It makes failure local instead of letting one remote take down the whole shell.
  • It avoids shared global MFE state by giving each remote an isolated router and query cache.
  • It encodes repeatability with scaffolding instead of relying on tribal knowledge.
  • It shows practical tradeoffs: runtime federation for independent delivery, shared packages for consistency, and schema validation at every boundary.

Current Roadmap

  • Add visual documentation for @dxp/ui components.
  • Expand end-to-end coverage around federation loading, RBAC, and API Explorer token safety.
  • Implement canary routing behavior for the modeled canaryPercent registry field.
  • Add generated architecture screenshots or a short demo recording for portfolio presentation.

About

Runtime-composable micro-frontend platform simulating large-scale frontend architecture. Independently deployed apps are dynamically discovered and orchestrated via a registry-driven system, enabling team autonomy, failure isolation, and scalable UI composition.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Developer Experience Platform

TypeScriptReactModule FederationTurborepoQuality

DXP is a production-style Developer Experience Platform built to demonstrate how large engineering organizations compose independently owned frontend products into one governed internal platform.

It is not a single-page CRUD demo. It is a runtime-composed micro-frontend system with a Webpack 5 host shell, Rsbuild-powered remotes, a typed federation contract, registry-driven routing, RBAC, error isolation, observability hooks, shared design tokens, strict TypeScript, CI, and repeatable MFE scaffolding.

Why This Project Matters

Modern platform teams win by setting strong boundaries: product teams need autonomy, while the platform needs reliability, security, design consistency, and operational visibility. This repo models that tradeoff.

  • The shell owns platform concerns: authentication context, route orchestration, navigation chrome, RBAC, registry validation, remote loading, error boundaries, and telemetry.
  • MFEs own product concerns: feature flags, experiments, logs, API exploration, and documentation.
  • Shared packages define the contracts and primitives that keep the system coherent without coupling every team to every other team.
  • CI and local hooks enforce the basics: lint, type-check, tests, build, import hygiene, accessibility rules, and strict TypeScript.

System At A Glance

flowchart LR
Registry["Runtime registry.json\napps/registry"]
Shell["Shell host\nWebpack 5 + React Router"]
Loader["Dynamic federation loader\nscript injection + share scope init"]
Contracts["@dxp/federation-contracts\nTypeScript + Zod"]
UI["@dxp/ui\nRadix + Tailwind tokens"]
Obs["@dxp/observability\nSentry wrapper + load metrics"]
Flags["Feature Flags MFE\nport 3001"]
Experiments["Experiments MFE\nport 3002"]
Logs["Logs MFE\nport 3003"]
API["API Explorer MFE\nport 3004"]
Docs["Docs MFE\nport 3005"]
Registry --> Shell
Shell --> Loader
Loader --> Flags
Loader --> Experiments
Loader --> Logs
Loader --> API
Loader --> Docs
Contracts --> Shell
Contracts --> Flags
Contracts --> Experiments
Contracts --> Logs
Contracts --> API
Contracts --> Docs
UI --> Shell
UI --> Flags
UI --> Experiments
UI --> Logs
UI --> API
UI --> Docs
Obs --> Shell
Obs --> Logs
Loading

What It Demonstrates

AreaImplementation
Runtime compositionThe shell has an intentionally empty remotes map and loads every MFE from apps/registry/registry.json.
Team boundariesEach MFE exposes only ./App, implemented as a mount(container, props) contract.
Contract safety@dxp/federation-contracts exports TypeScript interfaces and Zod schemas used by the shell and remotes.
ResilienceRemote loading has a 10 second timeout, retry behavior, script cleanup, per-MFE error boundaries, and retry UI.
Access controlShell-level ProtectedRoute enforces registry permissions before mounting a remote.
Design consistency@dxp/ui provides reusable primitives and a shared Tailwind token preset.
ObservabilityMFE load performance is measured and forwarded through the Sentry wrapper package.
Developer velocitytools/create-mfe scaffolds a new remote with Rsbuild, Module Federation, tests, Tailwind, and contract wiring.
Quality gatesTurborepo orchestrates lint, type-check, tests, and builds across apps and packages.

Product Surfaces

AppRouteOwnership StoryHighlights
@dxp/shell/Platform hostRuntime registry fetch, dynamic routing, RBAC, layout, global and per-MFE error boundaries.
@dxp/mfe-feature-flags/flagsRelease engineeringFlag list, environment toggles, admin-only delete, immutable keys, Zod-validated create/update flows.
@dxp/mfe-experiments/experimentsProduct experimentationExperiment lifecycle, variant allocation validation, Recharts conversion analysis, p-value significance display.
@dxp/mfe-logs/logsObservability10,000 synthetic log entries, debounced filtering, cursor pagination, TanStack Virtual rendering, detail dialog.
@dxp/mfe-api-explorer/api-explorerInternal developer toolingMethod/path/header builder, Zod request validation, proxied request execution, response viewer, session-scoped history.
@dxp/mfe-docs/docsInternal docsZod-validated nested docs manifest, Fuse.js search, Markdown/GFM rendering, docs navigation tree.
@dxp/registry:4000/registry.jsonPlatform configSource of truth for routes, scopes, remote URLs, versions, permissions, and enabled state.

Runtime Composition Flow

When a user navigates to an MFE route, the shell follows a platform-controlled sequence:

  1. Fetch registry.json with @dxp/registry-client.
  2. Validate the registry with RegistrySchema from @dxp/federation-contracts.
  3. Filter navigation by enabled and permissions.
  4. Inject the remote remoteEntry.js script at route activation time.
  5. Initialize Webpack's default share scope.
  6. Resolve window[scope].get(module).
  7. Validate the remote's default export with MFEMountFnSchema.
  8. Mount the remote into an isolated container with auth, router, and theme context.
  9. Track load duration and isolate failures with an MFE-specific error boundary.
  10. Call unmount() on cleanup so React roots and theme state are released.

The shell can add, remove, disable, or retarget an MFE by changing registry config. No static remote import or shell route edit is required.

Monorepo Layout

.
+-- apps
| +-- shell # Webpack 5 Module Federation host
| +-- registry # Runtime registry.json served on port 4000
| +-- mfe-api-explorer # API testing tool remote
| +-- mfe-docs # Searchable documentation remote
| +-- mfe-experiments # Experiment management remote
| +-- mfe-feature-flags # Feature flag management remote
| +-- mfe-logs # Virtualized log exploration remote
+-- packages
| +-- auth-context # AuthProvider, useAuth, mock users, JWT-shaped tokens
| +-- federation-contracts # Cross-team MFE manifest and mount contract
| +-- observability # Sentry initialization, error capture, load metrics
| +-- registry-client # Registry fetch, retry, cache fallback, React Query hook
| +-- ui # Shared UI primitives, design tokens, Tailwind preset
| +-- eslint-config # Shared base/react/storybook lint config
| +-- prettier-config # Shared Prettier config
| +-- tsconfig-base # Strict TypeScript base config
+-- tools
+-- create-mfe # CLI for scaffolding new remotes

Tech Stack

LayerTechnology
LanguageTypeScript 5, strict mode, moduleResolution: bundler
UIReact 18, React Router 6, Tailwind CSS
Host bundlerWebpack 5 Module Federation
Remote bundlerRsbuild + @module-federation/rsbuild-plugin
Server stateTanStack Query
Runtime validationZod
Design primitivesRadix UI, class-variance-authority, shared DXP tokens
Charts and searchRecharts, Fuse.js
Large listsTanStack Virtual
ObservabilitySentry wrapper package
TestingVitest, React Testing Library, MSW where appropriate
Toolingpnpm workspaces, Turborepo, ESLint 9, Prettier, Lefthook

Getting Started

Requirements

  • Node.js 20+
  • pnpm 9+

Install

pnpm install

Run The Platform

pnpm dev

Open the shell at:

http://localhost:3000

Local services use these ports:

ServicePort
Shell3000
Feature Flags MFE3001
Experiments MFE3002
Logs MFE3003
API Explorer MFE3004
Docs MFE3005
Registry4000

If you want a smaller loop, run one workspace directly:

pnpm --filter @dxp/shell dev
pnpm --filter @dxp/mfe-feature-flags dev
pnpm --filter @dxp/registry dev

Common Commands

CommandWhat it does
pnpm devStarts all persistent dev servers through Turbo.
pnpm buildBuilds packages and applications in dependency order.
pnpm testRuns all test suites.
pnpm lintRuns ESLint across workspaces.
pnpm type-checkRuns TypeScript checks across workspaces.
pnpm formatFormats supported source, config, and Markdown files.
pnpm create-mfe <name> --port <port>Scaffolds a new Module Federation remote.

Creating A New MFE

pnpm create-mfe billing --port 3006

The scaffolded app includes:

  • rsbuild.config.ts with Module Federation remote config.
  • src/mount.tsx with the default MFEMountFn export.
  • src/App.tsx using a fresh QueryClient per mount.
  • MemoryRouter so the shell remains the URL owner.
  • Tailwind config extending @dxp/ui/tailwind.
  • Vitest config with 80% coverage thresholds.
  • Mock MFEProps and test setup.

To integrate it into the shell, add a registry entry:

{
"name": "billing",
"route": "/billing",
"scope": "billing",
"module": "./App",
"url": "http://localhost:3006/remoteEntry.js",
"permissions": ["admin", "dev"],
"enabled": true,
"version": "0.1.0",
"canaryPercent": 0
}

Quality Bar

This repo is intentionally strict because distributed frontends fail at boundaries.

  • TypeScript enables strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes, noImplicitReturns, and isolatedModules.
  • ESLint rejects any, non-null assertions, import cycles, duplicate imports, and common React/accessibility issues.
  • MFE test configs enforce 80% coverage thresholds for lines, functions, branches, and statements.
  • Each MFE includes a mount contract test so the shell can trust the remote boundary.
  • Registry and domain schemas are Zod-validated before data is trusted.
  • CI runs install, lint, type-check, tests, and build on pushes and pull requests to main and dev.
  • Lefthook runs formatting/linting before commit and type-check/tests before push.

Environment Variables

VariableDefaultPurpose
REGISTRY_URLhttp://localhost:4000/registry.jsonRegistry endpoint used by the shell.
SENTRY_DSNemptyEnables Sentry reporting when provided.
APP_ENVdevelopmentRuntime environment label.
APP_VERSION0.0.0Version label attached to the shell build.

Reviewer Notes

This project is designed to make senior engineering judgment visible:

  • It separates platform ownership from product ownership.
  • It treats runtime JSON, remote exports, storage, and forms as untrusted inputs.
  • It makes failure local instead of letting one remote take down the whole shell.
  • It avoids shared global MFE state by giving each remote an isolated router and query cache.
  • It encodes repeatability with scaffolding instead of relying on tribal knowledge.
  • It shows practical tradeoffs: runtime federation for independent delivery, shared packages for consistency, and schema validation at every boundary.

Current Roadmap

  • Add visual documentation for @dxp/ui components.
  • Expand end-to-end coverage around federation loading, RBAC, and API Explorer token safety.
  • Implement canary routing behavior for the modeled canaryPercent registry field.
  • Add generated architecture screenshots or a short demo recording for portfolio presentation.

About

Runtime-composable micro-frontend platform simulating large-scale frontend architecture. Independently deployed apps are dynamically discovered and orchestrated via a registry-driven system, enabling team autonomy, failure isolation, and scalable UI composition.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Developer Experience Platform

TypeScriptReactModule FederationTurborepoQuality

DXP is a production-style Developer Experience Platform built to demonstrate how large engineering organizations compose independently owned frontend products into one governed internal platform.

It is not a single-page CRUD demo. It is a runtime-composed micro-frontend system with a Webpack 5 host shell, Rsbuild-powered remotes, a typed federation contract, registry-driven routing, RBAC, error isolation, observability hooks, shared design tokens, strict TypeScript, CI, and repeatable MFE scaffolding.

Why This Project Matters

Modern platform teams win by setting strong boundaries: product teams need autonomy, while the platform needs reliability, security, design consistency, and operational visibility. This repo models that tradeoff.

  • The shell owns platform concerns: authentication context, route orchestration, navigation chrome, RBAC, registry validation, remote loading, error boundaries, and telemetry.
  • MFEs own product concerns: feature flags, experiments, logs, API exploration, and documentation.
  • Shared packages define the contracts and primitives that keep the system coherent without coupling every team to every other team.
  • CI and local hooks enforce the basics: lint, type-check, tests, build, import hygiene, accessibility rules, and strict TypeScript.

System At A Glance

flowchart LR
Registry["Runtime registry.json\napps/registry"]
Shell["Shell host\nWebpack 5 + React Router"]
Loader["Dynamic federation loader\nscript injection + share scope init"]
Contracts["@dxp/federation-contracts\nTypeScript + Zod"]
UI["@dxp/ui\nRadix + Tailwind tokens"]
Obs["@dxp/observability\nSentry wrapper + load metrics"]
Flags["Feature Flags MFE\nport 3001"]
Experiments["Experiments MFE\nport 3002"]
Logs["Logs MFE\nport 3003"]
API["API Explorer MFE\nport 3004"]
Docs["Docs MFE\nport 3005"]
Registry --> Shell
Shell --> Loader
Loader --> Flags
Loader --> Experiments
Loader --> Logs
Loader --> API
Loader --> Docs
Contracts --> Shell
Contracts --> Flags
Contracts --> Experiments
Contracts --> Logs
Contracts --> API
Contracts --> Docs
UI --> Shell
UI --> Flags
UI --> Experiments
UI --> Logs
UI --> API
UI --> Docs
Obs --> Shell
Obs --> Logs
Loading

What It Demonstrates

AreaImplementation
Runtime compositionThe shell has an intentionally empty remotes map and loads every MFE from apps/registry/registry.json.
Team boundariesEach MFE exposes only ./App, implemented as a mount(container, props) contract.
Contract safety@dxp/federation-contracts exports TypeScript interfaces and Zod schemas used by the shell and remotes.
ResilienceRemote loading has a 10 second timeout, retry behavior, script cleanup, per-MFE error boundaries, and retry UI.
Access controlShell-level ProtectedRoute enforces registry permissions before mounting a remote.
Design consistency@dxp/ui provides reusable primitives and a shared Tailwind token preset.
ObservabilityMFE load performance is measured and forwarded through the Sentry wrapper package.
Developer velocitytools/create-mfe scaffolds a new remote with Rsbuild, Module Federation, tests, Tailwind, and contract wiring.
Quality gatesTurborepo orchestrates lint, type-check, tests, and builds across apps and packages.

Product Surfaces

AppRouteOwnership StoryHighlights
@dxp/shell/Platform hostRuntime registry fetch, dynamic routing, RBAC, layout, global and per-MFE error boundaries.
@dxp/mfe-feature-flags/flagsRelease engineeringFlag list, environment toggles, admin-only delete, immutable keys, Zod-validated create/update flows.
@dxp/mfe-experiments/experimentsProduct experimentationExperiment lifecycle, variant allocation validation, Recharts conversion analysis, p-value significance display.
@dxp/mfe-logs/logsObservability10,000 synthetic log entries, debounced filtering, cursor pagination, TanStack Virtual rendering, detail dialog.
@dxp/mfe-api-explorer/api-explorerInternal developer toolingMethod/path/header builder, Zod request validation, proxied request execution, response viewer, session-scoped history.
@dxp/mfe-docs/docsInternal docsZod-validated nested docs manifest, Fuse.js search, Markdown/GFM rendering, docs navigation tree.
@dxp/registry:4000/registry.jsonPlatform configSource of truth for routes, scopes, remote URLs, versions, permissions, and enabled state.

Runtime Composition Flow

When a user navigates to an MFE route, the shell follows a platform-controlled sequence:

  1. Fetch registry.json with @dxp/registry-client.
  2. Validate the registry with RegistrySchema from @dxp/federation-contracts.
  3. Filter navigation by enabled and permissions.
  4. Inject the remote remoteEntry.js script at route activation time.
  5. Initialize Webpack's default share scope.
  6. Resolve window[scope].get(module).
  7. Validate the remote's default export with MFEMountFnSchema.
  8. Mount the remote into an isolated container with auth, router, and theme context.
  9. Track load duration and isolate failures with an MFE-specific error boundary.
  10. Call unmount() on cleanup so React roots and theme state are released.

The shell can add, remove, disable, or retarget an MFE by changing registry config. No static remote import or shell route edit is required.

Monorepo Layout

.
+-- apps
| +-- shell # Webpack 5 Module Federation host
| +-- registry # Runtime registry.json served on port 4000
| +-- mfe-api-explorer # API testing tool remote
| +-- mfe-docs # Searchable documentation remote
| +-- mfe-experiments # Experiment management remote
| +-- mfe-feature-flags # Feature flag management remote
| +-- mfe-logs # Virtualized log exploration remote
+-- packages
| +-- auth-context # AuthProvider, useAuth, mock users, JWT-shaped tokens
| +-- federation-contracts # Cross-team MFE manifest and mount contract
| +-- observability # Sentry initialization, error capture, load metrics
| +-- registry-client # Registry fetch, retry, cache fallback, React Query hook
| +-- ui # Shared UI primitives, design tokens, Tailwind preset
| +-- eslint-config # Shared base/react/storybook lint config
| +-- prettier-config # Shared Prettier config
| +-- tsconfig-base # Strict TypeScript base config
+-- tools
+-- create-mfe # CLI for scaffolding new remotes

Tech Stack

LayerTechnology
LanguageTypeScript 5, strict mode, moduleResolution: bundler
UIReact 18, React Router 6, Tailwind CSS
Host bundlerWebpack 5 Module Federation
Remote bundlerRsbuild + @module-federation/rsbuild-plugin
Server stateTanStack Query
Runtime validationZod
Design primitivesRadix UI, class-variance-authority, shared DXP tokens
Charts and searchRecharts, Fuse.js
Large listsTanStack Virtual
ObservabilitySentry wrapper package
TestingVitest, React Testing Library, MSW where appropriate
Toolingpnpm workspaces, Turborepo, ESLint 9, Prettier, Lefthook

Getting Started

Requirements

  • Node.js 20+
  • pnpm 9+

Install

pnpm install

Run The Platform

pnpm dev

Open the shell at:

http://localhost:3000

Local services use these ports:

ServicePort
Shell3000
Feature Flags MFE3001
Experiments MFE3002
Logs MFE3003
API Explorer MFE3004
Docs MFE3005
Registry4000

If you want a smaller loop, run one workspace directly:

pnpm --filter @dxp/shell dev
pnpm --filter @dxp/mfe-feature-flags dev
pnpm --filter @dxp/registry dev

Common Commands

CommandWhat it does
pnpm devStarts all persistent dev servers through Turbo.
pnpm buildBuilds packages and applications in dependency order.
pnpm testRuns all test suites.
pnpm lintRuns ESLint across workspaces.
pnpm type-checkRuns TypeScript checks across workspaces.
pnpm formatFormats supported source, config, and Markdown files.
pnpm create-mfe <name> --port <port>Scaffolds a new Module Federation remote.

Creating A New MFE

pnpm create-mfe billing --port 3006

The scaffolded app includes:

  • rsbuild.config.ts with Module Federation remote config.
  • src/mount.tsx with the default MFEMountFn export.
  • src/App.tsx using a fresh QueryClient per mount.
  • MemoryRouter so the shell remains the URL owner.
  • Tailwind config extending @dxp/ui/tailwind.
  • Vitest config with 80% coverage thresholds.
  • Mock MFEProps and test setup.

To integrate it into the shell, add a registry entry:

{
"name": "billing",
"route": "/billing",
"scope": "billing",
"module": "./App",
"url": "http://localhost:3006/remoteEntry.js",
"permissions": ["admin", "dev"],
"enabled": true,
"version": "0.1.0",
"canaryPercent": 0
}

Quality Bar

This repo is intentionally strict because distributed frontends fail at boundaries.

  • TypeScript enables strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes, noImplicitReturns, and isolatedModules.
  • ESLint rejects any, non-null assertions, import cycles, duplicate imports, and common React/accessibility issues.
  • MFE test configs enforce 80% coverage thresholds for lines, functions, branches, and statements.
  • Each MFE includes a mount contract test so the shell can trust the remote boundary.
  • Registry and domain schemas are Zod-validated before data is trusted.
  • CI runs install, lint, type-check, tests, and build on pushes and pull requests to main and dev.
  • Lefthook runs formatting/linting before commit and type-check/tests before push.

Environment Variables

VariableDefaultPurpose
REGISTRY_URLhttp://localhost:4000/registry.jsonRegistry endpoint used by the shell.
SENTRY_DSNemptyEnables Sentry reporting when provided.
APP_ENVdevelopmentRuntime environment label.
APP_VERSION0.0.0Version label attached to the shell build.

Reviewer Notes

This project is designed to make senior engineering judgment visible:

  • It separates platform ownership from product ownership.
  • It treats runtime JSON, remote exports, storage, and forms as untrusted inputs.
  • It makes failure local instead of letting one remote take down the whole shell.
  • It avoids shared global MFE state by giving each remote an isolated router and query cache.
  • It encodes repeatability with scaffolding instead of relying on tribal knowledge.
  • It shows practical tradeoffs: runtime federation for independent delivery, shared packages for consistency, and schema validation at every boundary.

Current Roadmap

  • Add visual documentation for @dxp/ui components.
  • Expand end-to-end coverage around federation loading, RBAC, and API Explorer token safety.
  • Implement canary routing behavior for the modeled canaryPercent registry field.
  • Add generated architecture screenshots or a short demo recording for portfolio presentation.

About

Runtime-composable micro-frontend platform simulating large-scale frontend architecture. Independently deployed apps are dynamically discovered and orchestrated via a registry-driven system, enabling team autonomy, failure isolation, and scalable UI composition.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

Developer Experience Platform

TypeScriptReactModule FederationTurborepoQuality

DXP is a production-style Developer Experience Platform built to demonstrate how large engineering organizations compose independently owned frontend products into one governed internal platform.

It is not a single-page CRUD demo. It is a runtime-composed micro-frontend system with a Webpack 5 host shell, Rsbuild-powered remotes, a typed federation contract, registry-driven routing, RBAC, error isolation, observability hooks, shared design tokens, strict TypeScript, CI, and repeatable MFE scaffolding.

Why This Project Matters

Modern platform teams win by setting strong boundaries: product teams need autonomy, while the platform needs reliability, security, design consistency, and operational visibility. This repo models that tradeoff.

  • The shell owns platform concerns: authentication context, route orchestration, navigation chrome, RBAC, registry validation, remote loading, error boundaries, and telemetry.
  • MFEs own product concerns: feature flags, experiments, logs, API exploration, and documentation.
  • Shared packages define the contracts and primitives that keep the system coherent without coupling every team to every other team.
  • CI and local hooks enforce the basics: lint, type-check, tests, build, import hygiene, accessibility rules, and strict TypeScript.

System At A Glance

flowchart LR
Registry["Runtime registry.json\napps/registry"]
Shell["Shell host\nWebpack 5 + React Router"]
Loader["Dynamic federation loader\nscript injection + share scope init"]
Contracts["@dxp/federation-contracts\nTypeScript + Zod"]
UI["@dxp/ui\nRadix + Tailwind tokens"]
Obs["@dxp/observability\nSentry wrapper + load metrics"]
Flags["Feature Flags MFE\nport 3001"]
Experiments["Experiments MFE\nport 3002"]
Logs["Logs MFE\nport 3003"]
API["API Explorer MFE\nport 3004"]
Docs["Docs MFE\nport 3005"]
Registry --> Shell
Shell --> Loader
Loader --> Flags
Loader --> Experiments
Loader --> Logs
Loader --> API
Loader --> Docs
Contracts --> Shell
Contracts --> Flags
Contracts --> Experiments
Contracts --> Logs
Contracts --> API
Contracts --> Docs
UI --> Shell
UI --> Flags
UI --> Experiments
UI --> Logs
UI --> API
UI --> Docs
Obs --> Shell
Obs --> Logs
Loading

What It Demonstrates

AreaImplementation
Runtime compositionThe shell has an intentionally empty remotes map and loads every MFE from apps/registry/registry.json.
Team boundariesEach MFE exposes only ./App, implemented as a mount(container, props) contract.
Contract safety@dxp/federation-contracts exports TypeScript interfaces and Zod schemas used by the shell and remotes.
ResilienceRemote loading has a 10 second timeout, retry behavior, script cleanup, per-MFE error boundaries, and retry UI.
Access controlShell-level ProtectedRoute enforces registry permissions before mounting a remote.
Design consistency@dxp/ui provides reusable primitives and a shared Tailwind token preset.
ObservabilityMFE load performance is measured and forwarded through the Sentry wrapper package.
Developer velocitytools/create-mfe scaffolds a new remote with Rsbuild, Module Federation, tests, Tailwind, and contract wiring.
Quality gatesTurborepo orchestrates lint, type-check, tests, and builds across apps and packages.

Product Surfaces

AppRouteOwnership StoryHighlights
@dxp/shell/Platform hostRuntime registry fetch, dynamic routing, RBAC, layout, global and per-MFE error boundaries.
@dxp/mfe-feature-flags/flagsRelease engineeringFlag list, environment toggles, admin-only delete, immutable keys, Zod-validated create/update flows.
@dxp/mfe-experiments/experimentsProduct experimentationExperiment lifecycle, variant allocation validation, Recharts conversion analysis, p-value significance display.
@dxp/mfe-logs/logsObservability10,000 synthetic log entries, debounced filtering, cursor pagination, TanStack Virtual rendering, detail dialog.
@dxp/mfe-api-explorer/api-explorerInternal developer toolingMethod/path/header builder, Zod request validation, proxied request execution, response viewer, session-scoped history.
@dxp/mfe-docs/docsInternal docsZod-validated nested docs manifest, Fuse.js search, Markdown/GFM rendering, docs navigation tree.
@dxp/registry:4000/registry.jsonPlatform configSource of truth for routes, scopes, remote URLs, versions, permissions, and enabled state.

Runtime Composition Flow

When a user navigates to an MFE route, the shell follows a platform-controlled sequence:

  1. Fetch registry.json with @dxp/registry-client.
  2. Validate the registry with RegistrySchema from @dxp/federation-contracts.
  3. Filter navigation by enabled and permissions.
  4. Inject the remote remoteEntry.js script at route activation time.
  5. Initialize Webpack's default share scope.
  6. Resolve window[scope].get(module).
  7. Validate the remote's default export with MFEMountFnSchema.
  8. Mount the remote into an isolated container with auth, router, and theme context.
  9. Track load duration and isolate failures with an MFE-specific error boundary.
  10. Call unmount() on cleanup so React roots and theme state are released.

The shell can add, remove, disable, or retarget an MFE by changing registry config. No static remote import or shell route edit is required.

Monorepo Layout

.
+-- apps
| +-- shell # Webpack 5 Module Federation host
| +-- registry # Runtime registry.json served on port 4000
| +-- mfe-api-explorer # API testing tool remote
| +-- mfe-docs # Searchable documentation remote
| +-- mfe-experiments # Experiment management remote
| +-- mfe-feature-flags # Feature flag management remote
| +-- mfe-logs # Virtualized log exploration remote
+-- packages
| +-- auth-context # AuthProvider, useAuth, mock users, JWT-shaped tokens
| +-- federation-contracts # Cross-team MFE manifest and mount contract
| +-- observability # Sentry initialization, error capture, load metrics
| +-- registry-client # Registry fetch, retry, cache fallback, React Query hook
| +-- ui # Shared UI primitives, design tokens, Tailwind preset
| +-- eslint-config # Shared base/react/storybook lint config
| +-- prettier-config # Shared Prettier config
| +-- tsconfig-base # Strict TypeScript base config
+-- tools
+-- create-mfe # CLI for scaffolding new remotes

Tech Stack

LayerTechnology
LanguageTypeScript 5, strict mode, moduleResolution: bundler
UIReact 18, React Router 6, Tailwind CSS
Host bundlerWebpack 5 Module Federation
Remote bundlerRsbuild + @module-federation/rsbuild-plugin
Server stateTanStack Query
Runtime validationZod
Design primitivesRadix UI, class-variance-authority, shared DXP tokens
Charts and searchRecharts, Fuse.js
Large listsTanStack Virtual
ObservabilitySentry wrapper package
TestingVitest, React Testing Library, MSW where appropriate
Toolingpnpm workspaces, Turborepo, ESLint 9, Prettier, Lefthook

Getting Started

Requirements

  • Node.js 20+
  • pnpm 9+

Install

pnpm install

Run The Platform

pnpm dev

Open the shell at:

http://localhost:3000

Local services use these ports:

ServicePort
Shell3000
Feature Flags MFE3001
Experiments MFE3002
Logs MFE3003
API Explorer MFE3004
Docs MFE3005
Registry4000

If you want a smaller loop, run one workspace directly:

pnpm --filter @dxp/shell dev
pnpm --filter @dxp/mfe-feature-flags dev
pnpm --filter @dxp/registry dev

Common Commands

CommandWhat it does
pnpm devStarts all persistent dev servers through Turbo.
pnpm buildBuilds packages and applications in dependency order.
pnpm testRuns all test suites.
pnpm lintRuns ESLint across workspaces.
pnpm type-checkRuns TypeScript checks across workspaces.
pnpm formatFormats supported source, config, and Markdown files.
pnpm create-mfe <name> --port <port>Scaffolds a new Module Federation remote.

Creating A New MFE

pnpm create-mfe billing --port 3006

The scaffolded app includes:

  • rsbuild.config.ts with Module Federation remote config.
  • src/mount.tsx with the default MFEMountFn export.
  • src/App.tsx using a fresh QueryClient per mount.
  • MemoryRouter so the shell remains the URL owner.
  • Tailwind config extending @dxp/ui/tailwind.
  • Vitest config with 80% coverage thresholds.
  • Mock MFEProps and test setup.

To integrate it into the shell, add a registry entry:

{
"name": "billing",
"route": "/billing",
"scope": "billing",
"module": "./App",
"url": "http://localhost:3006/remoteEntry.js",
"permissions": ["admin", "dev"],
"enabled": true,
"version": "0.1.0",
"canaryPercent": 0
}

Quality Bar

This repo is intentionally strict because distributed frontends fail at boundaries.

  • TypeScript enables strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes, noImplicitReturns, and isolatedModules.
  • ESLint rejects any, non-null assertions, import cycles, duplicate imports, and common React/accessibility issues.
  • MFE test configs enforce 80% coverage thresholds for lines, functions, branches, and statements.
  • Each MFE includes a mount contract test so the shell can trust the remote boundary.
  • Registry and domain schemas are Zod-validated before data is trusted.
  • CI runs install, lint, type-check, tests, and build on pushes and pull requests to main and dev.
  • Lefthook runs formatting/linting before commit and type-check/tests before push.

Environment Variables

VariableDefaultPurpose
REGISTRY_URLhttp://localhost:4000/registry.jsonRegistry endpoint used by the shell.
SENTRY_DSNemptyEnables Sentry reporting when provided.
APP_ENVdevelopmentRuntime environment label.
APP_VERSION0.0.0Version label attached to the shell build.

Reviewer Notes

This project is designed to make senior engineering judgment visible:

  • It separates platform ownership from product ownership.
  • It treats runtime JSON, remote exports, storage, and forms as untrusted inputs.
  • It makes failure local instead of letting one remote take down the whole shell.
  • It avoids shared global MFE state by giving each remote an isolated router and query cache.
  • It encodes repeatability with scaffolding instead of relying on tribal knowledge.
  • It shows practical tradeoffs: runtime federation for independent delivery, shared packages for consistency, and schema validation at every boundary.

Current Roadmap

  • Add visual documentation for @dxp/ui components.
  • Expand end-to-end coverage around federation loading, RBAC, and API Explorer token safety.
  • Implement canary routing behavior for the modeled canaryPercent registry field.
  • Add generated architecture screenshots or a short demo recording for portfolio presentation.

About

Runtime-composable micro-frontend platform simulating large-scale frontend architecture. Independently deployed apps are dynamically discovered and orchestrated via a registry-driven system, enabling team autonomy, failure isolation, and scalable UI composition.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Developer Experience Platform

TypeScriptReactModule FederationTurborepoQuality

DXP is a production-style Developer Experience Platform built to demonstrate how large engineering organizations compose independently owned frontend products into one governed internal platform.

It is not a single-page CRUD demo. It is a runtime-composed micro-frontend system with a Webpack 5 host shell, Rsbuild-powered remotes, a typed federation contract, registry-driven routing, RBAC, error isolation, observability hooks, shared design tokens, strict TypeScript, CI, and repeatable MFE scaffolding.

Why This Project Matters

Modern platform teams win by setting strong boundaries: product teams need autonomy, while the platform needs reliability, security, design consistency, and operational visibility. This repo models that tradeoff.

  • The shell owns platform concerns: authentication context, route orchestration, navigation chrome, RBAC, registry validation, remote loading, error boundaries, and telemetry.
  • MFEs own product concerns: feature flags, experiments, logs, API exploration, and documentation.
  • Shared packages define the contracts and primitives that keep the system coherent without coupling every team to every other team.
  • CI and local hooks enforce the basics: lint, type-check, tests, build, import hygiene, accessibility rules, and strict TypeScript.

System At A Glance

flowchart LR
Registry["Runtime registry.json\napps/registry"]
Shell["Shell host\nWebpack 5 + React Router"]
Loader["Dynamic federation loader\nscript injection + share scope init"]
Contracts["@dxp/federation-contracts\nTypeScript + Zod"]
UI["@dxp/ui\nRadix + Tailwind tokens"]
Obs["@dxp/observability\nSentry wrapper + load metrics"]
Flags["Feature Flags MFE\nport 3001"]
Experiments["Experiments MFE\nport 3002"]
Logs["Logs MFE\nport 3003"]
API["API Explorer MFE\nport 3004"]
Docs["Docs MFE\nport 3005"]
Registry --> Shell
Shell --> Loader
Loader --> Flags
Loader --> Experiments
Loader --> Logs
Loader --> API
Loader --> Docs
Contracts --> Shell
Contracts --> Flags
Contracts --> Experiments
Contracts --> Logs
Contracts --> API
Contracts --> Docs
UI --> Shell
UI --> Flags
UI --> Experiments
UI --> Logs
UI --> API
UI --> Docs
Obs --> Shell
Obs --> Logs
Loading

What It Demonstrates

AreaImplementation
Runtime compositionThe shell has an intentionally empty remotes map and loads every MFE from apps/registry/registry.json.
Team boundariesEach MFE exposes only ./App, implemented as a mount(container, props) contract.
Contract safety@dxp/federation-contracts exports TypeScript interfaces and Zod schemas used by the shell and remotes.
ResilienceRemote loading has a 10 second timeout, retry behavior, script cleanup, per-MFE error boundaries, and retry UI.
Access controlShell-level ProtectedRoute enforces registry permissions before mounting a remote.
Design consistency@dxp/ui provides reusable primitives and a shared Tailwind token preset.
ObservabilityMFE load performance is measured and forwarded through the Sentry wrapper package.
Developer velocitytools/create-mfe scaffolds a new remote with Rsbuild, Module Federation, tests, Tailwind, and contract wiring.
Quality gatesTurborepo orchestrates lint, type-check, tests, and builds across apps and packages.

Product Surfaces

AppRouteOwnership StoryHighlights
@dxp/shell/Platform hostRuntime registry fetch, dynamic routing, RBAC, layout, global and per-MFE error boundaries.
@dxp/mfe-feature-flags/flagsRelease engineeringFlag list, environment toggles, admin-only delete, immutable keys, Zod-validated create/update flows.
@dxp/mfe-experiments/experimentsProduct experimentationExperiment lifecycle, variant allocation validation, Recharts conversion analysis, p-value significance display.
@dxp/mfe-logs/logsObservability10,000 synthetic log entries, debounced filtering, cursor pagination, TanStack Virtual rendering, detail dialog.
@dxp/mfe-api-explorer/api-explorerInternal developer toolingMethod/path/header builder, Zod request validation, proxied request execution, response viewer, session-scoped history.
@dxp/mfe-docs/docsInternal docsZod-validated nested docs manifest, Fuse.js search, Markdown/GFM rendering, docs navigation tree.
@dxp/registry:4000/registry.jsonPlatform configSource of truth for routes, scopes, remote URLs, versions, permissions, and enabled state.

Runtime Composition Flow

When a user navigates to an MFE route, the shell follows a platform-controlled sequence:

  1. Fetch registry.json with @dxp/registry-client.
  2. Validate the registry with RegistrySchema from @dxp/federation-contracts.
  3. Filter navigation by enabled and permissions.
  4. Inject the remote remoteEntry.js script at route activation time.
  5. Initialize Webpack's default share scope.
  6. Resolve window[scope].get(module).
  7. Validate the remote's default export with MFEMountFnSchema.
  8. Mount the remote into an isolated container with auth, router, and theme context.
  9. Track load duration and isolate failures with an MFE-specific error boundary.
  10. Call unmount() on cleanup so React roots and theme state are released.

The shell can add, remove, disable, or retarget an MFE by changing registry config. No static remote import or shell route edit is required.

Monorepo Layout

.
+-- apps
| +-- shell # Webpack 5 Module Federation host
| +-- registry # Runtime registry.json served on port 4000
| +-- mfe-api-explorer # API testing tool remote
| +-- mfe-docs # Searchable documentation remote
| +-- mfe-experiments # Experiment management remote
| +-- mfe-feature-flags # Feature flag management remote
| +-- mfe-logs # Virtualized log exploration remote
+-- packages
| +-- auth-context # AuthProvider, useAuth, mock users, JWT-shaped tokens
| +-- federation-contracts # Cross-team MFE manifest and mount contract
| +-- observability # Sentry initialization, error capture, load metrics
| +-- registry-client # Registry fetch, retry, cache fallback, React Query hook
| +-- ui # Shared UI primitives, design tokens, Tailwind preset
| +-- eslint-config # Shared base/react/storybook lint config
| +-- prettier-config # Shared Prettier config
| +-- tsconfig-base # Strict TypeScript base config
+-- tools
+-- create-mfe # CLI for scaffolding new remotes

Tech Stack

LayerTechnology
LanguageTypeScript 5, strict mode, moduleResolution: bundler
UIReact 18, React Router 6, Tailwind CSS
Host bundlerWebpack 5 Module Federation
Remote bundlerRsbuild + @module-federation/rsbuild-plugin
Server stateTanStack Query
Runtime validationZod
Design primitivesRadix UI, class-variance-authority, shared DXP tokens
Charts and searchRecharts, Fuse.js
Large listsTanStack Virtual
ObservabilitySentry wrapper package
TestingVitest, React Testing Library, MSW where appropriate
Toolingpnpm workspaces, Turborepo, ESLint 9, Prettier, Lefthook

Getting Started

Requirements

  • Node.js 20+
  • pnpm 9+

Install

pnpm install

Run The Platform

pnpm dev

Open the shell at:

http://localhost:3000

Local services use these ports:

ServicePort
Shell3000
Feature Flags MFE3001
Experiments MFE3002
Logs MFE3003
API Explorer MFE3004
Docs MFE3005
Registry4000

If you want a smaller loop, run one workspace directly:

pnpm --filter @dxp/shell dev
pnpm --filter @dxp/mfe-feature-flags dev
pnpm --filter @dxp/registry dev

Common Commands

CommandWhat it does
pnpm devStarts all persistent dev servers through Turbo.
pnpm buildBuilds packages and applications in dependency order.
pnpm testRuns all test suites.
pnpm lintRuns ESLint across workspaces.
pnpm type-checkRuns TypeScript checks across workspaces.
pnpm formatFormats supported source, config, and Markdown files.
pnpm create-mfe <name> --port <port>Scaffolds a new Module Federation remote.

Creating A New MFE

pnpm create-mfe billing --port 3006

The scaffolded app includes:

  • rsbuild.config.ts with Module Federation remote config.
  • src/mount.tsx with the default MFEMountFn export.
  • src/App.tsx using a fresh QueryClient per mount.
  • MemoryRouter so the shell remains the URL owner.
  • Tailwind config extending @dxp/ui/tailwind.
  • Vitest config with 80% coverage thresholds.
  • Mock MFEProps and test setup.

To integrate it into the shell, add a registry entry:

{
"name": "billing",
"route": "/billing",
"scope": "billing",
"module": "./App",
"url": "http://localhost:3006/remoteEntry.js",
"permissions": ["admin", "dev"],
"enabled": true,
"version": "0.1.0",
"canaryPercent": 0
}

Quality Bar

This repo is intentionally strict because distributed frontends fail at boundaries.

  • TypeScript enables strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes, noImplicitReturns, and isolatedModules.
  • ESLint rejects any, non-null assertions, import cycles, duplicate imports, and common React/accessibility issues.
  • MFE test configs enforce 80% coverage thresholds for lines, functions, branches, and statements.
  • Each MFE includes a mount contract test so the shell can trust the remote boundary.
  • Registry and domain schemas are Zod-validated before data is trusted.
  • CI runs install, lint, type-check, tests, and build on pushes and pull requests to main and dev.
  • Lefthook runs formatting/linting before commit and type-check/tests before push.

Environment Variables

VariableDefaultPurpose
REGISTRY_URLhttp://localhost:4000/registry.jsonRegistry endpoint used by the shell.
SENTRY_DSNemptyEnables Sentry reporting when provided.
APP_ENVdevelopmentRuntime environment label.
APP_VERSION0.0.0Version label attached to the shell build.

Reviewer Notes

This project is designed to make senior engineering judgment visible:

  • It separates platform ownership from product ownership.
  • It treats runtime JSON, remote exports, storage, and forms as untrusted inputs.
  • It makes failure local instead of letting one remote take down the whole shell.
  • It avoids shared global MFE state by giving each remote an isolated router and query cache.
  • It encodes repeatability with scaffolding instead of relying on tribal knowledge.
  • It shows practical tradeoffs: runtime federation for independent delivery, shared packages for consistency, and schema validation at every boundary.

Current Roadmap

  • Add visual documentation for @dxp/ui components.
  • Expand end-to-end coverage around federation loading, RBAC, and API Explorer token safety.
  • Implement canary routing behavior for the modeled canaryPercent registry field.
  • Add generated architecture screenshots or a short demo recording for portfolio presentation.

About

Runtime-composable micro-frontend platform simulating large-scale frontend architecture. Independently deployed apps are dynamically discovered and orchestrated via a registry-driven system, enabling team autonomy, failure isolation, and scalable UI composition.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Developer Experience Platform

TypeScriptReactModule FederationTurborepoQuality

DXP is a production-style Developer Experience Platform built to demonstrate how large engineering organizations compose independently owned frontend products into one governed internal platform.

It is not a single-page CRUD demo. It is a runtime-composed micro-frontend system with a Webpack 5 host shell, Rsbuild-powered remotes, a typed federation contract, registry-driven routing, RBAC, error isolation, observability hooks, shared design tokens, strict TypeScript, CI, and repeatable MFE scaffolding.

Why This Project Matters

Modern platform teams win by setting strong boundaries: product teams need autonomy, while the platform needs reliability, security, design consistency, and operational visibility. This repo models that tradeoff.

  • The shell owns platform concerns: authentication context, route orchestration, navigation chrome, RBAC, registry validation, remote loading, error boundaries, and telemetry.
  • MFEs own product concerns: feature flags, experiments, logs, API exploration, and documentation.
  • Shared packages define the contracts and primitives that keep the system coherent without coupling every team to every other team.
  • CI and local hooks enforce the basics: lint, type-check, tests, build, import hygiene, accessibility rules, and strict TypeScript.

System At A Glance

flowchart LR
Registry["Runtime registry.json\napps/registry"]
Shell["Shell host\nWebpack 5 + React Router"]
Loader["Dynamic federation loader\nscript injection + share scope init"]
Contracts["@dxp/federation-contracts\nTypeScript + Zod"]
UI["@dxp/ui\nRadix + Tailwind tokens"]
Obs["@dxp/observability\nSentry wrapper + load metrics"]
Flags["Feature Flags MFE\nport 3001"]
Experiments["Experiments MFE\nport 3002"]
Logs["Logs MFE\nport 3003"]
API["API Explorer MFE\nport 3004"]
Docs["Docs MFE\nport 3005"]
Registry --> Shell
Shell --> Loader
Loader --> Flags
Loader --> Experiments
Loader --> Logs
Loader --> API
Loader --> Docs
Contracts --> Shell
Contracts --> Flags
Contracts --> Experiments
Contracts --> Logs
Contracts --> API
Contracts --> Docs
UI --> Shell
UI --> Flags
UI --> Experiments
UI --> Logs
UI --> API
UI --> Docs
Obs --> Shell
Obs --> Logs
Loading

What It Demonstrates

AreaImplementation
Runtime compositionThe shell has an intentionally empty remotes map and loads every MFE from apps/registry/registry.json.
Team boundariesEach MFE exposes only ./App, implemented as a mount(container, props) contract.
Contract safety@dxp/federation-contracts exports TypeScript interfaces and Zod schemas used by the shell and remotes.
ResilienceRemote loading has a 10 second timeout, retry behavior, script cleanup, per-MFE error boundaries, and retry UI.
Access controlShell-level ProtectedRoute enforces registry permissions before mounting a remote.
Design consistency@dxp/ui provides reusable primitives and a shared Tailwind token preset.
ObservabilityMFE load performance is measured and forwarded through the Sentry wrapper package.
Developer velocitytools/create-mfe scaffolds a new remote with Rsbuild, Module Federation, tests, Tailwind, and contract wiring.
Quality gatesTurborepo orchestrates lint, type-check, tests, and builds across apps and packages.

Product Surfaces

AppRouteOwnership StoryHighlights
@dxp/shell/Platform hostRuntime registry fetch, dynamic routing, RBAC, layout, global and per-MFE error boundaries.
@dxp/mfe-feature-flags/flagsRelease engineeringFlag list, environment toggles, admin-only delete, immutable keys, Zod-validated create/update flows.
@dxp/mfe-experiments/experimentsProduct experimentationExperiment lifecycle, variant allocation validation, Recharts conversion analysis, p-value significance display.
@dxp/mfe-logs/logsObservability10,000 synthetic log entries, debounced filtering, cursor pagination, TanStack Virtual rendering, detail dialog.
@dxp/mfe-api-explorer/api-explorerInternal developer toolingMethod/path/header builder, Zod request validation, proxied request execution, response viewer, session-scoped history.
@dxp/mfe-docs/docsInternal docsZod-validated nested docs manifest, Fuse.js search, Markdown/GFM rendering, docs navigation tree.
@dxp/registry:4000/registry.jsonPlatform configSource of truth for routes, scopes, remote URLs, versions, permissions, and enabled state.

Runtime Composition Flow

When a user navigates to an MFE route, the shell follows a platform-controlled sequence:

  1. Fetch registry.json with @dxp/registry-client.
  2. Validate the registry with RegistrySchema from @dxp/federation-contracts.
  3. Filter navigation by enabled and permissions.
  4. Inject the remote remoteEntry.js script at route activation time.
  5. Initialize Webpack's default share scope.
  6. Resolve window[scope].get(module).
  7. Validate the remote's default export with MFEMountFnSchema.
  8. Mount the remote into an isolated container with auth, router, and theme context.
  9. Track load duration and isolate failures with an MFE-specific error boundary.
  10. Call unmount() on cleanup so React roots and theme state are released.

The shell can add, remove, disable, or retarget an MFE by changing registry config. No static remote import or shell route edit is required.

Monorepo Layout

.
+-- apps
| +-- shell # Webpack 5 Module Federation host
| +-- registry # Runtime registry.json served on port 4000
| +-- mfe-api-explorer # API testing tool remote
| +-- mfe-docs # Searchable documentation remote
| +-- mfe-experiments # Experiment management remote
| +-- mfe-feature-flags # Feature flag management remote
| +-- mfe-logs # Virtualized log exploration remote
+-- packages
| +-- auth-context # AuthProvider, useAuth, mock users, JWT-shaped tokens
| +-- federation-contracts # Cross-team MFE manifest and mount contract
| +-- observability # Sentry initialization, error capture, load metrics
| +-- registry-client # Registry fetch, retry, cache fallback, React Query hook
| +-- ui # Shared UI primitives, design tokens, Tailwind preset
| +-- eslint-config # Shared base/react/storybook lint config
| +-- prettier-config # Shared Prettier config
| +-- tsconfig-base # Strict TypeScript base config
+-- tools
+-- create-mfe # CLI for scaffolding new remotes

Tech Stack

LayerTechnology
LanguageTypeScript 5, strict mode, moduleResolution: bundler
UIReact 18, React Router 6, Tailwind CSS
Host bundlerWebpack 5 Module Federation
Remote bundlerRsbuild + @module-federation/rsbuild-plugin
Server stateTanStack Query
Runtime validationZod
Design primitivesRadix UI, class-variance-authority, shared DXP tokens
Charts and searchRecharts, Fuse.js
Large listsTanStack Virtual
ObservabilitySentry wrapper package
TestingVitest, React Testing Library, MSW where appropriate
Toolingpnpm workspaces, Turborepo, ESLint 9, Prettier, Lefthook

Getting Started

Requirements

  • Node.js 20+
  • pnpm 9+

Install

pnpm install

Run The Platform

pnpm dev

Open the shell at:

http://localhost:3000

Local services use these ports:

ServicePort
Shell3000
Feature Flags MFE3001
Experiments MFE3002
Logs MFE3003
API Explorer MFE3004
Docs MFE3005
Registry4000

If you want a smaller loop, run one workspace directly:

pnpm --filter @dxp/shell dev
pnpm --filter @dxp/mfe-feature-flags dev
pnpm --filter @dxp/registry dev

Common Commands

CommandWhat it does
pnpm devStarts all persistent dev servers through Turbo.
pnpm buildBuilds packages and applications in dependency order.
pnpm testRuns all test suites.
pnpm lintRuns ESLint across workspaces.
pnpm type-checkRuns TypeScript checks across workspaces.
pnpm formatFormats supported source, config, and Markdown files.
pnpm create-mfe <name> --port <port>Scaffolds a new Module Federation remote.

Creating A New MFE

pnpm create-mfe billing --port 3006

The scaffolded app includes:

  • rsbuild.config.ts with Module Federation remote config.
  • src/mount.tsx with the default MFEMountFn export.
  • src/App.tsx using a fresh QueryClient per mount.
  • MemoryRouter so the shell remains the URL owner.
  • Tailwind config extending @dxp/ui/tailwind.
  • Vitest config with 80% coverage thresholds.
  • Mock MFEProps and test setup.

To integrate it into the shell, add a registry entry:

{
"name": "billing",
"route": "/billing",
"scope": "billing",
"module": "./App",
"url": "http://localhost:3006/remoteEntry.js",
"permissions": ["admin", "dev"],
"enabled": true,
"version": "0.1.0",
"canaryPercent": 0
}

Quality Bar

This repo is intentionally strict because distributed frontends fail at boundaries.

  • TypeScript enables strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes, noImplicitReturns, and isolatedModules.
  • ESLint rejects any, non-null assertions, import cycles, duplicate imports, and common React/accessibility issues.
  • MFE test configs enforce 80% coverage thresholds for lines, functions, branches, and statements.
  • Each MFE includes a mount contract test so the shell can trust the remote boundary.
  • Registry and domain schemas are Zod-validated before data is trusted.
  • CI runs install, lint, type-check, tests, and build on pushes and pull requests to main and dev.
  • Lefthook runs formatting/linting before commit and type-check/tests before push.

Environment Variables

VariableDefaultPurpose
REGISTRY_URLhttp://localhost:4000/registry.jsonRegistry endpoint used by the shell.
SENTRY_DSNemptyEnables Sentry reporting when provided.
APP_ENVdevelopmentRuntime environment label.
APP_VERSION0.0.0Version label attached to the shell build.

Reviewer Notes

This project is designed to make senior engineering judgment visible:

  • It separates platform ownership from product ownership.
  • It treats runtime JSON, remote exports, storage, and forms as untrusted inputs.
  • It makes failure local instead of letting one remote take down the whole shell.
  • It avoids shared global MFE state by giving each remote an isolated router and query cache.
  • It encodes repeatability with scaffolding instead of relying on tribal knowledge.
  • It shows practical tradeoffs: runtime federation for independent delivery, shared packages for consistency, and schema validation at every boundary.

Current Roadmap

  • Add visual documentation for @dxp/ui components.
  • Expand end-to-end coverage around federation loading, RBAC, and API Explorer token safety.
  • Implement canary routing behavior for the modeled canaryPercent registry field.
  • Add generated architecture screenshots or a short demo recording for portfolio presentation.

About

Runtime-composable micro-frontend platform simulating large-scale frontend architecture. Independently deployed apps are dynamically discovered and orchestrated via a registry-driven system, enabling team autonomy, failure isolation, and scalable UI composition.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

Developer Experience Platform

TypeScriptReactModule FederationTurborepoQuality

DXP is a production-style Developer Experience Platform built to demonstrate how large engineering organizations compose independently owned frontend products into one governed internal platform.

It is not a single-page CRUD demo. It is a runtime-composed micro-frontend system with a Webpack 5 host shell, Rsbuild-powered remotes, a typed federation contract, registry-driven routing, RBAC, error isolation, observability hooks, shared design tokens, strict TypeScript, CI, and repeatable MFE scaffolding.

Why This Project Matters

Modern platform teams win by setting strong boundaries: product teams need autonomy, while the platform needs reliability, security, design consistency, and operational visibility. This repo models that tradeoff.

  • The shell owns platform concerns: authentication context, route orchestration, navigation chrome, RBAC, registry validation, remote loading, error boundaries, and telemetry.
  • MFEs own product concerns: feature flags, experiments, logs, API exploration, and documentation.
  • Shared packages define the contracts and primitives that keep the system coherent without coupling every team to every other team.
  • CI and local hooks enforce the basics: lint, type-check, tests, build, import hygiene, accessibility rules, and strict TypeScript.

System At A Glance

flowchart LR
Registry["Runtime registry.json\napps/registry"]
Shell["Shell host\nWebpack 5 + React Router"]
Loader["Dynamic federation loader\nscript injection + share scope init"]
Contracts["@dxp/federation-contracts\nTypeScript + Zod"]
UI["@dxp/ui\nRadix + Tailwind tokens"]
Obs["@dxp/observability\nSentry wrapper + load metrics"]
Flags["Feature Flags MFE\nport 3001"]
Experiments["Experiments MFE\nport 3002"]
Logs["Logs MFE\nport 3003"]
API["API Explorer MFE\nport 3004"]
Docs["Docs MFE\nport 3005"]
Registry --> Shell
Shell --> Loader
Loader --> Flags
Loader --> Experiments
Loader --> Logs
Loader --> API
Loader --> Docs
Contracts --> Shell
Contracts --> Flags
Contracts --> Experiments
Contracts --> Logs
Contracts --> API
Contracts --> Docs
UI --> Shell
UI --> Flags
UI --> Experiments
UI --> Logs
UI --> API
UI --> Docs
Obs --> Shell
Obs --> Logs
Loading

What It Demonstrates

AreaImplementation
Runtime compositionThe shell has an intentionally empty remotes map and loads every MFE from apps/registry/registry.json.
Team boundariesEach MFE exposes only ./App, implemented as a mount(container, props) contract.
Contract safety@dxp/federation-contracts exports TypeScript interfaces and Zod schemas used by the shell and remotes.
ResilienceRemote loading has a 10 second timeout, retry behavior, script cleanup, per-MFE error boundaries, and retry UI.
Access controlShell-level ProtectedRoute enforces registry permissions before mounting a remote.
Design consistency@dxp/ui provides reusable primitives and a shared Tailwind token preset.
ObservabilityMFE load performance is measured and forwarded through the Sentry wrapper package.
Developer velocitytools/create-mfe scaffolds a new remote with Rsbuild, Module Federation, tests, Tailwind, and contract wiring.
Quality gatesTurborepo orchestrates lint, type-check, tests, and builds across apps and packages.

Product Surfaces

AppRouteOwnership StoryHighlights
@dxp/shell/Platform hostRuntime registry fetch, dynamic routing, RBAC, layout, global and per-MFE error boundaries.
@dxp/mfe-feature-flags/flagsRelease engineeringFlag list, environment toggles, admin-only delete, immutable keys, Zod-validated create/update flows.
@dxp/mfe-experiments/experimentsProduct experimentationExperiment lifecycle, variant allocation validation, Recharts conversion analysis, p-value significance display.
@dxp/mfe-logs/logsObservability10,000 synthetic log entries, debounced filtering, cursor pagination, TanStack Virtual rendering, detail dialog.
@dxp/mfe-api-explorer/api-explorerInternal developer toolingMethod/path/header builder, Zod request validation, proxied request execution, response viewer, session-scoped history.
@dxp/mfe-docs/docsInternal docsZod-validated nested docs manifest, Fuse.js search, Markdown/GFM rendering, docs navigation tree.
@dxp/registry:4000/registry.jsonPlatform configSource of truth for routes, scopes, remote URLs, versions, permissions, and enabled state.

Runtime Composition Flow

When a user navigates to an MFE route, the shell follows a platform-controlled sequence:

  1. Fetch registry.json with @dxp/registry-client.
  2. Validate the registry with RegistrySchema from @dxp/federation-contracts.
  3. Filter navigation by enabled and permissions.
  4. Inject the remote remoteEntry.js script at route activation time.
  5. Initialize Webpack's default share scope.
  6. Resolve window[scope].get(module).
  7. Validate the remote's default export with MFEMountFnSchema.
  8. Mount the remote into an isolated container with auth, router, and theme context.
  9. Track load duration and isolate failures with an MFE-specific error boundary.
  10. Call unmount() on cleanup so React roots and theme state are released.

The shell can add, remove, disable, or retarget an MFE by changing registry config. No static remote import or shell route edit is required.

Monorepo Layout

.
+-- apps
| +-- shell # Webpack 5 Module Federation host
| +-- registry # Runtime registry.json served on port 4000
| +-- mfe-api-explorer # API testing tool remote
| +-- mfe-docs # Searchable documentation remote
| +-- mfe-experiments # Experiment management remote
| +-- mfe-feature-flags # Feature flag management remote
| +-- mfe-logs # Virtualized log exploration remote
+-- packages
| +-- auth-context # AuthProvider, useAuth, mock users, JWT-shaped tokens
| +-- federation-contracts # Cross-team MFE manifest and mount contract
| +-- observability # Sentry initialization, error capture, load metrics
| +-- registry-client # Registry fetch, retry, cache fallback, React Query hook
| +-- ui # Shared UI primitives, design tokens, Tailwind preset
| +-- eslint-config # Shared base/react/storybook lint config
| +-- prettier-config # Shared Prettier config
| +-- tsconfig-base # Strict TypeScript base config
+-- tools
+-- create-mfe # CLI for scaffolding new remotes

Tech Stack

LayerTechnology
LanguageTypeScript 5, strict mode, moduleResolution: bundler
UIReact 18, React Router 6, Tailwind CSS
Host bundlerWebpack 5 Module Federation
Remote bundlerRsbuild + @module-federation/rsbuild-plugin
Server stateTanStack Query
Runtime validationZod
Design primitivesRadix UI, class-variance-authority, shared DXP tokens
Charts and searchRecharts, Fuse.js
Large listsTanStack Virtual
ObservabilitySentry wrapper package
TestingVitest, React Testing Library, MSW where appropriate
Toolingpnpm workspaces, Turborepo, ESLint 9, Prettier, Lefthook

Getting Started

Requirements

  • Node.js 20+
  • pnpm 9+

Install

pnpm install

Run The Platform

pnpm dev

Open the shell at:

http://localhost:3000

Local services use these ports:

ServicePort
Shell3000
Feature Flags MFE3001
Experiments MFE3002
Logs MFE3003
API Explorer MFE3004
Docs MFE3005
Registry4000

If you want a smaller loop, run one workspace directly:

pnpm --filter @dxp/shell dev
pnpm --filter @dxp/mfe-feature-flags dev
pnpm --filter @dxp/registry dev

Common Commands

CommandWhat it does
pnpm devStarts all persistent dev servers through Turbo.
pnpm buildBuilds packages and applications in dependency order.
pnpm testRuns all test suites.
pnpm lintRuns ESLint across workspaces.
pnpm type-checkRuns TypeScript checks across workspaces.
pnpm formatFormats supported source, config, and Markdown files.
pnpm create-mfe <name> --port <port>Scaffolds a new Module Federation remote.

Creating A New MFE

pnpm create-mfe billing --port 3006

The scaffolded app includes:

  • rsbuild.config.ts with Module Federation remote config.
  • src/mount.tsx with the default MFEMountFn export.
  • src/App.tsx using a fresh QueryClient per mount.
  • MemoryRouter so the shell remains the URL owner.
  • Tailwind config extending @dxp/ui/tailwind.
  • Vitest config with 80% coverage thresholds.
  • Mock MFEProps and test setup.

To integrate it into the shell, add a registry entry:

{
"name": "billing",
"route": "/billing",
"scope": "billing",
"module": "./App",
"url": "http://localhost:3006/remoteEntry.js",
"permissions": ["admin", "dev"],
"enabled": true,
"version": "0.1.0",
"canaryPercent": 0
}

Quality Bar

This repo is intentionally strict because distributed frontends fail at boundaries.

  • TypeScript enables strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes, noImplicitReturns, and isolatedModules.
  • ESLint rejects any, non-null assertions, import cycles, duplicate imports, and common React/accessibility issues.
  • MFE test configs enforce 80% coverage thresholds for lines, functions, branches, and statements.
  • Each MFE includes a mount contract test so the shell can trust the remote boundary.
  • Registry and domain schemas are Zod-validated before data is trusted.
  • CI runs install, lint, type-check, tests, and build on pushes and pull requests to main and dev.
  • Lefthook runs formatting/linting before commit and type-check/tests before push.

Environment Variables

VariableDefaultPurpose
REGISTRY_URLhttp://localhost:4000/registry.jsonRegistry endpoint used by the shell.
SENTRY_DSNemptyEnables Sentry reporting when provided.
APP_ENVdevelopmentRuntime environment label.
APP_VERSION0.0.0Version label attached to the shell build.

Reviewer Notes

This project is designed to make senior engineering judgment visible:

  • It separates platform ownership from product ownership.
  • It treats runtime JSON, remote exports, storage, and forms as untrusted inputs.
  • It makes failure local instead of letting one remote take down the whole shell.
  • It avoids shared global MFE state by giving each remote an isolated router and query cache.
  • It encodes repeatability with scaffolding instead of relying on tribal knowledge.
  • It shows practical tradeoffs: runtime federation for independent delivery, shared packages for consistency, and schema validation at every boundary.

Current Roadmap

  • Add visual documentation for @dxp/ui components.
  • Expand end-to-end coverage around federation loading, RBAC, and API Explorer token safety.
  • Implement canary routing behavior for the modeled canaryPercent registry field.
  • Add generated architecture screenshots or a short demo recording for portfolio presentation.

About

Runtime-composable micro-frontend platform simulating large-scale frontend architecture. Independently deployed apps are dynamically discovered and orchestrated via a registry-driven system, enabling team autonomy, failure isolation, and scalable UI composition.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages