Skip to main content
A complete coding convention template for production Cloudflare Workers applications with Hono framework, Drizzle ORM, and Turso edge database.

Download Template

Download as ZIP and extract to .trellis/spec/

Whatโ€™s Included

Template Structure

Key Topics

Backend

  • Hono framework patterns (type-safe bindings, middleware, WebSocket)
  • Drizzle ORM + Turso/libSQL (batch ops, N+1 prevention, Workers pitfalls)
  • Cloudflare storage (R2, KV, Cache API for session caching)
  • Security (token generation, timing-safe comparison, OAuth redirect validation)
  • Structured JSON logging with request context

Frontend

  • React 19 + React Router v7 with Vite
  • Better Auth UI v3.x integration (SSR-safe, Cloudflare Workers considerations)
  • shadcn/ui components + Tailwind CSS v4
  • Design example templates (minimalist hero, maximalist dashboard, animations)

Guides

  • OAuth 2.1 consent flow with resource selection
  • Serverless connection debugging (stale connections, subrequest limits)

Common Pitfalls

  • Workers Node.js compatibility (nodejs_compat flag)
  • Cross-layer contract violations (data flows but never reaches client)
  • Build-time vs runtime environment variables
  • CSS debugging in Tailwind v4

Usage

  1. Download the ZIP file
  2. Extract to your projectโ€™s .trellis/spec/ directory
  3. Replace generic env var names with your actual bindings
  4. Customize for your specific conventions
  5. Remove sections that donโ€™t apply

View on GitHub

Browse the template source code