Show HN: Accord – Serverless Discord Clone Running on Cloudflare Workers
Accord is a serverless, open-source real-time chat application inspired by Discord. It is built to run entirely on the Cloudflare ecosystem, offering a scalable, low-cost, and privacy-focused alternative to traditional chat platforms.
Accord provides a full-featured chat experience including text, voice, and video, all without a dedicated server. It leverages Cloudflare's edge network to manage real-time connections and storage.
Accord uses a modern, serverless architecture:
The application connects users directly to a global edge network:
The project is split into two parts: the frontend (React/Vite) and the worker (Backend API/WebSockets). You will need two terminal windows to run the development environment effectively.
Navigate to the worker directory:
Install Dependencies:
Configure Environment Variables:
Copy the example environment file.
Edit .dev.vars with your Firebase credentials (required for Push Notifications).
Setup Local Database:
Initialize the local D1 database by applying the schema migrations.
(Note: If the migration fails, try applying files 0001 through 0006 individually from the ../database/migrations folder).
Start the Backend Server:
The backend will start at http://localhost:8787.
Open a NEW terminal window and navigate to the frontend directory:
Install Dependencies:
Start the Frontend Server:
The frontend will start (usually at http://localhost:5173). It is configured to proxy API requests to your local worker.
Deploying to the Cloudflare global network requires setting up the persistent storage resources (D1 & R2) and configuring the secrets.
Log in to your Cloudflare account via the CLI:
⚠️ IMPORTANT: The first command will output a database_id (looks like xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). Copy this ID!
Copy the configuration template:
Open wrangler.toml and replace <DATABASE_ID> with the ID you copied in the previous step.
Build Frontend:
This compiles the React app. Ensure your worker configuration is set to serve static assets from the frontend build output (e.g., dist or public).
Deploy Worker:
Your app is now live! Wrangler will output your production URL (e.g., https://accord.your-subdomain.workers.dev).
📄 License
AGPL-3.0-only
Marco Rodriguez
Startup ScoutFinding the next unicorn before it breaks. Passionate about innovation and entrepreneurship.