A coffee roaster's back office, made of two micro frontends: Orders and Customers. Each one is built separately and ships its own copy of React and PrimeReact. The host is a third React app that uses PrimeReact with Aura in the default mode, and it loads the micro frontends at runtime.
Orders uses Lara and Customers uses Nora, each in isolated mode inside its own shadow root. Switching tabs unmounts one app and mounts the other. Dialogs, select panels and toasts keep the theme of the app that opened them. The host's button keeps its Aura look, and the dark mode button in the header switches all three.
npm install
npm run devnpm run dev builds the two micro frontends into public/mfe first, then starts the host.
vite.orders.config.tsandvite.customers.config.tsbuild each micro frontend as a separate bundle, the way two teams would build and release them.src/host/Shell.tsxis the host. It loads/mfe/orders.jsor/mfe/customers.jswithimport()when a tab is clicked, callsmountOrdersormountCustomerswith its outlet and keeps the function that unmounts the current app.src/orders/mount.tsxandsrc/customers/mount.tsxcreate an element with a shadow root, add the app's own CSS to it and renderPrimeReactProviderwithwithIsolation({ key, root }). Therootelement carries the app key, so the app's own CSS can read theme variables such as--p-content-border-color.
Read more in Micro frontends with their own PrimeUI theme.