Deploy
Cloudflare Workers — One Command
ShipAny TanStack is built to ship to Cloudflare Workers. In Claude Code, run:
/deploy-cloudflareThat single skill drives the entire production deployment:
Verifies wrangler whoami; only triggers a browser login if you're not authenticated yet.
Creates a D1 database (default, zero external infra) and writes the binding into wrangler.jsonc — or, if you mention Postgres/Neon/Supabase, sets up Hyperdrive against your existing PostgreSQL instead.
Applies drizzle migrations to the remote database (wrangler d1 migrations apply --remote, or pnpm db:migrate directly against Postgres).
Seeds default roles/permissions on the remote DB and uploads secrets (AUTH_SECRET etc.) via wrangler secret put — secret values are never echoed to the screen.
NITRO_PRESET=cloudflare_module vite build then wrangler deploy (wrapped in pnpm cf:deploy). The final deploy always asks for confirmation — it's the only irreversible step.
Bakes the real *.workers.dev (or custom domain) URL into the bundle, and on first deploy offers to create / promote a super_admin account so you can log into /admin immediately.
Idempotent by design — "ship again" simply means running /deploy-cloudflare again: every phase detects existing state (D1 exists, migrations applied, secrets uploaded, admin exists) and skips itself; only the fresh build + deploy runs.
Useful flags:
/deploy-cloudflare --domain=app.example.com # bind a custom domain
/deploy-cloudflare --admin-email=X --admin-password=Y # set up the admin account
/deploy-cloudflare --rotate-secrets # force re-upload all secretsD1 vs Postgres (Hyperdrive)
| D1 (default) | Postgres + Hyperdrive | |
|---|---|---|
| When | Zero external infra | You already have Postgres (Neon/Supabase/RDS) or need PG features |
| Binding | d1_databases → DB | hyperdrive → HYPERDRIVE |
| Schema push | wrangler d1 migrations apply --remote | pnpm db:migrate directly against PG |
Manual deploy
If you prefer the raw commands:
pnpm cf:build # NITRO_PRESET=cloudflare_module vite build
pnpm cf:deploy # build + wrangler deployNode Server
pnpm build produces a self-contained nitro output:
pnpm build
node .output/server/index.mjs # serves on port 3000Docker
Multi-stage Dockerfile (node:22-alpine, non-root user, port 3000):
docker build -t my-app .
docker run -p 3000:3000 --env-file .env.production my-app
DATABASE_PROVIDERis baked in at build time. To target PostgreSQL:docker build --build-arg DATABASE_PROVIDER=postgres -t my-app .