Skip to content

Frontend-only Demo

EdgeChat provides a frontend-only demo that is completely isolated from production:

https://edgechat-demo.gdz66601.workers.dev

The demo build uses the same Vue pages, routing, state management, chat composables, and real-time message protocol as the production project. Only the runtime data source is replaced with an in-memory backend in the browser. Visitors can explore the chat UI, personal settings, admin panel, sign-in and invitation registration pages, and can try message sending, group management, user management, invitation links, and simulated Telegram message delivery.

Isolation Boundaries

AreaProductionDemo
Frontend pages and application stateProduction Vue codeThe same code is reused
API and WebSocketCloudflare Worker and Durable ObjectsIn-memory browser simulation
DataD1, KV, and R2Reset when the page reloads
Workercfchatedgechat-demo
Static build directoryfrontend/distfrontend/demo-dist
Wrangler configurationwrangler.tomlwrangler.demo.toml

wrangler.demo.toml declares only Workers Static Assets. It does not bind D1, KV, R2, Durable Objects, or Cron, so deploying the demo never creates, migrates, or reuses production data resources.

Run Locally

bash
npm install
npm run dev:demo

The default URL is http://127.0.0.1:5174. The production frontend continues to use npm run dev:frontend and its original port, so the two do not conflict.

Build and Deploy Manually

bash
npm run build:demo
npm run deploy:demo

Before a non-interactive deployment, set the demo account's Cloudflare environment variables in the current terminal:

powershell
$env:CLOUDFLARE_ACCOUNT_ID = "demo-account-id"
$env:CLOUDFLARE_API_TOKEN = "demo-api-token"
npm run deploy:demo

These credentials are passed only through environment variables and are not written to source code or Wrangler configuration.

GitHub Actions

.github/workflows/deploy-demo.yml is an independent manual workflow triggered only from the GitHub Actions page with workflow_dispatch. Configure these additional Repository Secrets:

  • DEMO_CLOUDFLARE_ACCOUNT_ID
  • DEMO_CLOUDFLARE_API_TOKEN

The workflow runs tests, builds frontend/demo-dist, and deploys edgechat-demo. It does not inspect production resources, migrate D1, initialize an administrator, prepare encryption Secrets, or read the production CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN.