How engmohamadalagha/wasl-command-center works
Wasl Command Center is a multi-tenant WhatsApp automation and business-management platform, with a web admin console and an Electron desktop shell. The principal customer flow is an inbound WhatsApp webhook, message processing and domain-specific handling, then an automated response through a channel sender. Separate admin workflows manage tenants, inbox conversations, bookings, orders, and templates; payment-proof handling can verify receipts. The README is empty, and excerpts are partial, so some route wiring and persistence details cannot be confirmed and are left unconnected.
Main entry points: engine.mjs AI conversation engine · process.mjs Webhook processing · service.mjs Inbox service · db.mjs Database access
Components 30
Runtime and web
- Desktop shell
electron/main.cjs - Server bootstrap
server.mjs - Agent runtime
agent.mjs - Web application
src/web/app.mjs
Messaging and AI
- Webhook routes
src/web/routes/webhook/index.mjs - Webhook processing
src/web/routes/webhook/process.mjs - AI handler
src/web/routes/webhook/handlers/ai.mjs - AI conversation engine
src/ai/engine.mjs - Channel sending
src/channels/send.mjs - Channel adapters
src/channels/registry.mjs
Business workflows
- Booking handler
src/web/routes/webhook/handlers/booking.mjs - Order handler
src/web/routes/webhook/handlers/orders.mjs - Receipt verification
src/media/paymentProof.mjs - Google Calendar
src/integrations/googleCalendar.mjs - CRM
crm.mjs
Management console
- Admin routes
src/web/routes/admin/index.mjs - Inbox service
src/inbox/service.mjs - Template lifecycle
src/services/templateService.mjs
State and integrations
- Tenant configuration
tenants.mjs - Database access
db.mjs - Conversation memory
src/memory/conversations.mjs - Key-value store
store.mjs - Job queues
src/jobs/queue.mjs - Redis client
src/jobs/redisClient.mjs
Other components
- WhatsApp customer
- Business operator
- Meta WhatsApp
- AI provider
- PostgreSQL
- Redis
Connections 31
- Desktop shell → Server bootstrap: starts backend
- Server bootstrap → Agent runtime: starts runtime
- WhatsApp customer → Meta WhatsApp: sends message
- Meta WhatsApp → Webhook routes: posts webhook
- Webhook routes → Webhook processing: dispatches processing
- Webhook processing → AI handler: dispatches AI
- Webhook processing → Booking handler: dispatches bookings
- Webhook processing → Order handler: dispatches orders
- AI handler → AI conversation engine: requests reply
- AI conversation engine → Tenant configuration: resolves tenant
- AI conversation engine → Conversation memory: reads and writes history
- AI conversation engine → AI provider: requests completion
- AI conversation engine → Channel adapters: returns reply for sending
- Channel adapters → Channel sending: selects sender
- Channel sending → Meta WhatsApp: sends message
- Booking handler → Google Calendar: calendar integration
- Order handler → Receipt verification: handles receipt image
- Receipt verification → Meta WhatsApp: downloads media
- Receipt verification → CRM: logs payment event
- Business operator → Admin routes: manages business
- Admin routes → Inbox service: uses inbox service
- Admin routes → Template lifecycle: manages templates
- Inbox service → Conversation memory: reads conversation
- Inbox service → Key-value store: reads takeover state
- Inbox service → Database access: queries messages
- Template lifecycle → Database access: scoped template access
- Template lifecycle → Meta WhatsApp: submits and syncs templates
- Web application → Database access: checks database health
- Database access → PostgreSQL: queries
- Job queues → Redis client: requests Redis
- Redis client → Redis: connects optionally