How nauvalunesa/wa-gateway works
Utusan is a multi-session WhatsApp gateway with a React workspace and a Python REST API. The principal workflow is: sign in, pair a device, compose and send a message, then inspect delivery history. The product also supports broadcasts, channels, AI Rich messages, customer-service flows, auto-replies, and per-device profile and privacy controls. The graph groups these capabilities with the API, domain services, and WhatsApp runtime. Some feature routes are documented but unsampled; their links are included only where README or source-index evidence supports them.
Main entry points: application.py FastAPI application · clients.py Session clients · messages.py Message routes · App.tsx Workspace pages
Components 25
Workspace
- Workspace pages
frontend/src/App.tsx - Message composer
frontend/src/MessagePages.tsx - Profile controls
frontend/src/WhatsAppProfilePage.tsx - Customer service editor
frontend/src/CustomerServicePage.tsx - API client
frontend/src/api.ts
Gateway API
- FastAPI application
gateway/application.py - Session and API-key auth
gateway/security.py - Message routes
gateway/routes/messages.py - Device routes
gateway/routes/devices.py - Dashboard routes
gateway/routes/dashboard.py - Customer-service routes
gateway/routes/customer_service.py - Feature routes
gateway/routes
Messaging services
- Message models
gateway/messages/models.py - Customer-service models
gateway/messages/cs_models.py - Customer-service flows
gateway/services/customer_service.py - Auto-reply rules
gateway/services/auto_reply.py - Broadcast service
gateway/services/blast.py - Profile and privacy
gateway/services/profile_privacy.py
WhatsApp and state
- Session clients
gateway/whatsapp/clients.py - Recipient addressing
gateway/whatsapp/addressing.py - Message serialization
gateway/whatsapp/serialization.py - Runtime state
gateway/state.py - Account and message store
gateway/database.py
Other components
- Workspace user
- WhatsApp service
Connections 31
- Workspace user → Workspace pages: uses
- Workspace pages → Message composer: opens composer
frontend/src/App.tsx - Workspace pages → Profile controls: opens profile
frontend/src/App.tsx - Workspace pages → Customer service editor: opens bot editor
frontend/src/App.tsx - Message composer → API client: sends requests
frontend/src/MessagePages.tsx - Profile controls → API client: sends requests
frontend/src/WhatsAppProfilePage.tsx - Customer service editor → API client: sends requests
frontend/src/CustomerServicePage.tsx - API client → FastAPI application: calls REST API
- FastAPI application → Message routes: registers
gateway/application.py - FastAPI application → Device routes: registers
gateway/application.py - FastAPI application → Dashboard routes: registers
gateway/application.py - FastAPI application → Customer-service routes: registers
gateway/application.py - FastAPI application → Feature routes: registers
gateway/application.py - Message routes → Session and API-key auth: requires identity
gateway/routes/messages.py - Customer-service routes → Session and API-key auth: requires identity
gateway/routes/customer_service.py - Customer-service routes → Customer-service models: validates
gateway/routes/customer_service.py - Customer-service routes → Customer-service flows: delegates to
gateway/routes/customer_service.py - Message routes → Message models: uses payloads
gateway/routes/messages.py - Message routes → Recipient addressing: resolves recipients
gateway/routes/messages.py - Message routes → Session clients: sends via
gateway/routes/messages.py - Feature routes → Broadcast service: supports broadcasts
- Feature routes → Auto-reply rules: supports rules
gateway/routes/dashboard.py - Feature routes → Profile and privacy: supports profile controls
- Session clients → Runtime state: uses runtime state
gateway/whatsapp/clients.py - Session clients → Auto-reply rules: dispatches messages
gateway/whatsapp/clients.py - Session clients → Customer-service flows: dispatches messages
gateway/whatsapp/clients.py - Session clients → Account and message store: logs messages
gateway/whatsapp/clients.py - Session clients → WhatsApp service: maintains sessions
- Recipient addressing → Message serialization: converts identifiers
gateway/whatsapp/addressing.py - Customer-service flows → Account and message store: persists settings
gateway/services/customer_service.py - Auto-reply rules → Account and message store: reads rules
gateway/services/auto_reply.py