Skip to content
Brian Jiménez Landa
Landa, in production since Sep 2026

A shared WhatsApp inbox that checks the prices in each reply before it is sent

Landa is my own multi-tenant ticketing platform on the WhatsApp Cloud API. Before a reply goes out, an in-memory rule engine checks it against the price list and the team's wording rules. A test holds the average check under 5 ms with a 500-item catalog. An optional AI copilot reads incoming messages in the background and can block a reply only if the company opts in.

Landa shared inbox with an open WhatsApp conversation

The problem

Small teams answer their business WhatsApp from one shared phone. Chats get lost and no one can tell who answered what. Agents also quote wrong prices. I wanted a shared inbox that checks each reply against the price list before it leaves. The hard part was the AI. A model call is slow and does not always give the same answer, so I had to add AI review without making every message wait on it.

What I built

  • A multi-tenant inbox on the WhatsApp Cloud API. Each conversation becomes a ticket with a case number, history, tags, attachments and the 24-hour reply window in view. New tickets are assigned to an agent automatically.
  • An in-memory rule engine that checks each outgoing reply against the current price list and the team's wording rules. Unless the company opts in to AI blocking, it is the only check that can block a send. A test holds the average check under 5 ms with a 500-item catalog.
  • An optional AI copilot. It reads each incoming message after it is saved, suggests replies and drafts the case summary when the ticket closes. Its five AI features and the two rule checks each have their own switch.
  • WhatsApp intake with HMAC-verified webhooks and every inbound message type normalized, checked against 10 real Meta payloads. Media is downloaded on arrival because Meta's media IDs expire after 7 days, and Meta's per-message cost is read from delivery receipts.
  • A React 19 panel with 9 screens. I redesigned it in three layouts and checked it at 1440, 1366, 820 and 390 px, in light and dark mode. Before the redesign, you could not open a conversation on a phone.
  • A keyword floor under the model's risk reading that quotes the customer's exact words. I ran one churn-threat message 6 times and the model alone flagged it 5 times. With the floor it flagged 5 of 5 runs, with 0 false alarms in 5 runs of a merely annoyed customer. The sample is small.

Screens

  • Shared inbox: queues, tags, the open conversation and the customer card. Demo data.
  • The rule engine stops a reply that quotes a price different from the catalog, before it reaches the customer.
  • Dark mode, with an urgent complaint flagged for a supervisor. Demo data.
  • Each company decides what the AI copilot may do, including whether it can hold a reply.
  • Team and roles: owner, supervisor and agents.
  • The same inbox on a phone.
  • Answering a conversation from the phone.
  • Mobile, dark mode.

How it works

The code is a monorepo with five packages and one web app. A pure domain core holds ticket states and assignment, with no I/O. The channel layer has one interface and two adapters, a simulated channel and the WhatsApp Cloud API, and both pass the same contract tests. That let me test the ticket flow without sending a real WhatsApp message. Each package has its own node:test suite, 430+ tests in all.

Intake never waits for a model. A new message is saved first and then published on an in-process event bus. The copilot subscribes there, and each subscriber runs on its own, so a failing one cannot break intake. The optional tone review is the one AI step on send. It makes one model call per message, cached by text hash, and adds about a second when the verdict is not cached. If the model fails, the message goes out. By default it asks the agent to confirm, and it blocks only if the company chose that policy.

A PostgreSQL CHECK constraint refuses to record a block from the model unless the company chose that policy, and schema tests check that the database enforces business rules. The server is Fastify with explicit SQL and Spanish full-text search. Socket.IO keeps one room per company, so agents see new tickets live and each company's events go only to its own room.

Deploys go through a script that does a dry run and saves a database dump and a code snapshot first. The dry run once caught an rsync --delete that would have wiped the live PostgreSQL volume. Production runs behind nginx with pm2. Today it runs as a plain inbox: the AI features and the rule checks are switched off there.

Results

<5 ms
average rule check with a 500-item catalog, held by a test assertion
430+
automated tests (node:test)
38
production deploys with a rollback point in 23 days

Who else worked on it

Solo project: no one else worked on the code. WhatsApp Cloud API, OpenAI and DeepSeek are third-party services, and the two photos on the sign-in screen come from Unsplash.

Full stack

Node.js 22, Fastify 5, PostgreSQL 16, Socket.IO 4, React 19, Vite 6, JavaScript (ESM + JSDoc), pnpm workspaces, WhatsApp Cloud API, OpenAI-compatible LLM API (OpenAI, DeepSeek), Whisper, pdfjs-dist, node:test, Google OAuth, AES-256-GCM, Docker, nginx, pm2