Step 5B
Deploy the dashboard on Cloudflare Pages
Build the dashboard from the Coop release and upload it directly to Cloudflare Pages.
This path uploads the built dashboard from the extracted Coop release folder. It does not require a GitHub repository and it creates a Cloudflare Pages project, not a Worker.
Build with the production values
From the extracted Coop release folder, create apps/dashboard/.env.production.local with:
| Variable | Value |
|---|---|
VITE_CLERK_PUBLISHABLE_KEY | Clerk’s production publishable key |
VITE_API_BASE_URL | The public HTTPS API origin, with no path or trailing slash |
These values are public browser configuration, but they must still be correct. Never add database, encryption, S3, Redis, or Clerk secret values to this file.
Build the dashboard:
cd apps/dashboard
npm ci
npm run build
Create and deploy the Pages project
Authenticate, create the Pages project, and upload dist:
npx wrangler@latest login
npx wrangler@latest pages project create coop-dashboard --production-branch=main
npx wrangler@latest pages deploy dist --project-name=coop-dashboard --branch=main
Cloudflare Pages copies the checked-in public/_redirects rule into dist. That rule returns index.html for dashboard routes such as /settings instead of a host 404 page.
This Pages project receives the built dashboard files directly. Cloudflare does not let a Direct Upload project switch to Git integration later. Create a separate Git-integrated Pages project if your company later places the code in its own Git provider.
Verify routes and origin
Open /settings directly on the pages.dev or custom domain. Then add that exact origin to CLERK_ALLOWED_DASHBOARD_ORIGINS on the API and redeploy the API.

Official references: Cloudflare Pages Direct Upload, Vite build settings, and Pages redirects.