Step 5B

Deploy the dashboard on Cloudflare Pages

Build the dashboard from the Coop release and upload it directly to Cloudflare Pages.

Set up 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:

VariableValue
VITE_CLERK_PUBLISHABLE_KEYClerk’s production publishable key
VITE_API_BASE_URLThe 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.

Direct Upload is deliberate

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.

Coop dashboard inbox showing a conversation and team messages
A working Pages deployment loads the full inbox after sign-in. The workspace, conversations, and message panel should appear without a Pages error.

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