Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
T3 App Template for Cloudflare Workers using OpenNext, tRPC, Drizzle, and D1.

A full-stack Next.js TypeScript template focused on functionality over UI, featuring Zustand, TanStack Query, and ESLint 9 support.
T3 Cloudflare is a starter template for building a T3 Stack app (tRPC + Drizzle + Tailwind) that runs on Cloudflare Workers through OpenNext and uses Cloudflare D1 as its serverless SQLite database.
T3 Cloudflare is a GitHub repository template that configures a T3 Stack app for deployment on Cloudflare's edge network. It takes a standard Next.js T3 app and adapts it to run on Cloudflare Workers using OpenNext, with D1 as the SQLite database. The template includes configuration files, scripts, and commands to create, migrate, and deploy both the database and the Worker. It is published by user exectx and is installable via the Cloudflare C3 CLI with the command pnpm create cloudflare@latest --template=exectx/t3-cloudflare.
pnpm db:generate and pnpm db:migrate handle local D1 migrations; pnpm db:migrate:prod targets remote D1 configured via .dev.vars.DB, which you create and configure in wrangler.jsonc.pnpm dev runs the full stack locally; pnpm build, pnpm preview, and pnpm deploy handle staging and production.pnpm dev plus local D1 migrations to iterate on schema changes before deploying.pnpm deploy to push the Worker and D1 database to Cloudflare, with static assets served from the Workers runtime.pnpm install and create a D1 database with pnpm wrangler d1 create DATABASE_NAME, then copy the returned database_id into wrangler.jsonc..dev.vars.example to .dev.vars to configure remote Drizzle commands.pnpm db:generate and pnpm db:migrate to create and apply local migrations, or pnpm db:migrate:prod for remote D1.pnpm build, pnpm preview, and pnpm deploy.Yes, the template itself is open source and free to use. Deploying to Cloudflare Workers and D1 has a free tier, but production usage may incur costs depending on Cloudflare's pricing for Workers requests and D1 storage.
The template uses Cloudflare D1, a serverless SQLite database built into Cloudflare's network. Drizzle ORM is used to define schemas and generate migrations.
No, the template does not include authentication. It focuses on the core T3 Stack combination of tRPC, Drizzle, and Tailwind, so you would add your own auth provider like NextAuth or Lucia.
OpenNext is an adapter that lets Next.js apps run on Cloudflare Workers. This template uses OpenNext to bundle the T3 app for the Workers runtime, enabling serverless deployment at the edge.
The template expects a binding named DB. To change it, update the binding name in wrangler.jsonc and adjust the Worker code that references the D1 binding.
