Progressive Tutorial: Build an Enterprise Microfrontend from Scratch
Welcome to the end-to-end Braid tutorial. In this guide, you will build a complete, production-ready microfrontend system from a blank slate.
TIP
Prefer an interactive sandbox? You can run and explore the completed tutorial project directly in your browser with zero local setup:
What You Will Build
You will construct Acme Cloud Portal, an enterprise application composed of:
- Host Shell: An Angular application providing global navigation, user context, and layout.
- Billing Remote: An independently deployed React application responsible for invoices and checkout.
- Braid Gateway: A single-origin gateway performing parallel streaming, server-side piercing, and exact namespace routing.
- Resilient Data Layer: Local-first IndexedDB persistence with versioned schemas that survive independent deployment rollouts.
Tutorial Roadmap
Follow the progressive steps below:
- Step 1: Monorepo & Two Apps Initialize a blank Nx monorepo and create an Angular Host and React Remote running standalone.
- Step 2: Gateway & Manifest Set up
@braidlabs/gatewayon port 3000, write the fragment manifest, and test parallel SSR piercing. - Step 3: Mounting & Isolation Embed the React remote into the Angular shell with
<braid-fragment>, verifying Shadow DOM encapsulation and realm isolation. - Step 4: Props, Events & Context Bus Establish decoupled bidirectional communication with typed props and custom events.
- Step 5: Versioned Data & Offline Outbox Layer in
@braidlabs/dataand@braidlabs/skewfor local-first storage with optimistic updates. - Step 6: Surviving Schema Evolution Simulate a rolling deployment where the Remote deploys Schema V2 while the Host runs V1, using
@braidlabs/contractto migrate seamlessly. - Step 7: Production Hardening & Service Worker Add
@braidlabs/swfor chunk caching across deploys, configure fallback UI, and inspect the system using@braidlabs/console.
Ready to begin? Head over to Step 1: Monorepo Setup!