Skip to main content

Davies CXsmart — Developer Guide

Davies CXsmart is a greenfield rebuild of the Davies/ServiceTick "Voice of the Customer" platform on a modern Cloudflare + Postgres stack. This guide is for engineers building, extending or operating the platform. If you're a day-to-day user of the app, see the User Guide instead.

The stack at a glance

LayerTechnology
Front endVite + React + TypeScript + Tailwind CSS v4 (SPA) on Cloudflare Workers (Static Assets)
Public survey runtimeRespondent survey completion — a client-rendered route in the same SPA
API / back endCloudflare Workers (Hono), ports/adapters (hexagonal)
DatabaseNeon Postgres via Hyperdrive — one connection per request; RLS default-deny + FORCE
AuthClerk (sole identity provider) behind an Identity port
Email / SMS / IVRResend + Twilio, behind channel ports
AI / STTGemini, behind an AI port
Async / scheduledCloudflare Queues + Cron Triggers

Where to start

Map of the guide

AreaWhat it covers
ArchitectureRequest lifecycle, hexagonal seams, monorepo packages
Data modelPostgres schemas, RLS multi-tenancy, migrations
APIHono routes, auth, error envelope, rate limiting
Public APIAPI keys & scopes, inbound/outbound webhooks
ChannelsEmail, SMS/IVR, short URLs, tracking
Survey runtimeCapture pipeline, completion runtime
AI & verbatimGemini adapter, sentiment, topic coding, prompts
JobsQueues + scheduled cron
FrontendSPA architecture, filters, dashboard widgets
TestingVitest + the in-memory database fake, the green gate
DeploymentCloudflare topology, configuration, observability
ContributingConventions, the gate, branch model

:::info Auth is Clerk The platform authenticates via Clerk as its sole identity provider — identity lives in Clerk, not the database, which keeps the application's Postgres portable across providers. A Clerk Organization is a VoC tenant / client account. The API only ever verifies the Clerk session JWT (via @clerk/backend) behind the same IdentityProvider port. See Authentication & authorization and CLERK_MIGRATION.md at the repo root. :::