Skip to content

Overview

Mosaic is a micro-frontend storefront. From the outside it’s one shopping site: a header, a product catalog, a cart, a checkout, and some marketing pages. From the inside it’s several independent applications, each built and deployed on its own, composed into a single experience in the browser at runtime.

That inside/outside split is the whole point. A micro-frontend architecture takes the idea behind microservices — independent teams, independent deploys, independent technology choices — and applies it to the frontend. In Mosaic, the catalog is a React app, the cart is a Svelte app, the content pages are an Astro app, and a React shell composes them. No team blocks another; each ships when it’s ready; and the user never sees the seams.

The point of the project isn’t the storefront — it’s the composition: how independently-built, independently-deployed frontends in different frameworks become one coherent app. Module Federation 2.0 loads them at runtime, Web Components give every framework a common mounting boundary, an event bus lets them communicate without importing each other, and a shared design system keeps them looking like one product. Each remote also owns a thin Hono backend-for-frontend, so a micro-frontend is a true vertical slice — UI and its data — that deploys end to end on its own.

  • A React shell — the host: layout, top-nav, auth/session, top-level routing, and runtime loading of every remote.
  • Catalog (React) — browse and search products, from its own BFF.
  • Cart & Checkout (Svelte) — a cart and a simple checkout, mounted in the React shell via a Web Component.
  • Content/Marketing (Astro) — SSR/static, SEO-friendly pages, integrated into the composition.
  • A shared design system — tokens and primitives as Web Components, used by all three frameworks.
  • Cross-MFE communication — a decoupled event bus for things like “add to cart.”
  • Independent deployment — every slice (UI + BFF) ships on its own.

Each build module adapts a Learn Hub course to one slice of Mosaic.

ModuleWhat you buildLearn Hub course it adapts
1 · Setup & ToolingThe pnpm monorepo, Vite, the Module Federation plugin, the Hono BFF stackFrontend tooling
2 · The Shell (Host)The React host: layout, nav, routing, host configReact
3 · Module Federation CoreExposing and consuming remotes at runtimeMicro-frontends
4 · Catalog Remote (React)A React remote and its thin Hono BFFReact
5 · Web Components InteropA remote wrapped as a custom elementWeb Components
6 · Cart Remote (Svelte)A Svelte remote mounted via a web componentSvelte
7 · Content Remote (Astro)An Astro SSR/static app in the compositionAstro
8 · Cross-MFE CommunicationA decoupled event busMicro-frontends
9 · Shared Auth & StateA session shared across MFEsBrowser storage
10 · Shared Design SystemWeb-component primitives for every frameworkWeb Components
11 · Routing Across MFEsShell and remote routing, deep-linkingReact / routing
12 · Resilience & PerformanceFallbacks, lazy loading, shared-dep dedupeFrontend performance
13 · Independent DeploymentPer-slice deploy and versioningDocker / CI

You’re ready to move on when you can answer these in your own words:

  • What does a micro-frontend architecture borrow from microservices, and what problem is it solving on the frontend?
  • Which three frameworks make up Mosaic’s remotes, and what composes them into one app?
  • Why does each remote own its own backend-for-frontend instead of all remotes sharing one API?

Next, the architecture shows how the pieces fit together.