Node.js + TypeScript backend that connects the Win11 notification reader to the Even Realities G2 glasses app.
Win11 app (ws://localhost:8788) ──WebSocket──> [THIS BACKEND] ──SSE──> G2 app on iPhone
│ │
│ │ voice reply
│ ▼
│ POST /reply { pcm, recipient }
│ │
▼ │
speechcoach-backend (Whisper) ◄─────┘
│
▼ transcribed text
Win11 app types reply in WhatsApp
cd whatsapp-bridge-backend
npm install
cp .env.example .env
npm run devThe server listens on http://localhost:8787 by default.
PORT=8787
WIN11_URL=ws://localhost:8788/
STT_BACKEND_URL=http://localhost:8787
STT_ENABLED=true
PORT: HTTP port this backend listens onWIN11_URL: WebSocket URL of the Win11 app (usually localhost)STT_BACKEND_URL: URL of the speechcoach-backend (can be the same process if colocated)
Returns backend status and Win11 connection state:
{
"status": "ok",
"time": 1712876400000,
"win11Connected": true,
"messagesBuffered": 12
}Live stream of WhatsApp messages for the G2 app.
- On connection: fires
snapshotevent with the 20 most recent messages - On new message: fires
messageevent - Heartbeat every 30s to keep proxies alive (important for Cloudflare Tunnel)
Returns the last 20 messages as JSON (fallback for clients without SSE).
Body:
{ "recipient": "João", "pcm": [/* Int16 samples */] }or:
{ "recipient": "João", "text": "Direct text reply" }- If
pcmis provided, it's transcribed via the STT backend and the resulting text is used - The reply is forwarded to the Win11 app via the WebSocket connection
- Returns:
{ "ok": true, "transcribed": "...", "queued": false }
For accessing the backend from anywhere (not just local Wi-Fi), use Cloudflare Tunnel. See the main WhatsApp G2 Bridge README for setup.
npm run dev # tsx watch mode
npm run typecheck # tsc --noEmitMIT