ADR-0023 — Micro-Frontend (MFE) UI architecture: domain MFEs composed via Module Federation, capability-based auth, BFF-per-MFE
Context
ION’s V3 UI surface has grown into two customer/analyst-facing shell applications (per system ownership in ARCHITECTURE-OVERVIEW) — Alya (Defender Workbench for Ontinue Analysts and Advisors) and Veritas / ION Portal (customer-facing) — plus internal tools and the reporting/dashboard surface introduced in ADR-0022. Multiple ION systems now own UI capabilities within these shells:
- Incidents Management (owned by the Incident-bounded-context team).
- Investigation (owned by the Investigation team).
- Service Requests (Bondi).
- Reporting / Dashboards (Veritas per ADR-0022).
- Automation Workbench (Cogs UI surfaces).
- Rules of Engagement / Engagement Model (customer + advisor variants with different read/write scopes).
The V2 baseline was a monolithic React SPA per shell — a single frontend team owned the codebase, deployments were coupled, and adding a domain feature meant a cross-team PR into a shared repo. As the number of contributing teams grew, that model became a bottleneck on the same axes that pushed the backend from Tiberium’s shared substrate to independently-deployed microservices (per ADR-0002, ADR-0001):
- One shared deployment cadence for everyone.
- One shared build/test/CI budget.
- One shared blast radius on regressions.
- Difficult tech-stack evolution (upgrading React/framework versions requires coordinated migration across every team).
- Multi-persona/multi-shell code sharing (a Service Requests feature needed in both Alya and Portal) forces either copy-paste or awkward monolith-wide abstraction.
- Multi-tenant/multi-persona auth (customer vs advisor vs defender vs automation coach) with distinct Entra apps became increasingly hard to model inside a single monolith.
V3 needs a UI architecture that lets multiple domain teams ship
independently into shared shells, matches the backend’s system/domain
boundaries, and cleanly models the multi-persona / multi-shell / capability
matrix documented in MFE- Authentication & Authorisation Patterns.md.
Forces / Drivers
- Requirement / Constraint: Multiple domain teams (Incidents, Investigation, Service Requests, Reporting, Automation Workbench, RoE/EM) each own UI capabilities and must deliver at their own cadence; two shells (Alya, Veritas/Portal) share domain MFEs; distinct user personas (customer, advisor, defender, automation coach) authenticate against different Entra applications per ADR-0009 and ADR-0010; reporting dashboards ship as first-class UI widgets per ADR-0022.
- Principle(s) embodied: § 1 Volatility-based decomposition (UI decomposition mirrors backend system boundaries); § 2 Microservices (independently deployable units on the FE too); § 13 BFF pattern (extended from one BFF per frontend to one BFF per MFE); § 14 Independent scalability (independent delivery cadence); § 17 Failure containment (a broken MFE does not take the shell down); § 22 Least privilege (capability-based per-MFE access control); § 23 Blast-radius containment (per-MFE deploy blast radius).
- WAF pillar optimized:
operational-excellence(primary — independent delivery, team autonomy, per-MFE CI/CD, incremental upgrades);performance-efficiency(bundle-splitting per domain, lazy loading);security(capability-based auth, per-MFE BFF token boundary).
Decision
ION V3 adopts a Micro-Frontend (MFE) architecture for its customer/analyst-facing UI surfaces. Concretely:
1. Composition model — Module Federation with Shell + Provider + Consumer
- Two shells: Alya (Defender Workbench, single-tenant Entra app for Ontinue personas) and Veritas/ION Portal (multi-tenant Entra app for customer personas).
- Each domain owns a domain MFE (“Provider” / “Remote” in Module Federation terms): Incidents MFE, Investigation MFE, Service Requests MFE, Reporting MFE, Automation Workbench MFE, RoE/EM MFE.
- Shells load MFEs at runtime via Module Federation; MFEs are independently built and deployed.
- Sub-shell composition allowed. An MFE may host another MFE
as a sub-shell where domain composition requires it — e.g., the
Incidents MFE hosts the Investigation MFE as a sub-shell for the
incident-investigation journey (per
Planned MFE Architecture for Incidents and Investigation in Alya FE.md). The Alya shell does not directly load Investigation MFE for this journey; incidents own the composition.
2. Build tool — Rsbuild
- Rsbuild is the sanctioned bundler/toolchain (Webpack-based, battle-tested Module Federation implementation).
- Vite’s module federation plugin is not yet sanctioned — it is
catching up but not production-ready for ION’s use case
(per
MFE Patterns.md).
3. Shell responsibilities
- Global layout, header/footer, top-level routing, auth/session bootstrap, top-level route guards.
- Cross-cutting providers hosted in the shell: Theme, MSAL, Notifications/Snackbar, Telemetry.
- Runtime remote-loading primitives and platform-level error boundaries so a broken MFE does not take the shell down.
- Interceptor that attaches the JWT to every outgoing request.
- The shell does not implement domain rendering logic.
4. MFE responsibilities
- Own its domain UI, state, mutation hooks, side effects, and telemetry.
- Own its QueryProvider / QueryClient locally (not shared with shell) — prevents one MFE from invalidating another’s query cache.
- Handles its own domain error surface through the shared Snackbar provider; retries and error-shape decisions live in the MFE.
- Uses shell-provided Theme, MSAL, Notifications (reverse dependency accepted and documented).
- May expose multiple components per deployment (bundle-size considerations are handled via lazy loading, so a shell that loads one component doesn’t pay for the whole MFE upfront).
5. Backend — BFF-per-MFE
- Each MFE has its own BFF (“Micro-BFF”), extending § 13 from “BFF per frontend” to “BFF per MFE”.
- User tokens terminate at the MFE-BFF (per ADR-0013); downstream calls use the BFF’s UAMI.
- APIs follow json:api conventions from ADR-0020.
6. Authentication & Authorisation — capability-based contract
Documented in full in MFE- Authentication & Authorisation Patterns.md;
summarised here:
- Instead of raw role-based checks scattered across MFEs, a
capability contract is issued to the browser at shell-load
time, describing:
scope— customers × tenants × workspaces the user can see;permissions—<DomainEntity>.<Read|ReadWrite>(e.g.SecurityIncident.Read,EM.ReadWrite) — abstraction layer above Entra app-roles;mfe-access— which MFEs the user may load;shell—alya | bondi | portalcontext.
- APIM validates scope against the request URL as a global policy; MFE-BFF enforces permissions per route; domain services remain the final authority on domain rules.
- Design goals (from ref): single MFE works across shells, no role logic in MFE code, no duplicated authZ across BFFs, centralised capability + scope resolution, domain owns final authority, works with multiple Entra apps (public + internal).
- URL pattern for scope validation: Option A
(
/mfe-domain/tenants/{tenantId}/…with tenantId in the path) is the sanctioned default; Option B (query-parameter filters) may come later.
7. Cross-MFE communication
- MFEs are self-contained — fetch their own data, manage their own state.
- No shared hidden state between MFEs; explicit contracts and events instead.
- Sub-shell composition (Incidents → Investigation) uses explicit
component consumption (e.g., Incidents MFE imports
AiAgentCategorizationCard,InitialFactsCard,AssessmentCard,KeyFindingsCard,HypotesisCardfrom Investigation MFE).
8. Shared component library
- A shared component library provides visual consistency + reuse (styleguide + collaboration surface for designers and developers); it is versioned and consumed as an NPM package, not runtime-federated.
9. Deployment & CI/CD
- Each MFE has its own CI/CD pipeline (per Runway convention — future ADR); build, test, and deploy independently through Alpha/Beta/Gamma/Prod.
Monolithic React SPA vs Micro-Frontend architecture
The load-bearing decision is why MFE at all. This table captures the trade-off explicitly. Neither model is universally better — MFE wins for ION at V3’s team-count and shell-count posture; a monolith SPA remains the right answer for smaller teams or single-team products.
| Dimension | Monolithic React SPA (V2 baseline) | Micro-Frontend architecture (V3, selected) |
|---|---|---|
| Team autonomy | Every domain team ships into one repo; PRs contend for review + merge queue. | Each domain team owns a repo, pipeline, and release cadence. |
| Delivery cadence | Coupled — everyone releases together (or nobody does). | Independent — MFEs deploy on their own cadence. |
| Blast radius on regression | A regression anywhere can block all teams’ releases. | Bounded to the offending MFE; shell error boundaries contain it. |
| CI/CD budget | Shared — one long build, one flaky test blocks everyone. | Per-MFE — a slow test in Investigation doesn’t hurt Incidents. |
| Tech-stack evolution | React / framework upgrades require whole-repo coordinated migration. | MFEs upgrade independently at their own pace; incremental migration is a first-class capability. |
| Cross-shell reuse | Copy-paste or awkward monolith-wide abstraction (Service Requests in both Alya and Portal). | Same MFE consumed by multiple shells with capability-contract-driven per-persona behavior. |
| Domain / Conway alignment | UI decomposition fights backend system boundaries — one FE team owns UI for many backend systems. | UI decomposition mirrors backend systems (Incidents, Investigation, etc. per ADR-0002). |
| Initial complexity | Lower — one repo, one build, one deployment. | Higher — multiple repos, Module Federation wiring, cross-MFE contracts, capability contract. |
| Bundle size / first-load performance | Better up front (one optimised bundle) if code-split diligently; can bloat as codebase grows. | Comparable with lazy loading + shared vendor chunks; avoids the monolith-bloat curve. |
| Cross-MFE state & runtime coupling | N/A — everything is in one memory space (which is itself a hazard — see below). | Explicit contracts required; risk of hidden coupling if disciplined poorly. |
| Runtime failure containment | A broken component in one domain can break the whole SPA (no natural boundary). | Shell error boundaries isolate a broken MFE; the rest of the shell keeps working. |
| Testing model | Fast unit tests but expensive integration/E2E scope. | Unit + contract tests per MFE; shell-level E2E covers composition. |
| Multi-persona / multi-Entra-app auth | Persona branching is scattered across the monolith. | Capability-based contract centralises persona resolution; MFEs stay persona-agnostic. |
| Skill / hiring model | One frontend team owns everything; contributors from domain teams are guests in the repo. | Domain teams own their own FE code — matches how ION’s backend teams already work. |
| Operational burden | One deployment target. | N deployment targets, N BFFs, N pipelines, capability service, Module Federation runtime. |
| Debugging / observability | Simple browser stack traces; state inspection in one place. | Cross-MFE tracing needs correlation ID discipline (per ADR-0021); DevTools work but require federation-aware setup. |
| Right for | Small team, single shell, single persona, tight product scope. | Multiple domain teams, multiple shells, multi-persona, evolving scope. |
Where ION lands. V3’s team count (Incidents, Investigation, Service Requests, Reporting, Automation Workbench, RoE/EM), shell count (Alya + Portal), persona count (customer / advisor / defender / automation coach), and cross-shell code sharing requirement all push firmly into MFE territory. The complexity tax is real and called out in Consequences below; ION accepts it in exchange for the delivery-cadence and blast-radius wins.
Alternatives Considered
Composition model
Option A — Module Federation (Rsbuild) (selected)
Option B — Monolithic React SPA per shell (V2 baseline)
Rejected — decisive: does not scale across the team count, shell count, and persona count V3 has now. See comparison table above; V2 baseline experience is the concrete evidence.
Option C — Iframe-based composition
Rejected — decisive: user-experience penalties (scroll/layout issues, focus management, keyboard traps, deep-linking friction, theme/CSS isolation vs global styling) and auth/session sharing complexity across iframe boundaries. Reinforcing: bundle overhead (each iframe reloads its own React runtime); no first-class component composition across iframes.
Iframes remain a fit for embedding fundamentally-external content (e.g., PowerBI reports if we still had them; third-party dashboards). They are not fit for first-party MFE composition.
Option D — Web Components / Custom Elements
Rejected — decisive: framework-agnostic gain is not what ION needs — every MFE team is on React by convention. Reinforcing: weaker developer ergonomics for React-native state, context, and hooks; worse type-safety at MFE boundaries.
Option E — Server-side composition (SSI / Edge Includes)
Rejected — decisive: ION UIs are interactive SPAs, not server-rendered pages — the composition is dynamic, driven by route + capability + user action.
Option F — Single-SPA framework
Rejected — decisive: Module Federation with Rsbuild covers Single-SPA’s use case without an extra framework layer. Reinforcing: smaller ecosystem for the specific problems ION has (Rsbuild’s Module Federation implementation is Microsoft/community backed and battle-tested for React).
Option G — Piral / Luigi / qiankun (specialised MFE frameworks)
Rejected — decisive: additional framework surface with no capability gap over Module Federation + Rsbuild. Reinforcing: community size and long-term maintenance are weaker; lock-in to a specialised framework for negligible gain.
Option H — Build-time federation only (Nx monorepo, published NPM packages, one deploy)
Rejected — decisive: monorepo without runtime composition still couples deployment — every merge triggers a shared deploy. Reinforcing: loses the independent-CI/CD win which is the primary value of MFE.
Nx-style monorepo tooling may still be adopted for the shared component library (§ 8) — not for the MFE composition.
Build tool
Option BT1 — Rsbuild (selected)
Option BT2 — Webpack directly
Rejected — Rsbuild wraps Webpack Module Federation with better defaults and DX at no meaningful cost.
Option BT3 — Vite’s Module Federation plugin
Rejected — decisive: not yet production-ready for ION’s Module
Federation shape (per MFE Patterns.md — Damian’s evaluation);
Rsbuild’s implementation is significantly more battle-tested.
Revisit when Vite’s plugin catches up.
Auth / AuthZ
Option AZ1 — Capability-based contract (selected — see Decision § 6)
Option AZ2 — Raw role checks scattered across MFE + BFF code
Rejected — decisive: duplicates authZ logic across N BFFs and N MFEs. Reinforcing: multi-shell scenarios (same MFE in Alya + Portal with different personas) become brittle; no centralised scope resolution means every MFE has to re-implement customer / tenant / workspace filtering.
Option AZ3 — Access-control decisions inside APIM only
Rejected — decisive: APIM cannot enforce domain rules (valid state transitions, per-field edit permissions) — those belong to the domain service. Retained: APIM does enforce scope as the first-line filter (§ 6).
Cross-MFE state / providers
Option CS1 — Cross-cutting providers (Theme, MSAL, Notifications) in shell; QueryProvider per-MFE (selected)
Option CS2 — All providers shared globally in shell
Rejected — decisive: shared QueryProvider means one broken MFE can
invalidate every other MFE’s cache (accidental
queryClient.invalidateQueries() example from MFE Patterns.md).
Option CS3 — Every provider local to each MFE
Rejected — decisive: duplicates cross-cutting state (theme, MSAL, notifications) leading to inconsistent UX across the shell.
MFE granularity
Option G1 — Multiple exposed components per MFE (per feature area) (selected)
Option G2 — One MFE per exposed component
Rejected — decisive: excessive Module-Federation overhead (N pipelines, N deployments, N shared-vendor negotiations) for negligible isolation gain.
Option G3 — MFEs never further split — always the smallest possible unit
Same rejection grounds as G2.
Domain boundary — Incidents vs Investigation
Option D1 — Two MFEs: Incidents + Investigation, sub-shell composition (selected)
Option D2 — One combined Incidents+Investigation MFE
Rejected — decisive: fights the backend domain boundary — the Incident bounded context and Investigation bounded context are already separately owned on the backend (ADR-0002). Reinforcing: team coupling (one repo, shared release, blurred responsibility) — same set of arguments as monolith-vs-MFE at a smaller scale.
Rationale
Micro-frontends are the frontend expression of the same volatility-based decomposition that shaped the ION backend. Each domain team already owns a backend system; MFE lets that team own the UI surface too, deploying independently, with a clear domain boundary. Team autonomy, cadence, and blast-radius wins are the primary payoff — matching § 14 and § 23.
Module Federation wins as the composition mechanism because it delivers runtime independence (not just build-time) — which means true independent deployment, which is where all of MFE’s value actually lives. Iframes trade UX and auth pain for that isolation; Web Components trade React ergonomics; SSI is the wrong shape for interactive SPAs. Rsbuild is the mature, battle-tested Module Federation implementation for React; Vite’s plugin is a watch-item, not yet production-ready.
BFF-per-MFE extends § 13 naturally: the value of a BFF is that it serves one frontend’s needs. When the frontend fragments into MFEs, so does the BFF.
Capability-based auth centralises what would otherwise be duplicated across N BFFs and N MFEs. It also cleanly models the multi-persona / multi-shell / multi-Entra-app matrix that scattered role checks cannot express without an explosion of branches. APIM enforces scope, BFF enforces permissions, domain services own domain rules — each authorization concern lives at the layer that owns it.
The Incidents-hosts-Investigation sub-shell pattern is the concrete proof that MFE composition can express domain-driven journeys without dragging the shell into domain logic. Shell stays domain-agnostic; domain composition happens between domain MFEs.
Consequences
Positive
- Team autonomy — each domain team owns repo, pipeline, cadence, release; matches how ION’s backend teams already work.
- Independent delivery cadence — Incidents can ship without waiting for Investigation, and vice versa.
- Blast radius bounded to a single MFE; shell-level error boundaries contain failures.
- Tech-stack evolution is incremental — no whole-repo coordinated migration for React / library upgrades.
- Cross-shell reuse works cleanly — Service Requests MFE runs in both Alya and Portal, driven by capability contract.
- Sub-shell composition (Incidents → Investigation) expresses domain-driven journeys without leaking domain logic into the shell.
- Capability-based auth centralises persona/scope resolution and keeps MFEs persona-agnostic.
- BFF-per-MFE preserves § 13 boundary at the finer granularity that MFE demands.
Negative
- Initial complexity is materially higher than a monolithic SPA — Module Federation wiring, shared-vendor negotiation, sub-shell contracts, capability contract, BFF-per-MFE plumbing, per-MFE pipelines. This is a permanent tax, not a one-time cost.
- N deployment targets, N BFFs, N pipelines — operational surface area grows linearly with MFE count.
- Cross-MFE contracts (Incidents consuming Investigation components) need versioning discipline — breaking a shared component surface is a cross-team incident.
- Shared-vendor bundle strategy must be actively maintained; drift causes duplicate React runtimes in the browser.
- Debugging across MFE boundaries requires correlation-ID discipline (per ADR-0021) and federation-aware DevTools setup.
- SignalR / long-lived-connection patterns across MFE boundaries
need explicit handling (open item in
MFE Patterns.md; closed by the 2026-10-15 amendment). - Reverse dependency on shell providers (Theme, MSAL, Notifications) is accepted — MFEs implicitly assume the shell provides them.
Neutral / follow-ups
- Publish
standards/mfe-standards.mdcodifying: exposed-component contract shape, versioning, capability contract, provider boundaries, error handling, granularity rules. - Publish
patterns/module-federation.mdwith the shared-vendor strategy, lazy-loading pattern, and error-boundary shape. - Capability service to issue the capability contract to browsers — likely a Veritas/Alya BFF-level concern; ADR follow-up if the design surface warrants it.
- SignalR-across-MFE pattern — closed by the 2026-10-15 amendment.
- Shared component library governance (versioning, breaking-change policy) — follow-up.
- Revisit Vite’s Module Federation plugin as it matures.
- Contract tests between shell + MFE and between hosting MFE + sub-shell MFE.
WAF Pillar Impact
- Primary pillar:
operational-excellence— independent delivery, team autonomy, per-MFE CI/CD, incremental tech-stack upgrades. - Secondary pillars:
performance-efficiency(bundle-splitting per domain, lazy loading);security(capability contract + BFF-per-MFE token boundary + APIM scope enforcement). Cost-optimization: neutral — pipeline/hosting cost grows with MFE count but per-team delivery velocity offsets it at V3’s team count. - Trade-offs: MFE adds runtime and organisational complexity that a monolithic SPA does not carry. ION accepts this because the monolith-SPA cadence and blast-radius costs at V3’s team/shell/persona count exceed the MFE complexity tax.
Previous approach (V2)
V2 shipped a monolithic React SPA per shell with one frontend team owning each repo. As domain teams (Incidents, Investigation, Service Requests, Reporting, Automation Workbench, RoE/EM) grew and started contributing UI, the monolith model produced the well-known symptoms captured in the comparison table above:
- Shared release cadence became the throughput ceiling.
- One team’s regression could block every team’s release.
- Cross-shell code sharing (same feature in Alya + Portal) forced copy-paste or awkward monolith-wide abstraction.
- Multi-persona / multi-Entra-app auth branching scattered across the codebase.
- Framework upgrades required whole-repo coordinated migration.
V3 replaces per-shell monolith with MFE composition, keeping the two shells as thin platform hosts and moving domain UI into independently-owned, independently-deployed MFEs.
Amendments
-
2026-10-15 — SignalR across MFEs closed. The open item is resolved by the single Shell SignalR BFF (
alya-bff-shell-signalr):- the shell holds the only SignalR connection per browser session and
shares it with every MFE through the
@fe-ws/signalrModule Federation singleton; - each MFE subscribes through its own BFF, which authorizes the user and relays to the Shell SignalR BFF’s internal API; group membership is per user and backend-controlled;
- producers publish signed CloudEvents to Service Bus, and the Shell SignalR BFF is the only writer to the hub.
The WebSocket leg through Application Gateway is permitted edge exception 3 in ADR-0015. The design, the onboarding checklists, and the open gaps are in the V3 real-time design.
- the shell holds the only SignalR connection per browser session and
shares it with every MFE through the
-
2026-10-15 — Edge routing for MFE BFFs. A new MFE uses one catch-all
/api/*Front Door route to its own BFF’s APIM API (<short>-extin the MFE product). The only shared routes allowed on an MFE host are Signet capabilities and, on the shell host, the Shell SignalR negotiate path. The Alya-family per-resource routes, which let one MFE call several BFFs, are transitional and recorded as a gap against “BFF per MFE” in routing and ingress.
References
references/Micro Frontends.md— Shell / Provider / Consumer model; Module Federation; independent deployment; BFF pattern extension; shared component library; example.references/MFE- Authentication & Authorisation Patterns.md— capability-based contract, scope resolution, permissions, MFE-access, walk-through across Shell / MFE / APIM / MFE-BFF.references/MFE Patterns.md— sub-routing, notifications, provider nesting, theme mode, error handling, token injection, SignalR across MFE, granularity, Rsbuild vs Vite.references/Planned MFE Architecture for Incidents and Investigation in Alya FE.md— worked example: two domain MFEs, sub-shell composition, route ownership.- External: Micro-frontends primer — https://martinfowler.com/articles/micro-frontends.html
- External: Rsbuild / Module Federation — https://rsbuild.dev
- External: Module Federation docs — https://module-federation.io/
Related ADRs
- Depends on: ADR-0001 (frontend applies the same architecture-style logic to UI units); ADR-0002 (UI boundaries mirror backend systems); ADR-0009 (Entra apps per persona); ADR-0010 (multi-persona / multi-Entra-app model); ADR-0013 (BFF pattern extended to BFF-per-MFE); ADR-0014 (APIM enforces scope on MFE-BFF routes); ADR-0020 (MFE-BFF APIs follow json:api); ADR-0022 (Reporting is one of the domain MFEs).
- Depended on by: pending Capability Service ADR (if it warrants one); per-system UI ADRs (Alya MFE topology, Veritas MFE topology).
- Related: ADR-0021 (correlation-ID discipline for cross-MFE tracing).