DashboardSupportWelcome

👤 USER DOCS

Getting Started

Daily Operations

Shift Workspace & TasksPre-Shift SetupLine-Up CardsShift ReportsForms

Staff & Locations

Staff SchedulingManaging Locations

Oversight

Manager ReportsAnalyticsPre-Shift & Compliance

Incidents & Feedback

Incident ReportingAnonymous FeedbackMessages & Announcements

AI & Settings

AI ChatgearApp Settings

Administration

Dashboard & OnboardingAdmin

⚙️ DEVELOPER DOCS

Getting Started

Getting StartedDevelopmentDeployment Guide

Architecture

Architecture OverviewData FlowArchitecture Decision Records

Core Domain

Core DomainDatabase ReferenceLocations DomainAuth & RBACScheduling DomainReports DomainIncidents DomainNotifications DomainAudit Log & OptimizationDesign Audit Findings

Frontend

Frontend ArchitectureFormsLoading SkeletonsComponentsPWA & NotificationsimageScreenshots

API Reference

API Reference

Endpoints

POS Sales APIOptimization Data APISchedule Shifts APIEmployee Export APIReports APIIncidents APIAI Chat APIPush Notifications APIWebhooks APICron API

Contributing

ContributingcodeCode Examples

Security

Security & Compliance
Danvas IconDanvas
Danvas IconDanvas

Architecture Decision Records

Significant architectural decisions made during development

Danvas maintains Architecture Decision Records (ADRs) to document significant technical decisions. Each ADR includes the context, the decision, and its consequences.

Active Decisions

ADRTitleSummary
ADR-0001Drizzle ORM over PrismaChose Drizzle ORM for lighter bundles, single-file schema, and better Neon serverless compatibility
ADR-0002OpenRouter over Direct Provider APIsRoutes AI requests through OpenRouter for provider flexibility, cost management, and fallback options
ADR-0003Location-Scoped RolesExtends Clerk org roles with location-level permissions for multi-location management
ADR-0004Clerk AuthenticationSelected Clerk for auth — multi-tenant orgs, webhook provisioning, and low maintenance overhead
ADR-0005TanStack Query for Data FetchingUses TanStack Query for client-side data fetching — caching, deduplication, and optimistic updates
ADR-0006Message Follow-Up WorkflowImplements structured follow-up states and incident linking for phone messages
ADR-00077shifts Schedule SyncSyncs scheduling data from 7shifts into local management tables
ADR-0008Incident Resolution WorkflowStandardizes state transitions (Pending → In Progress → Resolved) for incidents
ADR-0009Message Dual-State ModelSeparates message status from follow-up workflow status for better tracking

Data Flow

How data moves through Danvas

Core Domain

Technical architecture and data models for Danvas domains

On this page

Active DecisionsADR Format
ADR-0010Incident-Message LinkingAllows linking incidents to the messages that triggered them
ADR-0011Keyset PaginationMigrated from offset-based to keyset-based pagination for performance and stability
ADR-0012Rate-Limit MiddlewareUses Upstash Redis for global rate limiting in Next.js edge functions
ADR-0013Security Headers (Nosecone)Standardizes CSP and HSTS headers using Vercel's Nosecone library
ADR-0014Env Validation (t3-env)Enforces type-safe environment variables across all apps and packages
ADR-0015Proxy File PatternAdopted proxy.ts pattern for Next.js 16 middleware
ADR-0016Design System FirstCentralizes UI components in the shared design-system package
ADR-0017Canonical EmployeesDefines the source of truth for employee data across multiple systems
ADR-0018Local Auth BoundaryEnforces role-based checks inside the local database layer, not just at the edge
ADR-0019Server Action ResultsStandardizes the response format for Server Actions (ok/fail pattern)
ADR-0020EmployeeKey IdentifierUses unique employeeKey for syncing data without relying on internal IDs
ADR-0021Accepted ExceptionsDocuments intentional deviations from standard engineering rules
ADR-0022Test OrganizationDefines a stable organization and team for end-to-end testing
ADR-0023Pagination HelpersProvides generic TypeScript helpers for implementing keyset pagination
ADR-0024Permission PrimitivesCentralizes RBAC logic into a single set of composable primitives
ADR-0025Typed API RoutesEnforces validation and type safety for standard API route handlers
ADR-0026Features-Layer ImportsDefines strict import rules for the features/ directory
ADR-0027Admin Trust BoundaryRestricts write operations to verified administrative contexts
ADR-0028drizzle-zod GenerationAutomatically generates Zod schemas from Drizzle table definitions
ADR-0029Coupon WizardImplements a single-page wizard for customer coupon selection
ADR-0030Guest App Minimal ChromeDefines the minimal UI shell for the customer-facing guest application
ADR-0031Form Submission UXStandardizes loading states and success feedback for form submissions
ADR-0032getActionContext PatternTransitioned from requireUserAuth to getActionContext for better DX
ADR-0033Schema StrategyOutlines the strategy for unified database schema definitions

ADR Format

Each ADR follows this template:

# ADR-NNNN: Title

- **Status:** Accepted \| Proposed \| Deprecated \| Superseded
- **Date:** YYYY-MM-DD

## Context

[What is the issue that we're seeing and why was this decision made?]

## Decision

[What is the change that we're proposing?]

## Consequences

[What becomes easier or more difficult to do?]

All records live in the docs/adr/ directory at the repository root alongside this documentation site.