How mehmetcoskun/waha works
WAHA is a self-hosted WhatsApp HTTP API. Its main workflow is to start a session, authenticate it with a QR code, then send messages and access WhatsApp data through API endpoints. Session engines connect to WhatsApp; storage and media are supporting layers. The tree also shows Chatwoot, MCP, webhook, and monitoring capabilities. Only selected source files were sampled, so some subsystem links reflect the documented workflow and module roles rather than inspected call sites.
Main entry points: manager.core.ts Session manager · engines WhatsApp engines · chatting.controller.ts Messaging endpoints · api REST controllers
Components 20
HTTP API
- REST controllers
src/api - API authentication
src/core/auth - WebSocket gateway
src/api/websocket.gateway.core.ts - Session endpoints
src/api/sessions.controller.ts - Messaging endpoints
src/api/chatting.controller.ts
Sessions and engines
- Session manager
src/core/manager.core.ts - Session runtime
src/core/abc/session.abc.ts - WhatsApp engines
src/core/engines
Storage and media
- Session state
src/core/storage - NOWEB data store
src/core/engines/noweb/store - Media manager
src/core/media/MediaManager.ts - Media storage
src/core/media
Integrations
- Webhook delivery
src/modules/waha-webhook - Chatwoot integration
src/apps/chatwoot - Apps runtime
src/apps/app_sdk/apps/AppRuntime.ts - MCP interface
src/apps/mcp
Operations
- Metrics and health
src/modules/waha-prometheus - Server operations
src/api/server.controller.ts
Other components
- API client
Connections 22
- API client → API authentication: authenticates
- API client → Session endpoints: starts session
- API client → Messaging endpoints: sends requests
- API client → REST controllers: calls API
- REST controllers → API authentication: checks access
- Session endpoints → Session manager: manages sessions
- Messaging endpoints → Session manager: uses session
- Session manager → Session runtime: manages runtime
- Session runtime → WhatsApp engines: selects engine
- WhatsApp engines → WhatsApp: connects
- Session manager → Session state: persists session state
- WhatsApp engines → NOWEB data store: stores WhatsApp data
- Messaging endpoints → Media manager: handles media
- Media manager → Media storage: reads and writes
- WhatsApp engines → Webhook delivery: emits events
- WhatsApp engines → Chatwoot integration: supplies WhatsApp events
- Chatwoot integration → WhatsApp: syncs conversations
- Apps runtime → Session manager: uses sessions
- MCP interface → REST controllers: exposes API tools
- Metrics and health → Session manager: collects session metrics
- API client → Server operations: queries operations
- API client → WebSocket gateway: opens connection