How Developers Can Build Their Own WhatsApp CRM + Voice AI Ecosystem Without Vendor Lock-In
The AI communication revolution has quietly entered a new phase.
For years, businesses depended on expensive SaaS platforms for:
- WhatsApp automation
- AI calling agents
- CRM workflows
- Voice bots
- Customer engagement systems
Every month, companies paid:
- WhatsApp API fees
- Voice AI platform charges
- Per-minute calling costs
- LLM usage fees
- Additional platform subscription fees
And despite spending heavily, organizations still did not truly own their infrastructure.
Now that is changing.
Two emerging open-source platforms are reshaping the ecosystem:
- Open-source WhatsApp CRM & Automation Platform
- Dograh, an open-source Voice AI orchestration platform
Together, these platforms represent something much bigger:
A fully self-hosted AI communication stack where organizations control:
- their workflows,
- their data,
- their AI models,
- their infrastructure,
- and their long-term costs.
The Problem With Traditional AI Communication Platforms
Most businesses today use platforms like:
- Vapi
- Bland
- Retell
- Twilio workflows
- Proprietary WhatsApp CRMs
These tools are fast to start with.
But over time, companies face several major challenges:
| Problem | Impact |
|---|---|
| Rising subscription costs | Increasing operational expenses |
| Vendor lock-in | Difficult migration |
| Limited customization | Restricted workflows |
| Black-box debugging | Hard to identify failures |
| Platform dependency | Risk of pricing or policy changes |
| Limited infrastructure control | Compliance concerns |
| Scaling costs | Exponential pricing |
Modern AI systems are no longer simple chatbots.
They are:
- real-time systems,
- event-driven platforms,
- conversational orchestration engines,
- multi-provider integrations,
- API-driven workflow ecosystems.
And businesses increasingly want ownership.
Open Source WhatsApp CRM & AI Voice Revolution
Below is a novice-friendly step-by-step implementation guide combining both platforms:
- Open-source WhatsApp CRM
- Dograh Open-source Voice AI Platform
These steps are written so even a fresher can follow and develop a working prototype.
Part 1: Build Open-source WhatsApp CRM
A. Prerequisites
Install these first:
| Tool | Purpose |
|---|---|
| Node.js | Run the CRM project |
| npm | Install packages |
| Git | Clone GitHub project |
| Antigravity / VS Code | Code editor |
| Supabase account | Database + authentication |
| Meta Developer account | WhatsApp API |
| ngrok | Test webhook locally |
| GitHub account | Push code for deployment |
B. Project Setup
Step 1: Clone GitHub Repository
Open terminal:
git clone <github-repo-url>Example:
git clone https://github.com/your-repo/wacrm.gitGo inside project folder:
cd wacrmStep 2: Install Dependencies
npm installThis installs all required Node.js packages.
Step 3: Open Project in Antigravity IDE
- Open Antigravity IDE
- Click Open Folder
- Select
wacrmfolder - Click Trust Project
Step 4: Create .env.local
Run:
cp .env.example .env.localFor Windows:
copy .env.example .env.localOpen .env.local.
You will later fill values like:
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=
META_APP_SECRET=
ENCRYPTION_KEY=C. Supabase Setup
Step 5: Create Supabase Project
- Go to Supabase
- Login
- Click New Project
- Enter:
- Project name
- Database password
- Click Create Project
Step 6: Copy Supabase Keys
Go to:
Project Settings → APICopy:
NEXT_PUBLIC_SUPABASE_URL=your_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_keyPaste them in .env.local.
Important: Never share SUPABASE_SERVICE_ROLE_KEY.
Step 7: Run Database Migrations
In project, open:
supabase/migrations/You will see multiple SQL files.
For each SQL file:
- Open file in Antigravity
- Copy full SQL
- Go to Supabase
- Open SQL Editor
- Paste SQL
- Click Run
Run files in order:
001 → 002 → 003 → ... last fileThis creates CRM database tables.
Step 8: Generate Encryption Key
Run:
openssl rand -base64 32Copy output and paste in .env.local:
ENCRYPTION_KEY=generated_key_hereStep 9: Start CRM Locally
Run:
npm run devOpen browser:
http://localhost:3000If port is busy, it may run on:
http://localhost:3003Step 10: Disable Email Confirmation
In Supabase:
Authentication → Providers → EmailDisable:
Confirm EmailSave changes.
Step 11: Create CRM User
Open CRM URL.
Click:
Create AccountEnter:
- Name
- Password
Now login to CRM dashboard.
D. Meta WhatsApp API Setup
Step 12: Create Meta Developer App
Go to:
developers.facebook.comSteps:
- Login
- Click Create App
- Select Connect with customers through WhatsApp
- Give app name
- Select business portfolio
- Click Create App
Step 13: Get WhatsApp Details
Inside Meta app:
WhatsApp → API SetupCopy:
| Field | Use |
|---|---|
| Phone Number ID | Send WhatsApp messages |
| WhatsApp Business Account ID | Business account mapping |
| Temporary Access Token | Testing only |
Step 14: Test Message from Meta
In Meta API Setup:
- Add recipient phone number
- Verify OTP
- Click Send Message
If WhatsApp message comes, Meta setup is working.
E. Create Permanent Access Token
Step 15: Go to Meta Business Settings
Open:
business.facebook.comGo to:
Business Settings → Users → System UsersStep 16: Create System User
- Click Add
- Enter system user name
- Select type: Admin
- Click Create System User
Step 17: Assign Assets
Assign:
- Meta App
- WhatsApp Account
Give:
Full ControlStep 18: Generate Permanent Token
Click:
Generate TokenSelect app.
Set expiry:
NeverSelect permissions:
whatsapp_business_management
whatsapp_business_messaging
business_managementCopy token.
F. Configure CRM WhatsApp Settings
In CRM dashboard, go to:
Settings → WhatsApp ConfigEnter:
Permanent Access Token
Phone Number ID
WhatsApp Business Account ID
Webhook Verify TokenExample verify token:
my_secure_verify_token_123Save.
G. Add Meta App Secret
In Meta Developer Portal:
App Settings → BasicCopy:
App SecretPaste in .env.local:
META_APP_SECRET=your_app_secretRestart local server:
npm run devH. Webhook Setup Using ngrok
Step 19: Start ngrok
If CRM runs on port 3000:
ngrok http 3000If CRM runs on port 3003:
ngrok http 3003You will get HTTPS URL like:
https://abc123.ngrok-free.appStep 20: Configure Webhook in Meta
Go to:
Meta App → WhatsApp → ConfigurationCallback URL:
https://abc123.ngrok-free.app/api/whatsapp/webhookVerify token:
same_token_used_in_crmClick:
Verify and SaveI. Create First WhatsApp Automation
Step 21: Create Contact
In CRM:
Contacts → Add ContactEnter:
- Name
- Mobile number with country code
- Company
Save.
Step 22: Create Automation
Go to:
Automations → Create AutomationTrigger:
New message receivedCondition:
Message contains keywordKeyword:
AstroAction:
Send MessageMessage:
Hi, thanks for contacting Astro.Set automation:
ActiveSave.
Step 23: Test WhatsApp Automation
From your test WhatsApp number, send:
Hi AstroExpected reply:
Hi, thanks for contacting Astro.Now your WhatsApp CRM automation is working.
Part 2: Build Dograh Voice AI Platform
Dograh is an open-source alternative to hosted voice AI platforms like Vapi, Bland, and Retell. It allows developers to self-host voice AI agents with workflows, tracing, recordings, and API calls.
A. Prerequisites
Install:
| Tool | Purpose |
|---|---|
| Git | Clone Dograh |
| Docker | Run containers |
| Docker Compose | Start full app stack |
| Browser | Access Dograh UI |
| LLM API key | AI response generation |
| STT provider | Speech-to-text |
| TTS provider | Text-to-speech |
| Phone provider | Call handling |
B. Dograh Setup
Step 1: Clone Dograh Repository
git clone <dograh-github-repo-url>Go inside folder:
cd dograhStep 2: Start Dograh with Docker
Run:
docker compose upor:
docker-compose upWait until all containers are running.
Step 3: Open Dograh UI
Open browser:
http://localhost:<dograh-port>The exact port depends on project configuration.
Common examples:
http://localhost:3000
http://localhost:8080C. Create Voice AI Agent
Step 4: Create New Agent
Inside Dograh UI:
- Click Create Agent
- Give name:
Lead Qualification Agent- Select voice provider
- Select speech-to-text provider
- Select LLM provider
Step 5: Add Prompt Node
Create first prompt:
You are a polite AI sales assistant. Your job is to qualify inbound leads. Ask the caller what they want to build, their company size, industry, budget, and timeline.Step 6: Add Qualification Questions
Create flow:
| Step | Question |
|---|---|
| 1 | What are you looking to build? |
| 2 | What is your company name? |
| 3 | What is your company size? |
| 4 | What is your expected monthly call volume? |
| 5 | What is your budget? |
| 6 | When do you want to start? |
Step 7: Add API Tool Call
Create API tool:
Create or Update Lead in CRMExample API:
POST https://your-crm.com/api/leadsPayload:
{
"name": "{{caller_name}}",
"company": "{{company_name}}",
"industry": "{{industry}}",
"budget": "{{budget}}",
"requirement": "{{requirement}}",
"call_volume": "{{call_volume}}"
}Step 8: Add Branch Logic
Create condition:
If budget is high and requirement is clearThen:
Transfer to human sales teamElse:
Save lead and send follow-up messageStep 9: Add Human Transfer
Transfer condition:
Qualified Lead = YesAction:
Transfer CallTransfer number:
+91XXXXXXXXXXD. Test Dograh Voice Agent
Step 10: Run Test Call
Inside Dograh:
- Click Test Call
- Speak as customer:
We are looking for an AI phone agent for inbound demo requests.AI should ask follow-up questions.
Step 11: Verify Runtime Logs
After call, check:
| Section | What to Check |
|---|---|
| Transcript | What caller said |
| Trace | Each AI decision |
| Tool Call | CRM API success/failure |
| State Changes | Captured variables |
| Recording | Full call recording |
This helps debug voice AI properly.
Part 3: Combine WhatsApp CRM + Dograh Voice AI
Now the powerful part.
You can connect both systems into one communication ecosystem.
A. Combined Architecture
Customer
|
| WhatsApp Message / Phone Call
|
-----------------------------------------
| AI Communication Layer |
-----------------------------------------
| WhatsApp CRM | Dograh Voice AI |
| Meta API | STT + LLM + TTS |
| Automation Engine | Voice Workflow |
-----------------------------------------
|
| API Calls
|
-----------------------------------------
| CRM / ERP / HMIS / HRMS / Synth Ed |
-----------------------------------------
|
| Database
|
-----------------------------------------
| Supabase / PostgreSQL / MySQL |
-----------------------------------------B. Example Combined Flow
Scenario: Admission Inquiry
- Parent sends WhatsApp:
I want admission details- WhatsApp CRM auto replies:
Thank you. Our AI counselor can call you. Please share preferred time.- Parent replies:
Call now- CRM calls Dograh API:
Start voice call- Dograh AI asks:
- Student class
- Location
- Board preference
- Budget
- Transport need
- Dograh updates CRM lead.
- Qualified lead is assigned to admission counselor.
C. Example Healthcare Flow
- Patient sends WhatsApp:
Need appointment with dentist- CRM captures mobile number.
- Dograh voice agent calls patient.
- AI asks:
- Symptoms
- Preferred date
- Doctor preference
- Emergency or routine
- API creates appointment in HMIS.
- WhatsApp CRM sends confirmation.
Final Learning Outcome
You will learn:
- Git cloning
- Node.js project setup
- Environment variables
- Supabase database setup
- SQL migration execution
- Meta WhatsApp API setup
- Webhook configuration
- ngrok tunneling
- Docker Compose
- Voice AI workflow creation
- API tool calling
- CRM integration
- Basic AI automation architecture
Leave a comment
Your email address will not be published. Email is optional. Required fields are marked *




