Duck Chat is a lightweight anonymous chat experience that pairs two visitors via a WebRTC data channel, with a WebSocket signaling server for matchmaking and signaling.
- Frontend: React + Vite + Tailwind
- Backend: Express +
wsWebSocket server - Realtime: WebRTC data channel for peer-to-peer messages
backend/ Express + WebSocket signaling server
frontend/duck-chat/ Vite React application
- Node.js 18+ (recommended)
- npm
Install dependencies in each app folder:
cd backend
npm install
cd ../frontend/duck-chat
npm installThe frontend reads the signaling server base URL from Vite env variables.
- Copy or edit the dev env file:
frontend/duck-chat/.env.development
- Set the backend URL (HTTP/HTTPS; the app upgrades it to
wss://):
VITE_BACKEND_URL=http://localhost:8080
For local development without SSL, you may need to run a local reverse proxy or adjust the signaling URL logic to use
ws://. If you change the backend port, update this value to match.
cd backend
node index.jsThe server listens on port 8080 by default and exposes the WebSocket signaling server on the same port.
cd frontend/duck-chat
npm run devOpen the printed local URL in two browser tabs to see two clients match and chat.
cd frontend/duck-chat
npm run lint
npm run build- The backend limits messages per client to reduce spam.
- WebRTC requires two clients to be paired; open two tabs or two devices to test.