Tawselah — Driver Trip-Transfer Platform
A trip-transfer and commission system that lives inside WhatsApp: a driver posts a trip in the group, a colleague accepts with one word, and the commission is charged automatically from a prepaid wallet. Behind it sits a NestJS API running wallets, commissions, platform fees, withdrawals and reporting, integrated with Meta's official WhatsApp Business Platform and shaped by 39 documented architecture decisions.

Key Metrics
Tech Stack
Key Features
- Trip transfer inside WhatsApp: post a trip, accept with a single word, confirm the winner with a 👍 reaction
- Prepaid wallets with credit limits, per-trip commission and a recurring platform fee
- Atomic trip assignment, so two drivers can never win the same trip
- Reliable webhooks: idempotent handling and origin verification
- Rate-limited, fully logged outbound WhatsApp messaging
- Money handled as exact decimals, never floating point
- Admin API: driver registration, wallet top-ups, withdrawals with receipts, and financial reports
- Audit log tying every action to an actor, plus automated cleanup of dormant drivers
- Docker Compose + Caddy deployment with CI-built images published to GHCR
Project Impact
- Turns a chaotic manual process in WhatsApp groups into an accountable pipeline: no trip is assigned twice, no commission is lost, and every decision is traceable.
Project Overview
Overview
Tawselah turns WhatsApp into a working marketplace for drivers. Drivers already trade trips in group chats, informally and with no accountability. Tawselah keeps that familiar workflow but puts a rigorous backend underneath it: trips are parsed, wallets are checked, commissions are charged exactly once, and everything is auditable.
How it works
- A driver posts a trip with a price in a monitored WhatsApp group, and the backend parses it into a structured trip.
- Other drivers reply with one word to accept. Each acceptance is checked against that driver's wallet balance and credit limit.
- The posting driver reacts 👍 to the winner, who becomes the assigned driver. The commission is charged to their wallet in the same transaction.
- Rejections, deletions and withdrawals are announced privately in Arabic to the affected driver.
- Admins register drivers, top up wallets, process withdrawals, configure commission rules and read financial reports.
WhatsApp is the operational interface, the database is the source of truth, and the web panel is the management interface.
Why it is interesting
This is a small system with money in it, so correctness matters more than features.
- Atomic assignment. Two drivers accepting at the same instant can never both win the trip.
- Reliable webhooks. Messages arrive more than once and out of order, so handling is idempotent and each request's origin is verified.
- Exact money. Every amount is a decimal, not a float, and financial reports net out corrections.
- Polite at scale. Outbound WhatsApp messages are rate-limited and logged, which protects the number from being flagged.
- Accountability. Every action is written to an audit log against the actor who performed it.
- Self-cleaning. Dormant drivers are deactivated and removed on a weekly schedule.
Engineering
- NestJS 11 on Node 20 with TypeScript, organised into 17+ modules: drivers, trips, wallets, commission, platform fee, withdrawals, receipts, reports, settings, audit, dashboard, WhatsApp and health.
- PostgreSQL 16 with Prisma 6, with migrations applied on deploy.
- WhatsApp Business Platform (Meta's official Cloud API) for inbound webhooks and outbound messaging, with support for a second number for private messages and failover.
- Security: JWT cookie auth for admins, request throttling, an allowlist of monitored groups, and only ports 22, 80 and 443 exposed.
- Documented decisions: 39 Architecture Decision Records cover wallet design, atomic assignment, webhook reliability, decimal money and rate limiting, alongside a domain glossary and an OpenAPI contract for the admin panel.
- Delivery: Docker Compose with Caddy for automatic HTTPS on a single VPS; images are built in CI and published to GHCR on every push to
main.
Outcome
A process that used to depend on trust and screenshots now runs as an accountable pipeline: no double assignments, no lost commissions, and a complete trail for every trip and every dinar.