Echo Chat
Empowers businesses to manage WhatsApp conversations and automate customer service using keyword matching and AI agents. This all-in-one dashboard features broadcast capabilities, a built-in knowledge base, and real-time shipping cost lookups.

I built EchoChat because small businesses in Indonesia were stuck between the official WhatsApp Business API — which costs thousands per month and requires Meta review — and doing everything manually or with brittle, script-based solutions. I wanted to give solo entrepreneurs and tiny teams the same automation power as enterprise setups, without the enterprise overhead. So I bet on @whiskeysockets/baileys, the unofficial WhatsApp Web protocol library, and built a full SaaS platform on top of it. That bet is the whole story of this project: how do you make something production-grade when the foundation is a reverse-engineered, undocumented protocol that can break at any time?
The architecture ended up split across two repos — a Next.js dashboard and a Node.js engine — sharing a single PostgreSQL database, connected by Socket.io for real-time state sync and tRPC for API calls. That split created its own challenges: both repos maintain independent Prisma schemas that have to stay in lockstep, and every socket event contract has to be coordinated across both codebases. The hardest technical problem was the AI agent pipeline. I built a multi-step system that classifies intent, selects an agent via vector similarity, builds a prompt with context from three tool sources (product lookup, FAQ search, and a Raja Ongkir shipping API), calls the LLM through a drop-in provider abstraction (OpenAI, DeepSeek, or Groq — interchangeable behind the Vercel AI SDK), and strips <thinking> blocks from the output before sending the reply. The quota system required a reservation pattern — reserve tokens before the LLM call, convert to actual usage after — to prevent the classic race condition where two messages consume from the same budget simultaneously.
I learned that maintaining reliability on an unofficial protocol means investing in observability and graceful degradation. The WhatsApp sessions persist server-side even when the browser disconnects, and reconnecting clients get a full state sync through Socket.io — the dashboard shows you current connection status, inbox state, and agent activity without missing a beat. The routing engine, follow-up system, and keyword auto-reply all had to accommodate the inherent lag of WebSocket communication and the asynchronous nature of WhatsApp message delivery. The tag-merging race condition in the routing engine is still on my fix list — a reminder that distributed systems problems don't go away just because your app is small. If I were starting over, I'd centralize the Prisma schema in a shared package and invest in end-to-end type safety across the socket boundary from day one. What made the project worth building, though, was seeing it work: messages flow in, agents respond, campaigns send, and the whole thing runs on a single $10 VPS serving real users.