Skip to content

Cloudflare Pages

Two Cloudflare Pages projects serve the platform:

ProjectPurposeDefault branch
convertella-adminCRM + Operator panelspike/cf-runtime
convertella-buyer-platform-testing / convertella-buyer-platform-productionBuyer portal (tenant-facing)preview / production
convertella-platformWorker name for local wrangler / shared build—

Every push to any branch automatically triggers a Cloudflare Pages build and deploy as a preview deployment. This is the primary testing/staging mechanism — no separate staging server needed.

git push origin feature/add-csv-export
→ Pages builds the branch
→ https://convertella-admin-add-csv-export.pages.dev (2-3 min)

Preview deployments:

  • Inherit environment variables from the Pages project (DATABASE_URL, CLOUDFLARE_API_TOKEN, etc.)
  • Connect to the testing Neon database (same as local dev)
  • Are fully functional — OTP emails, R2 uploads, Cloudflare API calls all work
  • Update automatically on each subsequent push to the same branch
  • Deactivate automatically when the branch is deleted
  • Are publicly accessible by default (anyone with the URL can browse)
Terminal window
# Push a branch → get a preview URL
git checkout -b feature/add-csv-export
git push origin feature/add-csv-export
# → https://convertella-admin-feature-add-csv-export.pages.dev
# The URL follows the pattern:
# https://{project-name}-{sanitized-branch-name}.pages.dev

The default branch (spike/cf-runtime for admin, production for buyer portal) deploys as the project’s main Pages deployment. It also has a .pages.dev URL and is the source for production promotion.

Production uses wrangler.toml [env.production] to deploy to the production Cloudflare Pages project:

[env.production]
name = "convertella-admin"
routes = [
{ pattern = "admin.convertella.app" },
]

Production differs from branch previews:

  • Uses a separate Neon database (production branch, not testing)
  • Has its own R2 buckets (production data isolated from testing)
  • Uses separate Cloudflare API tokens with production-scoped permissions
  • Serves on admin.convertella.app via custom domain
  • Buyer portals use Cloudflare for SaaS custom hostnames
Terminal window
npm run deploy:pages:prod

Base configuration in wrangler.toml:

name = "convertella-admin"
pages_build_output_dir = "./dist"
compatibility_date = "2026-05-01"
routes = [
{ pattern = "convertella.app" },
]
[vars]
PRIMARY_LOCALE = "de"
R2_DOCUMENTS_BUCKET = "convertella-documents"
[env.staging]
name = "convertella-admin-staging"
[env.production]
name = "convertella-admin"
routes = [
{ pattern = "admin.convertella.app" },
]

Sensitive values are set via Cloudflare Pages dashboard (wrangler secret):

  • DATABASE_URL — Neon connection string
  • AUTH_SECRET — Lucia session signing key
  • CLOUDFLARE_API_TOKEN — Custom hostnames + API access
  • CLOUDFLARE_ZONE_ID — Cloudflare zone for for-SaaS operations

Non-sensitive defaults are in wrangler.toml [vars].

Buyer Portal Domains (Cloudflare for SaaS)

Section titled “Buyer Portal Domains (Cloudflare for SaaS)”

See Cloudflare for SaaS for fallback origin, testing vs production routing, and reusing demo.convertella.app as a pilot hostname.

CommandPurpose
npm run buildProduction build via Astro
npm run deploy:pages:prodDeploy to production
wrangler pages deploy dist/ --branch=<name>Deploy specific branch as preview