Search

Search Kavel...

Documentation menu

Deployment

Both apps deploy to Cloudflare Workers with Wrangler. Here's the path from local to live.

1. Authenticate Wrangler

bash
bunx wrangler login

2. Create the D1 database

If you use a database-backed module, create a D1 database and copy its id:

bash
bunx wrangler d1 create my-app

Paste the returned database_id into apps/api/wrangler.jsonc, then apply migrations to the remote database:

bash
cd apps/api
bunx wrangler d1 migrations apply my-app --remote

3. Set production secrets

Push each secret to the deployed Worker. These are separate from your local .dev.vars:

bash
cd apps/api
bunx wrangler secret put BETTER_AUTH_SECRET
bunx wrangler secret put RESEND_API_KEY
bunx wrangler secret put STRIPE_SECRET_KEY
bunx wrangler secret put STRIPE_WEBHOOK_SECRET

Tip

Only set the secrets for the modules you selected. Also set ENVIRONMENT=production as a plain var so the API reference and dev-only tooling switch off.

4. Deploy

Deploy both apps from the repo root:

bash
bun run deploy

Turbo runs each app's deploy script, which minifies and publishes the Worker. Point your custom domains at the two Workers from the Cloudflare dashboard.

5. Stripe webhook

If you use payments, add a webhook endpoint in the Stripe dashboard pointing at https://your-api-domain/api/stripe/webhook, then copy its signing secret into STRIPE_WEBHOOK_SECRET (step 3).

Note

Continuous deployment: every scaffold ships with a GitHub Actions workflow that installs, builds, typechecks, and lints on each push. Add a deploy step once your Cloudflare API token is stored as a repository secret.