Skip to content

Deployment

  1. Cloudflare account with Workers plan
  2. D1 database created: wrangler d1 create dotcollective-tools-db
  3. Update database_id in wrangler.toml with the ID from step 2
Terminal window
# Build frontend + deploy Worker
pnpm deploy

This runs vite build then wrangler deploy, which:

  • Builds the React SPA to dist/
  • Deploys the Worker with the built assets
  • The [assets] config serves the SPA and routes /api/* to the Worker

The docs site deploys separately to Cloudflare Pages:

Terminal window
cd docs
pnpm build
# Deploy via Cloudflare Pages dashboard or wrangler pages
Terminal window
wrangler d1 execute dotcollective-tools-db --remote --file=db/schema.sql
wrangler d1 execute dotcollective-tools-db --remote --file=db/seed.sql
  1. Go to Cloudflare Zero Trust dashboard
  2. Add Google Workspace as identity provider
  3. Create Access Application for app.dotcollective.com.au
  4. Set policy: Allow emails ending in @dotcollective.com.au

Set via wrangler.toml [vars] or Cloudflare dashboard:

VariablePurpose
CF_ACCESS_TEAM_DOMAINCloudflare Access team domain (e.g., dotcollective)