Cloudflare Deployment
pnpm run setup provisions and deploys everything. See Set up and deploy.
What a deployment contains
Section titled “What a deployment contains”| Resource | Purpose |
|---|---|
API Worker (kenresoft-cms-api by default) |
REST API, Better Auth, forms, cache, cron |
Admin Worker (kenresoft-cms-admin by default) |
Dashboard, static assets only |
D1 database (binding DB) |
All structured data |
R2 bucket (binding MEDIA_BUCKET) |
Media and form attachments |
| Rate Limiting bindings | Auth, recovery, forms, public reads, admin email |
Cron Trigger (*/5 * * * *) |
Scheduled publishing, webhook retries, cache-purge work |
Optional: Cloudflare Email Sending (a [[send_email]] binding) or Resend for email, and a Paystack secret for Commerce payments. There is no KV namespace. Names for the Workers, D1 and R2 are unique per Cloudflare account; setup asks for a different name if one is taken.
The API Worker’s configuration is the wrangler.toml at the repository root. The Admin Worker’s is apps/admin/wrangler.toml.
Ways to deploy
Section titled “Ways to deploy”pnpm run setup(recommended): guided, idempotent, deploys both Workers.- Manual
wrangler deploy: deploy the API, run migrations, build and deploy the admin, then add the admin origin toCORS_ORIGINS. The repository’sdocs/DEPLOYMENT.mdhas the full sequence. - GitHub Actions:
.github/workflows/deploy.ymldeploys on push tomain, but is inert until you set the repository variableDEPLOY_ENABLEDtotrue, plusCLOUDFLARE_API_TOKEN,CLOUDFLARE_ACCOUNT_IDandVITE_API_URL. It never targets Kenresoft’s own account. - Deploy to Cloudflare button: covers the API Worker only. The Admin Worker has no equivalent button, so you still deploy it separately. Prefer
setup.
Configure it
Section titled “Configure it”- Environment variables and secrets
- Custom domains
- Rate limiting
- Account and owner recovery
- Backups
- Update the CMS
API documentation endpoints
Section titled “API documentation endpoints”GET /api/v1/openapi.json and GET /api/v1/docs (a Scalar reference) are enabled by default. Set API_DOCS_ENABLED = "false" in [vars] to make both return 404.