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

Read the architecture guide →

Applications & Zone Routing

Surface boundaries across Storefront, Commerce, and Backoffice, reverse-proxy gateway precedence, and search indexing scope.

ArchitectureReference

Purpose & Scope

This reference defines the application boundaries and ingress routing rules across BookWorm’s three web surfaces: Storefront, Commerce, and Backoffice. It governs how external requests enter through a single API Gateway origin, how zone precedence resolves overlapping paths, and which surfaces are exposed to public search indexing.

Surface & Gateway Routing Topology

The visual below shows how customer and staff requests enter the single-origin API Gateway and route deterministically to backend capability APIs, the external identity provider, or the owning frontend surface.

Loading graph...

Architectural Principles & Rules

  • Single public origin: All browser traffic enters through the API Gateway reverse proxy. Frontend surfaces and backend APIs run on internal ingress only and are never exposed directly to end users.
  • Deterministic precedence: Backend API prefixes and identity provider routes match ahead of general frontend routes. Storefront acts as the lowest-priority catch-all surface for public customer discovery.
  • Exact-match collision resolution: Where a customer page shares a top-level path segment with a backend API domain (such as the shopping basket page versus basket data operations), exact page routes take higher precedence than wildcard API prefixes.
  • Isolated static assets: Each customer zone serves its static scripts, styles, and media under a distinct asset prefix so deployments never collide on shared paths.
  • Zone observability: The gateway stamps every frontend response with a zone identifier header to support rapid routing diagnostics.
Search Indexing Boundary

Storefront is the only surface configured for public search indexing and structured metadata. Commerce and Backoffice serve private, user-specific or staff-only workflows and must remain excluded from search engine crawlers.

Patterns & Boundaries

Concern / SurfaceArchitectural ApproachResponsibility BoundaryKey Trade-off
StorefrontPublic catch-all zone with aggressive component caching and structured SEO metadataOwns landing showcase, catalog discovery, book details, reviews, customer auth, and AI assistantCatch-all ownership means new top-level routes in other zones must be explicitly registered
CommerceExplicit transactional zone with dynamic, uncached rendering and crawler exclusionOwns shopping basket, checkout confirmation, customer account, and order historyDepends on Storefront for initial sign-in handoff while sharing the origin session
BackofficeIsolated staff zone mounted under a dedicated administrative base pathOwns KPI dashboard, catalog CRUD, customer management, order operations, and review moderationRequires explicit staff role enforcement and separate authentication scopes
API GatewayReverse proxy reading a shared customer routing manifest alongside backend route rulesOwns TLS termination, CORS enforcement, prefix stripping, and zone header taggingAdding a top-level Commerce route requires updating the shared routing manifest

Quality & Operational Impact

  • User Experience: Serving Storefront and Commerce behind one origin eliminates cross-domain redirects, cookie-scoping friction, and CORS complexity for shoppers.
  • Performance: Isolating Storefront from transactional Commerce workflows allows public catalog pages to be aggressively cached without risking stale basket or order data.
  • Security: Internal-only container ingress ensures all traffic passes through gateway routing, CORS, and identity boundaries.