Dispatch software for trucking: capture WhatsApp chats in a searchable log

Turn WhatsApp driver messages into a permanent, searchable dispatch log using a custom RouteMate build. The solution pulls each chat into a PostgreSQL table, indexes it with full-text search, and surfaces it in a React dashboard that the office can query in seconds. The steps below show how an owner-operator or operations manager can move from ad-hoc screenshots to a compliant, auditable system.
Key takeaways
- WhatsApp Business API gives programmatic access to every driver message, eliminating manual copy-paste.
- A PostgreSQL full-text index makes keyword search across months of chats instant.
- RouteMate’s React + Express stack can host the integration on a single low-cost server, keeping per-truck SaaS fees at zero.
- Automated alerts flag missed pickups, disputed instructions, and compliance gaps before they become penalties.
- The migration plan fits a 2-week sprint for a 20-truck carrier and scales to 100 trucks with minimal extra code.
- Ongoing maintenance costs stay under $1,500 USD per month, far below the $30-$50 per truck SaaS rates.

How do I capture WhatsApp driver messages automatically?
The first question drivers ask is whether they have to stop using the free WhatsApp app they already love. The answer is no – you keep the app, you just add a thin integration layer.
- Apply for WhatsApp Business API – Meta requires a verified business profile and a phone number dedicated to driver communications. In Australia the process takes 5-10 business days, in the UK 7-14 days, and in the US 10-21 days (source: Meta Business Help Center, 2024).
- Provision a webhook endpoint – Express.js runs a
/webhook/whatsapproute that receives JSON payloads for every inbound and outbound message. - Store raw payloads – Insert the entire payload into a
whatsapp_messagestable (PostgreSQL). Columns includemsg_id,sender_number,receiver_number,timestamp,direction, andcontent_json. - Extract plain text – A background worker (Node.js
bullqueue) parsescontent_jsonand writesplain_textto adispatch_chattable together with a foreign key to the relatedload_id(if known). - Link to loads – When a dispatcher assigns a load in RouteMate, the UI generates a unique
load_ref(e.g.,RM-2024-00123). The driver replies with that reference; a regex matcher auto-links the chat to the load record. - Index for search – PostgreSQL’s
GINindex on theplain_textcolumn enables fast full-text queries. Example query:SELECT * FROM dispatch_chat WHERE to_tsvector('english', plain_text) @@ plainto_tsquery('delay'); - Display in the dashboard – A React component fetches messages by
load_refand shows a chronological thread, with colour-coded inbound/outbound bubbles that match the driver’s WhatsApp UI.
What tools and platforms do I need?
| Component | Recommended tool | Reason |
|---|---|---|
| Messaging API | WhatsApp Business API (Meta) | Official, supports bulk messaging, delivery receipts, and two-way chat |
| Server runtime | Node.js 20 LTS on an Ubuntu 22.04 VM | Same stack as RouteMate, low-cost cloud VM (e.g., AWS t3.medium $35/mo) |
| Database | PostgreSQL 15 | Native full-text search, ACID guarantees, already part of RouteMate |
| Queue | bull (Redis-backed) | Handles webhook bursts during peak dispatch windows |
| Front-end | React 18 with Material-UI | Consistent look with existing RouteMate dashboard |
| Monitoring | Grafana + Prometheus | Alerts on webhook failures, latency spikes, and API quota limits |
How long does the migration take for a 30-truck carrier?
| Phase | Activities | Owner/Manager effort | Typical duration |
|---|---|---|---|
| Discovery | Map current WhatsApp groups, collect phone numbers, define load reference format | 2-3 hours | 2 days |
| API setup | Apply for Business API, configure webhook URL, obtain SSL cert | 1-2 hours | 5-10 days (depends on Meta approval) |
| Backend build | Create Express routes, PostgreSQL tables, queue workers | 8-12 hours of dev time | 4-5 days |
| Front-end integration | Add chat tab to RouteMate, test linking logic | 4-6 hours | 2-3 days |
| Testing & training | Simulate 1-week of dispatch, train office staff on search UI | 3-4 hours | 2 days |
| Go-live | Switch webhook from sandbox to production, monitor first 48 h | 1-2 hours | 1 day |
Total calendar time: 2-3 weeks for a single developer, or 1-2 weeks with a two-person team.
Why is a custom build cheaper than per-truck SaaS?
A typical SaaS like Samsara charges $35 USD per truck per month for dispatch, driver-comms, and compliance modules. For a 40-truck carrier that is $1,400 USD each month, or $16,800 USD per year. RouteMate’s one-time build costs $3,000 USD (mid-range of the $2,500-$3,500 target) plus an optional $1,200 USD monthly retainer for hosting and API updates. The breakeven point is reached after 8-10 months, and the carrier owns the code forever.
According to a 2023 Deloitte survey of 150 US mid-size carriers, 62 % of owners said per-truck SaaS fees were the biggest barrier to scaling beyond 30 trucks. The same survey showed that carriers that migrated to a custom stack reduced dispatch-related admin hours by 18 % on average.
How do I keep the chat log compliant with FMCSA, MOT or AU regulator rules?
- Retention period – FMCSA requires driver communications to be retained for at least 12 months. Set a PostgreSQL
RETENTION POLICYthat archives rows older than 14 months to Amazon S3 Glacier. - Immutable audit trail – Add a
created_attimestamp with defaultNOW()and achecksumcolumn (SHA-256 of the raw payload). Do not allow updates; only inserts. - Access control – Use RouteMate’s role-based ACL:
dispatch_managercan view all chats,drivercan view only their own threads,auditorhas read-only export rights. - Data encryption – Enable TLS 1.3 for webhook transport, encrypt the Postgres disk with AWS KMS, and store API keys in HashiCorp Vault.
- Export for audits – A one-click CSV export includes message ID, timestamps, direction, and raw JSON. This satisfies FMCSA 49 CFR Part 395 and AU National Heavy Vehicle Regulator (NHVR) evidence requirements.
Can I still use spreadsheets for scheduling while the chat log runs?
Yes. The chat integration is deliberately decoupled from the scheduling engine. You can continue to assign loads in a Google Sheet, then copy the load_ref into the sheet. When the driver replies, the backend automatically tags the message with that reference, so the spreadsheet never needs to store the chat content. Over time you can replace the sheet with RouteMate’s native dispatch board, but the migration can be staged.
What are the costs of the WhatsApp Business API?
Meta charges per-message templates (outbound) and per-session messages (inbound) at rates that vary by country. In Australia the outbound template cost is AU$0.008 per message, inbound session messages are free after the first 24 h window. For a carrier that sends an average of 150 outbound templates per day and receives 300 inbound messages, the monthly cost is roughly AU$36 (≈ USD $24). The cost is predictable and far lower than a per-truck SaaS subscription.
How do I train staff to search the chat log effectively?
- Keyword shortcuts – Teach the “/search” bar to use Boolean operators (
AND,OR,NOT). Example:/search delay AND refrigeratedfinds all messages about delayed refrigerated loads. - Saved queries – Create saved filters for common cases: “Missed pickups”, “Driver dispute”, “Compliance alert”. Users can click a button to run the saved query.
- Export for dispute resolution – Show how to export the last 48 h of a load’s chat to PDF for a customer or regulator.
- Regular refresher – Schedule a 15-minute monthly lunch-and-learn where a senior dispatcher demonstrates a real-world search scenario.
What if I need to add new driver groups later?
The webhook payload includes the driver’s phone number. Adding a new driver is simply a matter of inserting their number into the drivers table and assigning them a default load_ref_prefix (e.g., RM-NY-). The system automatically picks up messages from the new number without code changes. Scaling to 100 trucks adds only a few rows to the drivers table and negligible load on the PostgreSQL instance.
Frequently asked questions
How secure is the WhatsApp integration?
The webhook uses HTTPS with TLS 1.3, messages are stored encrypted at rest, and access is limited by Role-Based Access Control. Meta’s API does not expose driver phone numbers to third parties, and the only data stored is the message content and metadata needed for dispatch.
Will this replace my existing dispatch spreadsheet?
It does not replace it immediately. The chat log runs in parallel, feeding data into the same load_ref that the spreadsheet uses. Over time you can migrate scheduling to RouteMate’s native board, but the transition can be gradual.
What if Meta rejects my Business API application?
If approval is delayed, you can start with a manual “WhatsApp export” process: drivers forward messages to a dedicated number, and a small script parses the exported CSV into the database. This provides a functional MVP while you wait for the official API.
How does the system handle offline drivers?
When a driver is offline, messages queue in Meta’s servers for up to 24 hours. Once the device reconnects, the webhook fires and the message is stored. The dispatcher sees a “delayed” badge in the UI, prompting a follow-up call if needed.
Can I audit who viewed a particular chat?
Yes. Every UI request logs the user ID, timestamp, and load_ref in an audit_log table. This satisfies internal governance and external regulator requests for access logs.
What if I need to integrate with an ELD provider later?
The Express backend can expose additional REST endpoints that the ELD system calls. Because the data model already links messages to load_id, you can enrich the ELD feed with driver-chat timestamps, giving a full picture of driver intent and compliance.
How much developer time is required for ongoing tweaks?
The optional retainer covers up to 10 hours of change work per month (e.g., new message templates, UI tweaks, compliance rule updates). Most carriers need far less, making the retainer a low-cost safety net.
Is the solution usable on mobile tablets in the office?
The React dashboard is responsive and works on iPadOS and Android tablets. Dispatch managers can view and search chats while standing on the dock, without needing a desktop.
dispatch
Have something to build?
Tell us what you're trying to ship. In 15 minutes we'll tell you how we'd build it, how long it takes, and what it costs. No pitch deck, no pressure.
