How trulytuhin/almanac-crm works
Almanac is a self-hosted WhatsApp CRM: Meta delivers inbound messages to its webhook, which records customer conversations and dispatches automation, flow and AI behavior; staff then work shared inboxes, contacts and deals, or initiate template broadcasts. The Next.js app exposes dashboard workflows and APIs, with Supabase providing persistence, auth and realtime. Major capabilities not sampled are represented from the README; their precise internal wiring is therefore not asserted. Source excerpts support the webhook dispatch and selected engine/helper relationships.
Main entry points: route.ts Inbound webhook · (dashboard) CRM dashboard · server.ts Supabase data services · engine.ts Automation engine
Components 24
CRM experience
- CRM dashboard
src/app/(dashboard) - Shared inbox
src/app/(dashboard)/inbox/page.tsx - Contact management
src/app/(dashboard)/contacts/page.tsx - Sales pipelines
src/app/(dashboard)/pipelines/page.tsx - Broadcast workflow
src/app/(dashboard)/broadcasts - REST API
src/app/api/v1 - MCP tools
mcp-server/src/tools
WhatsApp messaging
- Inbound webhook
src/app/api/whatsapp/webhook/route.ts - WhatsApp send
src/lib/whatsapp/send-message.ts - Meta API client
src/lib/whatsapp/meta-api.ts - Template management
src/components/settings/template-manager.tsx - Broadcast delivery
src/app/api/whatsapp/broadcast/route.ts
Conversation automation
- Automation engine
src/lib/automations/engine.ts - Chatbot flow engine
src/lib/flows/engine.ts - AI replies
src/lib/ai/auto-reply.ts - Signed webhooks
src/lib/webhooks/deliver.ts
Account platform
- Account authorization
src/lib/auth/account.ts - Browser auth state
src/hooks/use-auth.tsx - Supabase data services
src/lib/supabase/server.ts - Token encryption
src/lib/whatsapp/encryption.ts
External integrations
- WhatsApp Business Platform
- OpenAI / Anthropic
Other components
- Business staff
- AI / API clients
Connections 27
- Business staff → CRM dashboard: uses
README.md - CRM dashboard → Shared inbox: opens
README.md - CRM dashboard → Contact management: manages
README.md - CRM dashboard → Sales pipelines: tracks deals
README.md - CRM dashboard → Broadcast workflow: creates sends
README.md - AI / API clients → REST API: calls
README.md - AI / API clients → MCP tools: uses
README.md - WhatsApp Business Platform → Inbound webhook: delivers events
README.md - Inbound webhook → Automation engine: dispatches triggers
src/app/api/whatsapp/webhook/route.ts - Inbound webhook → Chatbot flow engine: dispatches messages
src/lib/flows/engine.ts - Inbound webhook → AI replies: invokes replies
src/app/api/whatsapp/webhook/route.ts - Inbound webhook → Signed webhooks: dispatches events
src/app/api/whatsapp/webhook/route.ts - Automation engine → WhatsApp send: sends messages
src/lib/automations/engine.ts - Chatbot flow engine → WhatsApp send: sends messages
src/lib/flows/engine.ts - Automation engine → Supabase data services: reads and writes
src/lib/automations/engine.ts - Chatbot flow engine → Supabase data services: reads and writes
src/lib/flows/engine.ts - WhatsApp send → Meta API client: uses client
- Meta API client → WhatsApp Business Platform: calls API
README.md - Broadcast workflow → Broadcast delivery: submits campaign
README.md - Broadcast delivery → Meta API client: sends templates
src/app/api/whatsapp/broadcast/route.ts - Template management → WhatsApp Business Platform: manages approved templates
README.md - AI replies → OpenAI / Anthropic: requests generation
README.md - Account authorization → Supabase data services: loads account
src/lib/auth/account.ts - Browser auth state → Supabase data services: authenticates
src/hooks/use-auth.tsx - Inbound webhook → Token encryption: decrypts tokens
src/app/api/whatsapp/webhook/route.ts - REST API → Account authorization: authorizes requests
- MCP tools → REST API: accesses CRM