Architecture Overview
Micro Frontends Platform — React + TypeScript, Module Federation v2, Cloudflare Workers
Table of Contents
- System Architecture Diagram
- Technology Stack
- Data Flow
- Repository Map
- Team Ownership Model
- Related Documents
System Architecture Diagram
Technology Stack
| Layer | Technology | Version | Purpose |
|---|---|---|---|
| Frontend Framework | React + TypeScript | ^19.2.4 / ^5.9.3 | UI rendering, CSR-only |
| MFE Composition | Module Federation v2 (@module-federation/enhanced) | ^2.0.1 | Runtime remote loading |
| Bundler | Rsbuild (@rsbuild/core) / Rspack | ^1.7.3 | Fast builds with native MF v2 support |
| Design System | Custom (npm + MF remote) + Storybook | ^10.2.10 (Storybook) | Shared UI component library |
| Styling | CSS Modules / Tailwind CSS | — | Scoped styles per MFE |
| Routing | react-router (consolidated from react-router-dom) | ^7.13.1 | Client-side routing |
| State Management | zustand | ^5.0.11 | Lightweight stores per MFE |
| Validation | zod | ^4.3.6 | Runtime schema validation |
| JWT Handling | jose | ^6.1.3 | Token signing/verification in Workers |
| Package Manager | pnpm | 10.30.3 | Content-addressable store, strict deps |
| Monorepo Tool | Turborepo (turbo) | ^2.8.10 | Task orchestration, remote caching |
| Linting | ESLint (flat config only) | ^10.0.2 | Static analysis |
| Testing | Vitest | ^4.0.18 | Unit / integration tests |
| Runtime | Node.js | 22 (Maintenance LTS), 24 (Active LTS) — Node 20 EOL April 2026 | Build & CI runtime |
| Edge Runtime | Cloudflare Workers (Wrangler v4) | — | API gateway, BFFs, Workers Static Assets (Pages deprecated Apr 2025) |
| Object Storage | Cloudflare R2 | — | Versioned MFE bundle storage |
| KV Store | Cloudflare KV | — | Version config (fast edge reads) |
| SQL Database | Cloudflare D1 (GA since April 2024) | — | Audit trail, version history |
| Real-time | Durable Objects (Hibernatable WebSockets) | — | WebSocket coordination; Workers CPU time configurable up to 5 min |
| Compatibility Date | Cloudflare Workers | 2026-02-25 | Baseline compatibility date for all Workers |
| Authentication | WorkOS AuthKit | — | OAuth, enterprise SSO, RBAC |
| CI/CD | GitHub Actions | — | Build, test, deploy pipelines |
| Versioning | Changesets | — | Independent semantic versioning |
| Cross-repo Updates | Renovate | — | Automated dependency updates |
| Local Dev (cross-repo) | yalc + Verdaccio | — | Local package linking and registry |
Data Flow
Page Load Sequence
API Request Flow
Real-time Flow
Repository Map
Team Ownership Model
| Team | Owns | Repos | Responsibilities |
|---|---|---|---|
| Platform | Shell App, API Gateway, Version Service, CI/CD, Design System | shell-app, api-gateway, version-service, platform-core | Infrastructure, shared tooling, MFE onboarding, release coordination |
| Team Alpha | Dashboard MFE, Dashboard BFF | mfe-dashboard, BFF in bff-workers | Dashboard features, data visualization |
| Team Beta | Settings MFE, Settings BFF | mfe-settings, BFF in bff-workers | User/org settings, preferences |
| Team Gamma | Analytics MFE, Analytics BFF | mfe-analytics, BFF in bff-workers | Reporting, charts, data export |
| Team Delta | Messaging MFE, Real-time Service | mfe-messaging, realtime-service | Chat, notifications, WebSocket features |
Ownership Principles
- Vertical ownership: Each team owns their MFE end-to-end (UI → BFF → data).
- Shared libs are platform-owned: The monorepo is maintained by the Platform team with contributions from all teams via PRs.
- Autonomous deployments: Each MFE can be deployed independently without coordinating with other teams.
- Contract-based integration: Teams agree on event contracts (CustomEvents) and API schemas, not implementation details.
- Design system governance: Platform team reviews and merges design system changes; feature teams propose via PR.
Key Architectural Decisions
| Decision | Choice | ADR |
|---|---|---|
| MFE composition | Module Federation v2 | ADR-001 |
| Edge platform | Cloudflare Workers | ADR-002 |
| Repository strategy | Hybrid mono + poly | ADR-003 |
| Package manager | pnpm | ADR-004 |
| Authentication | WorkOS AuthKit | ADR-005 |
| Monorepo orchestration | Turborepo | ADR-006 |
| Inter-MFE communication | Browser CustomEvents | ADR-007 |
| Bundler | Rsbuild / Rspack | ADR-008 |
Related Documents
| Document | Description |
|---|---|
| Module Federation | MF v2 configuration, shared deps, dynamic remotes |
| Cloudflare Infrastructure | Workers, R2, KV, D1, service bindings |
| Design System | Dual distribution, theming, Storybook |
| Local Development | Dev workflow, yalc, Verdaccio, Miniflare |
| Repository Strategy | Monorepo/polyrepo structure, Turborepo, pnpm |
| Real-time Communication | Durable Objects, WebSockets, hibernation |
| Version Management | Admin UI, version pinning, rollback |
| Authentication | WorkOS, JWT validation, session management |
| CI/CD & Deployment | GitHub Actions, Changesets, preview envs |
| Inter-MFE Communication | CustomEvents, typed payloads, patterns |