TorbatYar/docs/architecture/adr/ADR-016.md
2026-07-28 20:39:10 +03:30

67 lines
3.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ADR-016: Independent Experience Platform Service
| Field | Value |
| --- | --- |
| Status | Accepted |
| Date | 2026-07-25 |
| Deciders | Platform Architecture |
| Supersedes | — |
| Superseded by | — |
## Context
Hospitality, Marketplace, Sports Center, CRM, and future verticals all need websites, landings, mini sites, menus-as-pages, catalogs, forms, and campaign surfaces. Embedding page/theme/template engines inside each vertical would duplicate logic and couple unrelated domains.
TorbatYar already isolates shared platforms as independent services (Loyalty [ADR-011](ADR-011.md), Communication [ADR-012](ADR-012.md), Sports Center [ADR-014](ADR-014.md), Delivery [ADR-015](ADR-015.md)). Digital experience / page publishing needs the same independence.
Commercial product name: **Torbat Pages**. Prefer `experience` over the historical `website_builder` scaffold for new page/site work.
## Decision
1. Introduce `experience` as an **independent Experience Platform service** with sole ownership of `experience_db` ([ADR-001](ADR-001.md)).
2. Permission prefix: `experience.*`. Publish-only domain events: `experience.*`.
3. Row-level multi-tenancy via `tenant_id` ([ADR-003](ADR-003.md)).
4. Consume Accounting, CRM, Loyalty, Communication, Storage, and vertical services **only** via REST API and Events — never shared tables or foreign model imports.
5. Messaging only through Communication ([ADR-012](ADR-012.md)).
6. Media binaries only via File Storage refs — no blobs in `experience_db`.
7. Implementation phases are registered as **Phase 11.011.10** in [phase-manifest.yaml](../../ai-framework/phase-manifest.yaml); roadmap in [experience-roadmap.md](../../experience-roadmap.md).
8. Product AI remains optional and external ([ai-architecture.md](../ai-architecture.md)). Core authoring/publish works when AI is off.
9. UI builders and public shells live in `frontend/` only ([ADR-002](ADR-002.md)); this service exposes APIs and events.
10. Public-surface cross-service attachments use **Published Resource** `publish_id` ([ADR-022](ADR-022.md)) — Forms/Surveys/Appointments support standalone publish.
## Consequences
### Positive
- One reusable experience platform for all verticals
- No duplicated page/theme engines across Hospitality/Marketplace/etc.
- Enforceable tenancy, audit, and boundary tests
### Negative
- Additional deployable service and database
- Eventual consistency for cross-service published surfaces
### Neutral
- Registration (this ADR + manifests) precedes business code; Phase 11.0 implements the scaffold
- Historical `website_builder` scaffold remains a pointer
## Alternatives Considered
1. Website builder inside Hospitality — rejected (blocks Marketplace/Sports reuse).
2. Experience tables inside Core — rejected (violates ADR-001 and module boundaries).
3. Per-vertical bespoke page stacks — rejected (duplicates logic).
## Related Documents
- [Experience Roadmap](../../experience-roadmap.md)
- [Experience Phase XP-Reg](../../experience-phase-xp-reg.md)
- [Phase Handover XP-Reg](../../phase-handover/phase-xp-reg.md)
- [Module Registry — experience](../../module-registry.md#experience)
- [Module Boundaries](../module-boundaries.md)
- [Phase Manifest](../../ai-framework/phase-manifest.yaml)
- [Service Manifest](../../ai-framework/service-manifest.yaml)
- [ADR-001](ADR-001.md) · [ADR-002](ADR-002.md) · [ADR-003](ADR-003.md) · [ADR-008](ADR-008.md) · [ADR-012](ADR-012.md) · [ADR-022](ADR-022.md)
- [Published Resource Architecture](../published-resource-architecture.md)