---
id: bookworm
name: BookWorm
summary: |
  Core e-commerce domain for the BookWorm online bookstore, coordinating catalog discovery,
  customer baskets, order fulfillment, customer reviews, conversational guidance, and platform operations.
version: 1.0.0
owners:
  - architecture-enabling-team
domains:
  - id: catalog
  - id: reviews
  - id: ordering
  - id: shopping
  - id: platform
  - id: conversational
diagrams:
  - id: bookworm-event-storming
badges:
  - content: Core Domain
    backgroundColor: blue
    textColor: blue
    icon: RectangleGroupIcon
  - content: Business Critical
    backgroundColor: red
    textColor: red
    icon: ShieldCheckIcon
repository:
  url: "https://github.com/foxminchan/BookWorm"
---

## Business Purpose & Boundary

BookWorm is the root business domain for an online bookstore marketplace, decomposed into six autonomous bounded contexts by Domain-Driven Design (DDD) strategic importance: four Core domains ([[domain|catalog]], [[domain|shopping]], [[domain|ordering]], [[domain|conversational]]), one Supporting domain ([[domain|reviews]]), and one Generic domain ([[domain|platform]]). Each bounded context owns its authoritative business state and communicates across boundaries exclusively through explicit, versioned synchronous and asynchronous contracts. Explicitly **out of scope** for BookWorm are external payment-provider settlement, physical shipping carrier execution, external SMTP delivery internals, AI model hosting internals, and external identity provider infrastructure ([[system|identity-provider]]).

:::warning
Bounded contexts never share databases or reach directly into another context's persistence store. Derived projections—such as catalog rating summaries, semantic search indexes, and order dashboard summaries—remain strictly rebuildable from their authoritative owning contexts.
:::

## Core Responsibilities & Capabilities

| Subdomain                      | DDD Classification | Core Capability                                                                                   | Owning Team                         |
| :----------------------------- | :----------------- | :------------------------------------------------------------------------------------------------ | :---------------------------------- |
| **[[domain\|catalog]]**        | Core               | Canonical book metadata, taxonomies, pricing, availability, and hybrid discovery                  | [[team\|catalog-experience-team]]   |
| **[[domain\|shopping]]**       | Core               | Authenticated customer baskets, pre-purchase intent, and checkout cleanup                         | [[team\|commerce-fulfillment-team]] |
| **[[domain\|ordering]]**       | Core               | Accepted purchase records, locked order pricing, lifecycle state, and post-checkout orchestration | [[team\|commerce-fulfillment-team]] |
| **[[domain\|conversational]]** | Core               | Privacy-filtered multi-agent book discovery and read-only store-policy guidance                   | [[team\|ai-capabilities-team]]      |
| **[[domain\|reviews]]**        | Supporting         | Individual customer feedback submissions, rating publication, and review summarization            | [[team\|catalog-experience-team]]   |
| **[[domain\|platform]]**       | Generic            | Cross-cutting recurring job scheduling and transactional email delivery                           | [[team\|platform-engineering-team]] |

## Cross-Domain Interactions (Context Map)

