# mfeflow > React micro-frontend boilerplate and platform kit for Module Federation 2.0: à-la-carte features, a self-hosted registry designed for rollback by pointer. ## Guide - [Introduction to mfeflow](https://mfeflow.github.io/mfeflow/guide/introduction.md): What mfeflow is, who it is for, and how it handles the problems that appear after the first week of running React micro-frontends with Module Federation. - [Why try mfeflow](https://mfeflow.github.io/mfeflow/guide/why-mfeflow.md): The problem mfeflow solves, a measured example, when you should not use micro-frontends at all, and a facts-only comparison with plain Module Federation and monorepo tools. - [Quickstart](https://mfeflow.github.io/mfeflow/guide/quickstart.md): Create an mfeflow project, run the shell and two remotes locally, add a feature, then run the doctor and budget checks. About ten minutes. - [Project structure](https://mfeflow.github.io/mfeflow/guide/project-structure.md): A tour of every file in a new mfeflow project, which ones you edit, which ones a feature manages, and what mfeflow.json, mfeflow.app.json and the registry folder do. - [How mfeflow works](https://mfeflow.github.io/mfeflow/guide/how-it-works.md): How a shell boots, reads the registry index, registers remotes and loads them, how remotes are built with Rsbuild and Module Federation 2, and how shared singletons are checked. - [Add a remote](https://mfeflow.github.io/mfeflow/guide/adding-a-remote.md): Step-by-step tutorial for adding a third remote to an mfeflow project with the add remote command, then running it in the shell and checking the result. - [Bring an existing Module Federation app](https://mfeflow.github.io/mfeflow/guide/adopt.md): How to run mfeflow adopt in a project you already have, what it reads, the files it writes, what it never touches, the list of settings it does not carry over, and what to do next. - [Add features](https://mfeflow.github.io/mfeflow/guide/adding-features.md): How to add, preview and configure mfeflow features with the add command, including the dry-run diff, feature options, presets, atomic rollback and third-party registries. - [Develop locally](https://mfeflow.github.io/mfeflow/guide/development.md): Run the shell and every remote with mfeflow dev, point one remote at a server you already run, override a remote from the browser, and use doctor to find and fix problems. - [One repo per team](https://mfeflow.github.io/mfeflow/guide/polyrepo.md): Tutorial for a polyrepo. Create a platform repo, a shell repo and a repo for each remote with init --topology polyrepo, run them together, add a team repo, and publish the shared packages. - [CI and budgets](https://mfeflow.github.io/mfeflow/guide/ci-and-budgets.md): Run mfeflow's validate, check-compat, doctor and budget checks in CI, add the GitHub pull request workflow, and set the shell and remote JavaScript budgets. - [Deploy overview](https://mfeflow.github.io/mfeflow/guide/deploy/index.md): mfeflow builds static files and leaves hosting to you. This overview shows what to upload, the cache headers every host needs, and how the common hosting options compare. - [Deploy to Cloudflare](https://mfeflow.github.io/mfeflow/guide/deploy/cloudflare.md): Host the shell and remotes on Cloudflare Workers static assets with wrangler, set cache headers and environments, and optionally keep remotes and the registry index in R2. - [Deploy with Docker](https://mfeflow.github.io/mfeflow/guide/deploy/docker.md): Package the shell and remotes in one nginx image that picks its runtime config and registry index per environment at start, runs read-only, and deploys to Kubernetes. - [Deploy to AWS S3 and CloudFront](https://mfeflow.github.io/mfeflow/guide/deploy/aws.md): Host the site folder in a private S3 bucket behind CloudFront with origin access control, set cache headers per path with the AWS CLI, and handle SPA routes and roll back by index. - [Deploy to Vercel or Netlify](https://mfeflow.github.io/mfeflow/guide/deploy/vercel-netlify.md): Host the site folder on Vercel or Netlify with headers and an SPA rewrite, and see why per-environment runtime config needs a build or copy step on these hosts. - [Deploy to GitHub Pages](https://mfeflow.github.io/mfeflow/guide/deploy/github-pages.md): Publish the site folder to GitHub Pages with the deploy-pages workflow, and learn the limits that matter for mfeflow, including the fixed cache time and the project base path. - [Deploy to your own server](https://mfeflow.github.io/mfeflow/guide/deploy/own-server.md): Serve the site folder from any static file server you already run, with an nginx example, an rsync upload order that keeps old versions, and a pointer to the registry server when you want rollouts and a kill switch. - [Run the registry server](https://mfeflow.github.io/mfeflow/guide/deploy/registry-server-runbook.md): A how-to for the person who runs the mfeflow registry server - start it, back up the SQLite file, rotate tokens, kill a remote, recover from a halted rollout and upgrade the server. - [Registry server SLOs](https://mfeflow.github.io/mfeflow/guide/deploy/registry-server-slo.md): What the registry server promises about how fast a pointer move, a kill and the fallback reach people, with the measured number for each, the command that makes it, and what has not been measured yet. - [One build, three platforms](https://mfeflow.github.io/mfeflow/guide/deploy/multi-platform.md): A worked example that builds once in GitHub Actions and deploys to two Cloudflare Workers and one Docker platform, each with its own runtime config and index, then rolls one platform back. - [Deploy and roll back a remote](https://mfeflow.github.io/mfeflow/guide/deploy-and-rollback.md): A tutorial that deploys one remote to a static registry, promotes it, rolls it back without a rebuild and checks drift, with the real output of each command. - [Versions and upgrades](https://mfeflow.github.io/mfeflow/guide/upgrading.md): How mfeflow versions its packages together before 1.0, what counts as a breaking change, how changesets record them, and a tutorial for moving a project to a new version with mfeflow upgrade. - [Troubleshooting](https://mfeflow.github.io/mfeflow/guide/troubleshooting.md): Find a Module Federation, runtime or mfeflow CLI error by its exact text, with the cause and the fix for each, and links to the numbered error pages. - [FAQ](https://mfeflow.github.io/mfeflow/guide/faq.md): Honest answers to the common questions about mfeflow, including duplicate React, shell and remote versions, CSS isolation, SSR, Next.js, Vite, npm and Yarn, and what is not built yet. - [CLI reference has moved](https://mfeflow.github.io/mfeflow/guide/cli.md): The mfeflow command line reference moved from the guide to the reference section. This short page keeps the old address working and links to the new one. - [Deploy](https://mfeflow.github.io/mfeflow/guide/deploying.md): This address moved. The Deploy section now shows several ways to host an mfeflow build, and starts with an overview of what to upload and how to cache it. ## Concepts - [Module Federation](https://mfeflow.github.io/mfeflow/concepts/module-federation.md): What Module Federation is, how a host loads code from a remote at runtime, the terms you meet in mfeflow, and the trade-offs of splitting a front end this way. - [Shared singletons](https://mfeflow.github.io/mfeflow/concepts/shared-singletons.md): Why React and some packages must exist exactly once on a micro-frontend page, which packages mfeflow shares by default, and how version drift and duplicates are detected. - [The registry index](https://mfeflow.github.io/mfeflow/concepts/registry-index.md): What the registry index is, how the shell reads it inline or by fetch, what each remote entry contains, and how per-environment registry files relate to it. - [Runtime config](https://mfeflow.github.io/mfeflow/concepts/runtime-config.md): Why browser settings come from a JSON file fetched at boot instead of the bundle, how the shell loads and types it, and how dev and production serve the right file. - [Ownership with mfeflow.app.json](https://mfeflow.github.io/mfeflow/concepts/ownership.md): How the mfeflow.app.json file in each app names its owner, routes and exposed modules, and how mfeflow checks those claims so two teams cannot take the same route. - [The cost model](https://mfeflow.github.io/mfeflow/concepts/cost-model.md): The three budgets mfeflow checks (300 ms LCP, 32 KB shell JavaScript, 10 KB per remote), why they exist, how they are measured, and what the storefront example measured. - [Third-party features](https://mfeflow.github.io/mfeflow/concepts/third-party-features.md): How anyone can publish mfeflow features as static JSON, why they are data and not code, and what the rules and safeguards are. A short overview with links to the full guide. ## Features - [Feature catalog](https://mfeflow.github.io/mfeflow/features/index.md): Every mfeflow feature in one table, with what it adds, whether it is on by default, which package it uses and which files you own after adding it. - [tsconfig - strict TypeScript presets](https://mfeflow.github.io/mfeflow/features/tsconfig.md): Strict TypeScript 7 presets shared by every app, and a typecheck script that runs per app and across the whole repo. - [lint-oxlint - fast type-aware linting](https://mfeflow.github.io/mfeflow/features/lint-oxlint.md): oxlint with type-aware rules and a Prettier setup for the whole repo, so one lint command checks every app the same way. - [testing - unit tests and a browser smoke test](https://mfeflow.github.io/mfeflow/features/testing.md): Run Vitest unit tests in every app and a Playwright smoke test that opens the shell and checks that each remote renders. - [git-hooks - check commits and pushes automatically](https://mfeflow.github.io/mfeflow/features/git-hooks.md): Reject badly formatted commit messages and type errors before they leave your machine, using lefthook and commitlint. - [commit-prompt - guided Conventional Commit messages](https://mfeflow.github.io/mfeflow/features/commit-prompt.md): Answer a few prompts and get a correctly formatted Conventional Commit message, so nobody has to remember the format. - [ci-github - a pull request check for the whole platform](https://mfeflow.github.io/mfeflow/features/ci-github.md): Add a GitHub Actions workflow that lints, type-checks, tests, builds and runs the mfeflow checks on every pull request. - [registry-server - publish remotes through a registry server](https://mfeflow.github.io/mfeflow/features/registry-server.md): Add the files that point a project at a self-hosted mfeflow registry server - runtime config keys, a shell helper for the browser beacon, a CI workflow that deploys with a token from the environment, and a guide. - [deploy-cloudflare - host on Cloudflare Workers](https://mfeflow.github.io/mfeflow/features/deploy-cloudflare.md): Add wrangler config, cache and CORS headers, a per-environment deploy script, an optional R2 registry proxy and, with ci-github, a workflow for hosting the shell and remotes on Cloudflare Workers static assets. - [env-t3 - Typed env that fails the build, config you can swap per environment](https://mfeflow.github.io/mfeflow/features/env-t3.md): Validate server variables when the build starts, and load browser settings from a per-environment JSON file so one build runs in dev, staging and prod. - [url-factory - typed API endpoints and URL building](https://mfeflow.github.io/mfeflow/features/url-factory.md): Define your API endpoints once and build their URLs with checked parameters, with base URLs read from runtime config instead of a build. - [http - typed requests with retries](https://mfeflow.github.io/mfeflow/features/http.md): A small fetch client over your url-factory endpoints that retries safe requests, times out slow ones and throws errors you can switch on. - [route-factory - typed links between remotes](https://mfeflow.github.io/mfeflow/features/route-factory.md): Link from one remote to another with routes checked by the compiler, so a renamed path or a missing parameter fails typecheck instead of 404ing. - [event-bus - Typed events between remotes](https://mfeflow.github.io/mfeflow/features/event-bus.md): Let remotes talk to each other through typed, versioned events defined in a shared contracts package, without importing each other's code. - [data-react-query - one shared cache for server data](https://mfeflow.github.io/mfeflow/features/data-react-query.md): Fetch server data with TanStack Query so the shell and every remote share one cache, with keys that cannot collide between remotes. - [forms - validated forms per remote](https://mfeflow.github.io/mfeflow/features/forms.md): react-hook-form with a schema from zod, valibot or arktype, as an example form each remote owns and loads only where it is used. - [analytics-gtm - Google Tag Manager with consent built in](https://mfeflow.github.io/mfeflow/features/analytics-gtm.md): Load Google Tag Manager with Consent Mode v2, send page views on route changes, and let each remote track its own typed events. - [analytics-clarity - Microsoft Clarity that waits for consent](https://mfeflow.github.io/mfeflow/features/analytics-clarity.md): Add Microsoft Clarity session replay and heatmaps next to Google Tag Manager, loaded only after the visitor accepts analytics in the consent banner. - [telemetry-otel - Browser traces tagged by remote](https://mfeflow.github.io/mfeflow/features/telemetry-otel.md): Send OpenTelemetry traces, fetch timing, web vitals and remote load failures to your collector, with every span tagged by the remote that made it. - [registry-static - deploy and roll back remotes on a folder or bucket](https://mfeflow.github.io/mfeflow/features/registry-static.md): Add scripts and a deploy workflow that publish your remotes to a static host and roll back by moving a pointer. - [release - one version per remote, and deploy uses it](https://mfeflow.github.io/mfeflow/features/release.md): Set up Changesets so each remote has its own version, and mfeflow deploy publishes that same version. - [deploy-docker - package the shell and remotes as nginx images](https://mfeflow.github.io/mfeflow/features/deploy-docker.md): Add a Dockerfile with an APP build argument, nginx cache and CORS rules, a start script that picks the runtime config from MFE_ENV, a Kubernetes example, a compose file and a .dockerignore. - [theming - light and dark themes for every remote](https://mfeflow.github.io/mfeflow/features/theming.md): Switch light and dark themes from the shell while every remote follows through CSS variables, with no flash of the wrong colours on reload. - [i18n - translations that ship with each remote](https://mfeflow.github.io/mfeflow/features/i18n.md): One shared i18next instance, with every remote loading its own messages from its own deploy, plus lang and dir set on the page. - [tailwind - Tailwind 4 without style collisions](https://mfeflow.github.io/mfeflow/features/tailwind.md): Tailwind CSS 4 with one reset in the shell and a class prefix per app, so two remotes can use the same utility with different tokens. - [ui-shadcn - shadcn/ui components you own](https://mfeflow.github.io/mfeflow/features/ui-shadcn.md): A cn helper, a Button and a shadcn config copied into every remote, with the remote's Tailwind prefix and your theme colours built in. - [storybook - every remote's stories in one place](https://mfeflow.github.io/mfeflow/features/storybook.md): Give each remote its own Storybook and browse them all from the shell, with new remotes appearing in the sidebar without any config edit. - [Third-party features - Install or publish features from any registry](https://mfeflow.github.io/mfeflow/features/third-party.md): Install features other people publish from a static registry, or host your own, knowing they only list files and edits and never run code on your machine. ## Reference - [MFEFLOW_E101](https://mfeflow.github.io/mfeflow/errors/E101.md): A shared singleton is missing from the shared list. - [MFEFLOW_E102](https://mfeflow.github.io/mfeflow/errors/E102.md): No mfeflow.json found. - [MFEFLOW_E103](https://mfeflow.github.io/mfeflow/errors/E103.md): mfeflow.json is not valid JSON. - [MFEFLOW_E104](https://mfeflow.github.io/mfeflow/errors/E104.md): mfeflow.json does not match its schema. - [MFEFLOW_E105](https://mfeflow.github.io/mfeflow/errors/E105.md): A path points outside the project. - [MFEFLOW_E106](https://mfeflow.github.io/mfeflow/errors/E106.md): A file could not be read or written. - [MFEFLOW_E107](https://mfeflow.github.io/mfeflow/errors/E107.md): A command-line option is missing or not valid. - [MFEFLOW_E108](https://mfeflow.github.io/mfeflow/errors/E108.md): The target folder is not empty. - [MFEFLOW_E109](https://mfeflow.github.io/mfeflow/errors/E109.md): The preset could not be used. - [MFEFLOW_E110](https://mfeflow.github.io/mfeflow/errors/E110.md): --local does not point at a built mfeflow checkout. - [MFEFLOW_E111](https://mfeflow.github.io/mfeflow/errors/E111.md): A workspace package has no version. - [MFEFLOW_E112](https://mfeflow.github.io/mfeflow/errors/E112.md): An app in mfeflow.json is not on disk. - [MFEFLOW_E113](https://mfeflow.github.io/mfeflow/errors/E113.md): mfeflow.app.json is missing or invalid. - [MFEFLOW_E114](https://mfeflow.github.io/mfeflow/errors/E114.md): A registry entry is missing or invalid. - [MFEFLOW_E115](https://mfeflow.github.io/mfeflow/errors/E115.md): Two apps use the same port. - [MFEFLOW_E116](https://mfeflow.github.io/mfeflow/errors/E116.md): Two remotes claim routes that overlap, or an app file disagrees with mfeflow.json. - [MFEFLOW_E117](https://mfeflow.github.io/mfeflow/errors/E117.md): A copied file changed since mfeflow wrote it. - [MFEFLOW_E118](https://mfeflow.github.io/mfeflow/errors/E118.md): .env.example does not match the keys in env.ts. Every key of the server schema in env.ts belongs in .env.example, so a new developer sees what to set; a key that env.ts no longer has does not. - [MFEFLOW_E119](https://mfeflow.github.io/mfeflow/errors/E119.md): A runtime-config file does not match the runtime-config schema. Each public/config/runtime-config..json must have every required key of runtimeConfigSchema in src/config/schema.ts, and no key the schema does not know. mfeflow doctor compares the keys; pnpm check:runtime-config validates the values with your validator before a deploy. - [MFEFLOW_E120](https://mfeflow.github.io/mfeflow/errors/E120.md): A PUBLIC_ variable would be baked into the bundle. Rsbuild inlines every PUBLIC_* variable into the JavaScript at build time. A value that differs per environment would tie one build to one environment, which breaks build once, deploy many. Only constants (PUBLIC_APP_NAME, PUBLIC_BUILD_VERSION) are accepted. - [MFEFLOW_E121](https://mfeflow.github.io/mfeflow/errors/E121.md): A server env key is not listed in turbo.json. Turborepo hides variables it was not told about from tasks, and it replays a cached build without running it. A key of the server schema that is not under globalEnv in turbo.json would not reach env.ts in CI, and a missing value would not fail a cached build. - [MFEFLOW_E122](https://mfeflow.github.io/mfeflow/errors/E122.md): An app has both mfeflow.app.json and the old mfe.json. - [MFEFLOW_E123](https://mfeflow.github.io/mfeflow/errors/E123.md): This folder already has an mfeflow.json. - [MFEFLOW_E124](https://mfeflow.github.io/mfeflow/errors/E124.md): adopt found nothing it can set up. - [MFEFLOW_E201](https://mfeflow.github.io/mfeflow/errors/E201.md): Feature not found. - [MFEFLOW_E202](https://mfeflow.github.io/mfeflow/errors/E202.md): feature.json is invalid. - [MFEFLOW_E203](https://mfeflow.github.io/mfeflow/errors/E203.md): A third-party feature uses something third-party features may not. - [MFEFLOW_E204](https://mfeflow.github.io/mfeflow/errors/E204.md): Unknown transform op. - [MFEFLOW_E205](https://mfeflow.github.io/mfeflow/errors/E205.md): Feature conflicts with an installed feature. - [MFEFLOW_E206](https://mfeflow.github.io/mfeflow/errors/E206.md): Feature needs another feature first. - [MFEFLOW_E207](https://mfeflow.github.io/mfeflow/errors/E207.md): The feature wants to create or change something that already exists. - [MFEFLOW_E208](https://mfeflow.github.io/mfeflow/errors/E208.md): A file the feature edits is missing or not shaped as expected. - [MFEFLOW_E209](https://mfeflow.github.io/mfeflow/errors/E209.md): A template could not be rendered. - [MFEFLOW_E210](https://mfeflow.github.io/mfeflow/errors/E210.md): Registry namespace is not configured. - [MFEFLOW_E211](https://mfeflow.github.io/mfeflow/errors/E211.md): Files changed since the plan was made. - [MFEFLOW_E212](https://mfeflow.github.io/mfeflow/errors/E212.md): Applying the plan failed. - [MFEFLOW_E213](https://mfeflow.github.io/mfeflow/errors/E213.md): Installing dependencies failed. - [MFEFLOW_E214](https://mfeflow.github.io/mfeflow/errors/E214.md): A feature option is invalid. - [MFEFLOW_E215](https://mfeflow.github.io/mfeflow/errors/E215.md): The app name cannot be used. - [MFEFLOW_E301](https://mfeflow.github.io/mfeflow/errors/E301.md): A singleton resolves to more than one version. - [MFEFLOW_E302](https://mfeflow.github.io/mfeflow/errors/E302.md): A remote is not compatible with its shell. - [MFEFLOW_E303](https://mfeflow.github.io/mfeflow/errors/E303.md): A runtime plugin imports a shared module. - [MFEFLOW_E304](https://mfeflow.github.io/mfeflow/errors/E304.md): A bundle is over its budget. - [MFEFLOW_E305](https://mfeflow.github.io/mfeflow/errors/E305.md): There is no build output to measure. - [MFEFLOW_E306](https://mfeflow.github.io/mfeflow/errors/E306.md): A dev server could not start. - [MFEFLOW_E307](https://mfeflow.github.io/mfeflow/errors/E307.md): The shell to check against could not be read. - [MFEFLOW_E401](https://mfeflow.github.io/mfeflow/errors/E401.md): Could not fetch from the registry. - [MFEFLOW_E402](https://mfeflow.github.io/mfeflow/errors/E402.md): The registry returned something that is not a feature. - [MFEFLOW_E403](https://mfeflow.github.io/mfeflow/errors/E403.md): The registry's index.json is not valid. - [MFEFLOW_E404](https://mfeflow.github.io/mfeflow/errors/E404.md): A feature in the registry folder cannot be published. - [MFEFLOW_E405](https://mfeflow.github.io/mfeflow/errors/E405.md): The registry is not trusted yet. - [MFEFLOW_E406](https://mfeflow.github.io/mfeflow/errors/E406.md): The registry changed a feature since you added it. - [MFEFLOW_E501](https://mfeflow.github.io/mfeflow/errors/E501.md): A deploy failed the schema gate. - [MFEFLOW_E502](https://mfeflow.github.io/mfeflow/errors/E502.md): A route of this remote overlaps a route of another remote. - [MFEFLOW_E503](https://mfeflow.github.io/mfeflow/errors/E503.md): The remote's shared ranges do not fit the shell that is deployed. - [MFEFLOW_E504](https://mfeflow.github.io/mfeflow/errors/E504.md): The remote is over its first-load JS budget. - [MFEFLOW_E505](https://mfeflow.github.io/mfeflow/errors/E505.md): A rollout was asked for, and a static host cannot split traffic. - [MFEFLOW_E506](https://mfeflow.github.io/mfeflow/errors/E506.md): The registry host is not set up or cannot be used. - [MFEFLOW_E507](https://mfeflow.github.io/mfeflow/errors/E507.md): There is no build output to deploy. - [MFEFLOW_E508](https://mfeflow.github.io/mfeflow/errors/E508.md): There is no such version to move to. - [MFEFLOW_E509](https://mfeflow.github.io/mfeflow/errors/E509.md): Files of the target version are missing on the host. - [MFEFLOW_E510](https://mfeflow.github.io/mfeflow/errors/E510.md): Another deploy changed the index at the same time. - [MFEFLOW_E511](https://mfeflow.github.io/mfeflow/errors/E511.md): This version is already published with different content. - [MFEFLOW_E512](https://mfeflow.github.io/mfeflow/errors/E512.md): Local registry files and the host disagree. - [MFEFLOW_E601](https://mfeflow.github.io/mfeflow/errors/E601.md): Cannot tell which version of mfeflow made this project. - [MFEFLOW_E602](https://mfeflow.github.io/mfeflow/errors/E602.md): The project is newer than the version you are upgrading to. - [MFEFLOW_E603](https://mfeflow.github.io/mfeflow/errors/E603.md): A feature migration could not be loaded or failed. - [MFEFLOW_E604](https://mfeflow.github.io/mfeflow/errors/E604.md): Files you changed need a decision. - [CLI reference](https://mfeflow.github.io/mfeflow/reference/cli.md): Every mfeflow command and flag for version 0.4.0, with the global options, exit codes and the JSON output shapes. Copied from the built command line help. - [Error codes](https://mfeflow.github.io/mfeflow/reference/errors.md): The list of every numbered mfeflow error, grouped by area with its exit code, a short title and a link to the page that explains the cause and the fix. - [feature.json reference](https://mfeflow.github.io/mfeflow/reference/feature-json.md): Every field of feature.json, the declarative file that defines an mfeflow feature, including files, dependencies, scripts, prompts, conditions and the seven built-in transform operations. - [mfe.json reference has moved](https://mfeflow.github.io/mfeflow/reference/mfe-json.md): The per-app file mfe.json is now called mfeflow.app.json. This short page keeps the old address working and links to the new reference page. - [mfeflow.app.json reference](https://mfeflow.github.io/mfeflow/reference/mfeflow-app-json.md): Every field of mfeflow.app.json, the per-app file that records an owner, shells, routes, exposed modules, events, budgets and platform ranges, with types, patterns and an example. - [mfeflow.json reference](https://mfeflow.github.io/mfeflow/reference/mfeflow-json.md): Every field of mfeflow.json, the file where the CLI records a project's apps, features, copied-file hashes, registries and budget overrides, with types, rules and an example.