Deploying
API
bash
# Set secrets (one-time)
wrangler secret put DATABASE_URL --cwd apps/api
wrangler secret put BETTER_AUTH_SECRET --cwd apps/api
# Update BETTER_AUTH_URL in apps/api/wrangler.toml to your Workers subdomain
bun build:api
# or directly:
bun run --cwd apps/api deployWeb
bash
# Update API_URL in apps/web/wrangler.jsonc to your deployed API URL
bun build:web
# or directly:
bun run --cwd apps/web deployMobile
bash
bun add -g eas-cli
cd apps/mobile
eas build --platform ios # or android, or all
eas submit # submit to App Store / Play StoreBefore building, update the API URLs in:
apps/mobile/lib/trpc.tsxapps/mobile/lib/auth-client.ts
Cloudflare Hyperdrive (recommended for production)
For PostgreSQL connection pooling on Cloudflare Workers:
- Create a Hyperdrive config in the Cloudflare dashboard
- Uncomment the
[[hyperdrive]]block inapps/api/wrangler.toml - Pass
c.env.HYPERDRIVE.connectionStringtocreateDb()instead ofc.env.DATABASE_URL
CI/CD
No CI/CD workflow is included. To add GitHub Actions, create .github/workflows/ci.yml:
- Run
bun install - Run
bun lint - Run
tsc --noEmit - Deploy via
wrangler deployusing aCLOUDFLARE_API_TOKENsecret
