DocHub
v2 replaced Chrome/whatsapp-web.js with Baileys (direct WebSocket). No browser, no DOM, no Puppeteer.

v2 Architecture — Baileys (NOT Chrome)

Overview

Queunir v2 replaced the Chrome/whatsapp-web.js stack with Baileys (`@whiskeysockets/baileys`), a direct WebSocket connection to WhatsApp servers. There is no browser, no DOM, no Puppeteer.

What Changed

Aspect v1 (Chrome) v2 (Baileys)
WhatsApp connection Headless Chromium + whatsapp-web.js Direct WebSocket via Baileys
Authentication QR code scanning Pairing code (8-char entered on phone)
Memory per slice ~400-500 MB ~30-50 MB idle
Container limits 512 MB RAM, 256 MB shm 128 MB RAM, no shm
Session storage Filesystem (.wwebjs_auth) PostgreSQL (baileys_auth table)
Slice lifecycle Destroyed on disconnect/timeout Persists until admin delete
Readiness check /api/health /api/status/state (DB + Baileys)
Max slices (64 GB server) ~60-80 ~200-300

Key Files

File Purpose
backend/src/services/BaileysService.ts Core WhatsApp connection
backend/src/services/BaileysAuthState.ts PostgreSQL-backed auth state
backend/src/controllers/statusController.ts Connection state, pairing codes
gateway/src/sse.ts SSE bridge (Baileys events → browser)
gateway/src/provisioner.ts Slice provisioning

Connection States

State Meaning
disconnected Not connected
connecting WebSocket handshake
waiting_for_pair Ready for pairing code
pairing Code submitted, waiting for phone
ready Fully connected

Removed v1 Components

WhatsAppService.ts, DOMReader.ts, BackfillService.ts, FillService.ts, CollectionService.ts, ContactExtractorService.ts, DataCollectionSteps.ts, entire wa-explorer/ module.