| Neighboring Domain / System                                                | Direction                                                       | Integration Mechanism                 | Business Data Exchanged                                                                  |
| :------------------------------------------------------------------------- | :-------------------------------------------------------------- | :------------------------------------ | :--------------------------------------------------------------------------------------- |
| **[[domain\|catalog]] ↔ [[domain\|shopping]]**                             | Upstream (`Catalog`) → Downstream (`Shopping`)                  | Sync (gRPC)                           | Book titles, live prices, and availability for basket enrichment                         |
| **[[domain\|shopping]] ↔ [[domain\|ordering]]**                            | Upstream (`Shopping`) → Downstream (`Ordering`)                 | Sync (gRPC) & Async (Events/Commands) | Basket item quantities at checkout; post-checkout basket cleanup commands and outcomes   |
| **[[domain\|catalog]] ↔ [[domain\|ordering]]**                             | Upstream (`Catalog`) → Downstream (`Ordering`)                  | Sync (gRPC)                           | Authoritative book pricing resolved and locked onto accepted orders                      |
| **[[domain\|reviews]] ↔ [[domain\|catalog]]**                              | Bidirectional (Partnership / Compensation)                      | Async (Events)                        | Feedback created/deleted events for rating aggregation; missing-book compensation events |
| **[[domain\|conversational]] ↔ [[domain\|catalog]] / [[domain\|reviews]]** | Downstream (`Conversational`) ← Upstream (`Catalog`, `Reviews`) | Sync (MCP & A2A gRPC)                 | Read-only book discovery lookups and AI-summarized customer feedback                     |
| **[[domain\|platform]] ↔ [[domain\|catalog]] / [[domain\|ordering]]**      | Supporting (`Platform`) ↔ Core (`Catalog`, `Ordering`)          | Async (Events/Commands)               | Scheduled vector batch triggers and transactional order email commands                   |
| **[[system\|identity-provider]] & [[system\|data-privacy]]**               | Upstream (External Systems) → Downstream (`BookWorm`)           | Sync (OIDC / HTTP)                    | User and agent identity tokens; fail-closed PII detection and anonymization              |

:::note
**Domain Invariants:** A basket cannot proceed to checkout without valid [[domain|catalog]] book identities and current pricing. Every accepted checkout creates one authoritative `Order` in [[domain|ordering]] with status `New`, and only explicit ordering commands transition it to `Completed` or `Cancelled`.
:::

## Ubiquitous Language Highlights

BookWorm's shared domain vocabulary prevents ambiguity across bounded contexts (see [[doc|arc42/12-glossary]] and the BookWorm Ubiquitous Language dictionary):

- **Book:** A canonical title owned by [[domain|catalog]]; other contexts reference it strictly by identifier.
- **Basket:** Mutable pre-purchase shopping intent owned by [[domain|shopping]]—never an order or inventory reservation.
- **Order & Order Item:** Durable purchase records owned by [[domain|ordering]] with locked purchase-time pricing and lifecycle status.
- **Feedback:** An individual customer rating and optional comment owned by [[domain|reviews]], distinct from [[domain|catalog]]'s aggregate rating summary.
- **Checkout:** The cross-context process that transitions a checked-out basket into the ordering workflow.
- **Chat Request:** A customer question routed by [[domain|conversational]] agents without taking ownership of referenced books or orders.

## Architecture Visualizations

<NodeGraph />

### Enterprise Context Overview

<LikeC4View viewId="bookwormContext" project="deployment" />

### Commerce Capabilities Overview

<LikeC4View viewId="bookwormCommerceContainers" project="deployment" />

### Conversational & Platform Capabilities Overview

<LikeC4View viewId="bookwormAIAndPlatformContainers" project="deployment" />

## Related Governance & Documentation

<Tiles columns={2}>
	<Tile
		icon="RectangleGroupIcon"
		href="/visualiser/domains/bookworm/1.0.0"
		title="Explore Domain Graph"
		description="Interactive view of BookWorm subdomains, services, and message flows."
	/>
	<Tile
		icon="DocumentTextIcon"
		href="/docs/custom/arc42/12-glossary"
		title="Domain Glossary"
		description="Canonical vocabulary and ownership rules across all bounded contexts."
	/>
	<Tile
		icon="ClipboardDocumentListIcon"
		href="/docs/custom/arc42/09-architecture-decisions"
		title="Architecture Decisions"
		description="Platform-wide ADRs governing service boundaries, messaging, and state."
	/>
	<Tile
		icon="SparklesIcon"
		href="/diagrams/bookworm-event-storming/1.0.0"
		title="BookWorm Event Storming"
		description="Domain events, commands, and bounded-context handoffs across the platform."
	/>
</Tiles>

- [[adr|adr-bw-001-capability-aligned-boundaries]] — Decompose BookWorm by business capability and bounded context.
- [[adr|adr-bw-005-kafka-integration-backbone]] — Standardize asynchronous cross-context messaging.
- [[adr|adr-bw-006-service-owned-business-state]] — Keep persistence isolated inside each owning bounded context.
- [[diagram|bookworm-event-storming]] — Whole-domain event storming overview.
