Valcraven Documentation
Everything you need to understand, run, extend, and ship an app built on the Valcraven template.
Valcraven is a production-ready Next.js SaaS template that runs on Cloudflare's developer platform. It exists to eliminate the infrastructure boilerplate every web app needs — auth, billing, email, admin, an AI assistant, storage, realtime — so you start at feature work, not plumbing.
This documentation is the complete reference for building on Valcraven: what's already included, how each piece works, how to extend it, and everything the team learned shipping it over many months.
What's included
- Authentication — Better Auth with email/password, OAuth (Google, GitHub, Apple), two-factor, and admin/impersonation.
- AI chat — a Claude-powered assistant hosted on a realtime Worker, with tools, voice I/O, rich blocks, and model switching.
- Email & campaigns — transactional email via Cloudflare Email Service, plus audiences, scheduled/queued campaigns, and open/click tracking.
- Billing — Stripe subscriptions, plans, customer portal, and webhook sync.
- Admin — users, roles/RBAC, a database browser, analytics, CRM, audit log, waitlist, and health.
- Developer API keys — per-user keys to authenticate programmatic access to your routes.
- Response caching — Cloudflare Workers Cache (cookie-safe) plus OpenNext's R2/D1 incremental cache.
- Realtime, storage, notifications, webhooks, feature flags, theming — and a companion Expo mobile app.
The stack
Valcraven runs on Next.js 16 deployed to Cloudflare Workers via OpenNext, with D1 (SQLite) through Drizzle ORM, R2 for object storage, Cloudflare Queues for background work, and a separate realtime Worker hosting the AI agent. It's a monorepo: apps/web (the Next.js app), apps/realtime (the agent Worker), apps/mobile (Expo), and packages/core (shared types and the typed API client).
Where to start
- New here? → Getting Started — clone, run locally, and scaffold your own project.
- Want the mental model? → Architecture — the monorepo, the request lifecycle, and how Workers/D1/R2 fit together.
- Looking for a specific capability? → Features — one page per built-in feature.
- Extending the template? → Building with Valcraven — recipes for adding routes, pages, migrations, channels, and AI tools.
- Avoiding the sharp edges? → Conventions & Gotchas — the hard-won rules that keep dev and prod in sync.
- Going live? → Deployment & Operations.
Building Valcraven itself? The internal dev wiki (admin-only) carries deeper implementation notes. This public documentation is the canonical, user-facing corpus.