Storefront has been decoupled into micro-frontends with a dedicated commerce app and shared shell.

Read the architecture guide →

Multi-Zone Composition

Why BookWorm splits customer discovery and authenticated checkout into two zones behind one gateway origin, and how cross-zone navigation works.

ArchitectureReference

Purpose & Scope

This reference explains BookWorm’s multi-zone microfrontend architecture for customer-facing experiences: Storefront (public discovery) and Commerce (authenticated shopping and account management). It defines why these two zones are separated behind a single API Gateway origin and how they coordinate routing, assets, and authentication.

Cross-Zone Sign-In Handoff

The visual below illustrates how an unauthenticated shopper crossing from Storefront into a protected Commerce route is redirected to Storefront’s identity handoff and returned seamlessly to their destination.

Loading graph...

Architectural Principles & Rules

  • Workload isolation by caching profile: Public catalog discovery (Storefront) and private transactional workflows (Commerce) run as separate application deployments so aggressive component caching and SEO optimization never risk leaking user-specific basket or order state.
  • Single-origin presentation: Both customer zones share one HTTPS origin via the API Gateway, eliminating cross-domain cookie complexity, extra identity redirect URIs, and CORS overhead.
  • Shared routing manifest: Both the reverse proxy and the microfrontend framework read a single authoritative route manifest so path ownership and static asset prefixes stay synchronized.
  • Document-level zone isolation: Transitions across the Storefront–Commerce boundary use full-document navigation with prefetching rather than runtime bundle federation, preventing React tree or global state coupling across independent deployments.
Single Customer Authentication Owner

Storefront owns the customer authentication callback and identity provider integration. Commerce does not host its own login handler; it validates the shared origin-scoped session cookie and redirects unauthenticated visitors back to Storefront’s sign-in flow.

Patterns & Boundaries

Concern / SurfaceArchitectural ApproachResponsibility BoundaryKey Trade-off
Zone SplitTwo independent web runtimes behind one API GatewayStorefront owns discovery and AI chat; Commerce owns basket, checkout, and ordersTwo customer containers to operate, repaid by independent scaling and cache isolation
Asset IsolationDedicated asset prefix per non-root zoneCommerce serves static bundles under an isolated asset pathPrevents static asset collisions, but requires gateway route registration for zone assets
Shared ChromeBuild-time shared customer shell packageShared shell owns header, footer, mobile nav, and basket indicatorVisual consistency without runtime federation; shell updates rebuild both customer apps
Cross-Zone NavigationPrefetched cross-zone link abstractionShared shell provides zone-aware links; browser performs clean runtime handoffSlightly heavier transition across zones than intra-app routing, mitigated by prefetching

Quality & Operational Impact

  • Deployment Agility: Teams can release Storefront catalog or AI assistant updates without redeploying or risking Commerce checkout stability.
  • Security & Privacy: Separating caching profiles at the application boundary provides defense-in-depth against accidental caching of authenticated customer data.
  • Reliability: A fault or memory spike in conversational AI streaming remains isolated to Storefront and cannot degrade Commerce checkout.