Core Domain
Technical architecture and data models for Danvas domains
Overview
The Core Domain documentation provides deep technical insights into the architecture, data models, and automated workflows that power Danvas. This section is intended for engineers and contributors.
Domain Models
Database & Schema
Global schema overview, tables, and multi-tenant isolation.
Locations
Location hierarchy, active location scoping, and isolation.
Scheduling
Technical design of shifts, 7shifts sync, and row locking.
Reports & Obligations
Staff/manager reports, report_obligations, and filing semantics.
Auth & RBAC
Clerk integration, local authorization boundary, and roles.
Incidents
Incident state machine, escalation, triage, and audit trail.
Operations Inbox v2
Unified feed, message lifecycles, and triage state machine.
Live Freshness
Data freshness engine, SLA calculations, and circuit breakers.
Toast POS Pipeline
Dagster active-writer runtime, sync_state, and ingestion.
Notifications
Slack dispatch, Web Push, queue draining, and PII redaction.
Guest Experience
Coupon lifecycle and evidence, anonymous NPS, Contact identity, and QR security.
Analytics & Tips
Tip marts, performance facts, Dagster partitions, and MCP access.
Audit & Compliance
Transactional audit logging and compliance ledger projection.
AI Integration
Conversational assistant, Vercel AI SDK, and prompt architecture.
Data Flow Architecture
End-to-end request lifecycle and background pipeline topology.
Architecture Decisions
Index of active Architecture Decision Records (ADRs).
Technical Patterns
- Multi-tenancy: All data is scoped to a
teamId, a local tenant identifier. Clerk Organizations are not used. - Server Actions: Primary pattern for data mutation in the App Router.
- Drizzle ORM: Used for all database interactions with strict typing.
- Zod Validation: Validates all incoming data at the boundary.