mystack

A starting point. With a point of view.

View on GitHub

Deployment

Move from local development to your own production resources.

Prepare production

Set real app/auth origins, a fresh Better Auth secret, a verified email sender and the credentials for the services you selected. Configure payment webhook endpoints and signature secrets. Replace local database credentials with production credentials. Mystack does not provision cloud resources.

Cloudflare Workers

Provision the selected Hyperdrive or D1 resource and replace placeholder identifiers in wrangler.jsonc. Configure the Cloudflare email binding if selected. Create the production environment file and authenticate Wrangler. Follow the generated README for the exact binding and secret configuration.

Cloudflare Workers
bunx wrangler login
bun run deploy

Apply migrations separately

Deployment does not apply database migrations. D1 applies hosted migrations with db:migrate:remote. Turso Cloud’s db:migrate:remote reads .env.prod and rejects local URLs. PostgreSQL migration tooling uses DATABASE_MIGRATION_URL from its documented environment loading; configure the production target deliberately before running it.

Apply migrations separately
# D1 / Turso Cloud: hosted migration command
bun run db:migrate:remote

# PostgreSQL: with production migration credentials
bun run db:migrate

Nitro and Bun

Inject the production environment on your host, apply migrations against the production database, then use the generated deployment and start scripts. Nitro uses a Node server preset. Bun uses its native server entry.

Nitro and Bun
bun run deploy
bun run start

Local database files

Turso Local and Bun SQLite need persistent storage for the database and its sidecar files in production. An ephemeral application filesystem is not durable storage. Back up and operate the database according to your hosting environment.