Skip to content

Deploying Workers ​

All three Workers deploy independently via Wrangler.

Deploy Commands ​

bash
cd g2-elite-backend

# Deploy gateway
npx wrangler deploy --config wrangler.gateway.toml

# Deploy mobile BFF
npx wrangler deploy --config wrangler.mobile-bff.toml

# Deploy webhook
npx wrangler deploy --config wrangler.webhook.toml

Setting Secrets ​

Secrets are set per-worker and stored encrypted in Cloudflare:

bash
# Set a secret
echo "value" | npx wrangler secret put SECRET_NAME --config wrangler.gateway.toml

# Delete a secret
npx wrangler secret delete SECRET_NAME --config wrangler.gateway.toml

Current Secrets ​

Gateway ​

  • CLERK_SECRET_KEY — Clerk API secret
  • CLERK_PUBLISHABLE_KEY — Clerk publishable key
  • ORG_DB_FARM — The Farm League database connection string

Webhook ​

  • CLERK_WEBHOOK_SECRET — Svix signing secret

Mobile BFF ​

  • ORG_DB_FARM — The Farm League database connection string

D1 Migrations ​

bash
# Generate a migration from schema changes
npx drizzle-kit generate

# Apply to remote D1
npx wrangler d1 migrations apply g2-elite-core --remote --config wrangler.gateway.toml

Deployed URLs ​

WorkerURL
Gatewayhttps://g2-elite-gateway.2pw.workers.dev
Mobile BFFhttps://g2-elite-mobile-bff.2pw.workers.dev
Webhookhttps://g2-elite-webhook.2pw.workers.dev

Internal Documentation — Do Not Share