Skip to main content
A complete coding convention template for production Next.js applications with oRPC API layer, Drizzle ORM, and PostgreSQL.

Download Template

Download as ZIP and extract to .trellis/spec/

What’s Included

Template Structure

Key Topics

Frontend

  • Next.js 15 App Router with React 19
  • oRPC client + React Query integration
  • Server Components vs Client Components
  • Authentication with better-auth
  • Vercel AI SDK (useChat, tool calls, streaming)
  • TailwindCSS 4 + Radix UI patterns

Backend

  • oRPC router, procedures, and middleware
  • Drizzle ORM + PostgreSQL (N+1 prevention, transactions, JSON/JSONB)
  • better-auth server configuration
  • Performance patterns (concurrency, caching, rate limiting)
  • Structured logging with Sentry

Guides

  • Pre-implementation checklist (search before write)
  • Cross-layer thinking for Next.js full-stack changes

Common Pitfalls

  • PostgreSQL json vs jsonb with Drizzle ORM
  • Sentry + next-intl plugin conflict
  • Turbopack vs Webpack flexbox differences
  • WebKit tap highlight on mobile

Usage

  1. Download the ZIP file
  2. Extract to your project’s .trellis/spec/ directory
  3. Replace @your-app/* placeholders with your monorepo package paths
  4. Customize for your specific conventions
  5. Remove sections that don’t apply

View on GitHub

Browse the template source code