Abd Alftah Salem
Hire me
←All case studies

Case study · Private project

Wasl Pro

A multi-tenant AI sales and booking platform that lets merchants answer, sell and book across WhatsApp, Messenger, Instagram, Telegram and a website chat widget from one inbox.

01Problem

Customers write on five channels; the store has one team

Small stores sell through chat, but questions, orders and bookings are scattered across WhatsApp, Messenger, Instagram, Telegram and their website. Wasl Pro brings every channel into one inbox, where an AI agent answers in Arabic or English from the store’s real catalogue, stock and booking slots, and the team can take over at any moment.

Numbers linked by QR code run on WhatsApp Web, which restricts traffic that looks automated, so sending had to be paced and capped to protect each number.

02My role

Founder & lead engineer

I founded Wasl Pro in April 2026 and lead its engineering across four repositories: the NestJS backend, the WhatsApp bridge, the Next.js dashboard and the Flutter merchant app — architecture, data model, deployment and tests.

03How it works

How it works

Inbound messages are accepted fast and processed later: a signature-checked webhook or the bridge posts to the API, which enqueues a BullMQ job and returns 200. A worker resolves the store, saves the message, pushes it to the dashboard and app over Socket.IO, runs the AI agent with tools against the store’s data, and replies through the right channel.

Message flow

Message flowWeb dashboardNext.js 16Merchant appFlutterCustomer channelsMeta · Telegram · widgetAPINestJS · REST + Socket.IOQueues and locksRedis 7 · BullMQWorkerAI agent · schedulerBusiness dataPostgreSQL 16WhatsApp bridgeExpress · BaileysQR-linked numberspaced, capped sends

04Screens

Screens (demo data)

05Key technical decisions

The choices that shaped it

One codebase, two processes

main.ts serves HTTP; worker.ts runs the same modules headless and consumes the BullMQ queues. Shared state lives only in PostgreSQL and Redis, and a Socket.IO Redis adapter lets several API instances broadcast the same events.

WhatsApp Web isolated in its own service

QR sessions live in a separate Express + Baileys bridge behind an internal secret, with session files encrypted at rest (AES-256-GCM), so the unofficial path can be scaled or switched off without touching the official Cloud API flow.

Replies and proactive messages are different traffic

Every send is tagged reply or proactive. Replies stay fast; reminders and campaigns are queued per number, spaced 12–35 s apart, capped daily (defaults: 200, of which 30 to new contacts) and sent only to numbers confirmed on WhatsApp.

06Hard parts solved

What made it more than a script

Reconnect loops that put numbers at risk

Logged-out, banned or replaced sessions never reconnect; network drops back off 30 s → 2 min → 10 min, at most 3 times an hour, then pause 30 minutes and alert the store. Unscanned QR codes stop, and sessions restore 20–35 s apart after a restart.

No double sends over a slow, retried hop

Paced sending makes each send slow, so the backend may retry. Each call carries a clientMessageId; a repeat returns the first result, even mid-flight. The bridge refuses (429 queue_busy) anything it cannot start within 60 s, inside the backend’s 120 s timeout.

Caps that survive restarts

Counters are re-checked right before each send and persisted atomically to a send-state file, so a restart never resets a quota. Two failed deliveries to one chat within 10 minutes pause it for 6 hours.

07Outcome

Where it stands

A full platform across four codebases, bilingual on the web, in the app and in API errors. The number-protection layer (pacing and caps) and idempotent bridge sends are merged, with tests for backoff, queue ordering, idempotency and caps.

3,849backend tests passing
140bridge tests passing
46backend modules
4repositories

Automated tests passing, by service

Backend (NestJS)3,849
WhatsApp bridge140

Source: local Jest runs on the merged code, Oct 31, 2026 (backend: 3,849 passed, 301 database/e2e tests skipped; bridge: 140/140).

08Stack & links

Built with

Private project — no public demo, live link or source code.

© 2026 Abd Alftah Salem · Back to portfolio