aiecos-social-crm
# AIECOS Social CRM [](https://github.com/aiecosvietnam/aiecos-social-crm/actions/workflows/ci.yml) [](LICENSE) [](https://aiecosvietnam.github.io/aiecos-social-crm/) Open-source template to sync Pancake (Zalo OA / Facebook Messenger / Instagram) data into your own Supabase, with a built-in admin UI, MCP server for AI agents, and B2B partner classification. **π [Live demo](https://aiecosvietnam.github.io/aiecos-social-crm/)** Β· **π [Setup guide](SETUP.md)** Β· **π€ [MCP usage](docs/MCP_USAGE.md)** ## π¬ Demo https://github.com/aiecosvietnam/aiecos-social-crm/releases/download/v1.0.0/demo.mp4 <sub>11-second walkthrough β Dashboard Β· Inbox Β· Pipeline Β· Partner 360 Β· Performance. <br> Inline player auto-renders on GitHub.com. Fallback: **[direct download](https://github.com/aiecosvietnam/aiecos-social-crm/releases/download/v1.0.0/demo.mp4)**.</sub> --- **What it does:** - π₯ Chrome extension reads Pancake DOM β POST to your sync receiver - πΎ Sync receiver writes to Supabase schema (`pages`, `customers`, `conversations`, `messages`) - π₯ Standalone admin UI (single HTML file) reads from Supabase REST API - π€ MCP server lets Claude / any MCP client query data directly via natural language - π 5-stage partner classification: Active / Sleeping / At-Risk / Dormant / Churned - π Export CSV + printable HTML reports - π¬ Built-in Inbox (3-pane), Triage alerts, Pipeline kanban - π Demo mode β try the UI instantly without setting up Supabase **Stack:** Node.js + Express, Supabase (Postgres + PostgREST), Chrome Manifest V3, MCP SDK. --- ## Architecture ``` βββββββββββββββββββ POST ββββββββββββββββββββ upsert ββββββββββββββββ β Pancake DOM β ββββββββββΆ β Sync Receiver β βββββββββΆ β Supabase β β (Chrome ext) β β (Node + Express) β β aiecos_socialβ βββββββββββββββββββ ββββββββββββββββββββ ββββββββ¬ββββββββ β PostgREST ββββββββββββββββββββββββββββββββ βΌ ββββββββββββββββ ββββββββββββββββ β Admin UI β β MCP Server β β (HTML/JS) β β (for Claude) β ββββββββββββββββ ββββββββββββββββ ``` --- ## Screenshots **Admin UI β Dashboard** (live data from your own Supabase): - π KPI cards: Total partners / Active / At-Risk / Dormant+Churned / Total messages - π 14-day activity trend (Customer vs Agent split) - π¬ Recent messages stream **Pipeline Kanban** β 5 stages with auto-classification: ``` βββββββββββ ββββββββββββ βββββββββββ βββββββββββ βββββββββββ β ACTIVE β β SLEEPING β β AT-RISK β β DORMANT β β CHURNED β β β€ 3d β β 3-7d β β 7-30d β β 30-90d β β >90d β βββββββββββ ββββββββββββ βββββββββββ βββββββββββ βββββββββββ ``` **Triage** β Auto-alerts for partners going silent Β· **Partner 360** β Full table Β· **Performance** β Customer/Agent ratio + top partners β **[Try the live demo](https://aiecosvietnam.github.io/aiecos-social-crm/)** (connect to your Supabase via Settings) --- ## Folder structure ``` aiecos-social-crm/ βββ README.md βββ SETUP.md β Start here βββ LICENSE β MIT βββ docker-compose.yml β One-command dev stack βββ .env.example β Root env (for docker compose) βββ chrome-extension/ β AIECOS Pancake Connector (Manifest V3) βββ sync-receiver/ β Express server + Dockerfile + schema.sql βββ mcp-server/ β MCP server for Claude βββ admin-ui/ β Single-file HTML dashboard βββ examples/ β Curl scripts, seed data, MCP prompts βββ docs/ β βββ DEPLOY.md β Production deployment guide β βββ MCP_USAGE.md β MCP tool reference β βββ ARCHITECTURE.md β Internals βββ .github/workflows/ βββ ci.yml β Syntax + secret scan + docker build ``` --- ## Quick start (1 minute β Docker) ```bash # Boot the entire stack: Postgres + PostgREST + sync receiver + admin UI cp .env.example .env docker compose up -d # Inject demo data (5 partners across all stages) bash examples/seed-demo-data.sh # Open admin UI open http://localhost:8080 # β Settings β Supabase URL: http://localhost:3000 β Schema: aiecos_social β Save ``` Done. You can now see Active / Sleeping / At-Risk / Dormant / Churned partners in the kanban. ## Quick start (manual, step-by-step) ```bash # 1. Set up Supabase (cloud or self-host) + run schema.sql psql -f sync-receiver/schema.sql # 2. Start sync receiver cd sync-receiver cp .env.example .env # edit with your Supabase credentials npm install npm start # 3. Open admin UI in browser open admin-ui/index.html # β Click Settings β paste your Supabase URL + anon key # 4. Install Chrome extension # chrome://extensions/ β Load unpacked β select chrome-extension/ # 5. (Optional) Wire MCP server to Claude cd mcp-server && npm install # Add to ~/.claude.json mcpServers, then restart Claude Code ``` Full step-by-step instructions: **[SETUP.md](SETUP.md)** --- ## Why this template? Most CRMs lock you into their data silo. This template gives you: | Feature | Benefit | |---|---| | Own your data | Self-host Supabase, full Postgres access | | AI-ready | MCP server exposes data to Claude / any LLM | | Multi-channel | Facebook + Zalo OA + Instagram via single Pancake account | | Zero vendor lock | All code MIT, no proprietary deps | | B2B-aware | Partner classification (Active β Churned) out of the box | | Audit trail | Every message logged with timestamp + sender_type | --- ## Use cases - **B2B distributors**: Track shop partners, alert when they go silent - **D2C brands**: Multi-channel inbox aggregation - **Agencies**: White-label social CRM for clients - **AI assistants**: Feed conversation history to your AI agents --- ## Roadmap - [ ] Add HubSpot / Salesforce sync - [ ] Webhook out (Slack/Telegram alerts) - [ ] Tag/segment management UI - [ ] LLM-powered reply suggestions --- ## β Support development NαΊΏu template nΓ y giΓΊp Γch cho bαΊ‘n, α»§ng hα» mα»t ly cΓ phΓͺ Δα» mΓ¬nh tiαΊΏp tα»₯c build thΓͺm nhiα»u dα»± Γ‘n **mΓ£ nguα»n mα» thα»±c tαΊΏ** cho cα»ng Δα»ng dev Viα»t Nam. > *If this template saved you time, consider supporting future open-source work. 100% goes back into building more real-world templates (CRM, AI agents, integrations like KiotViet/MISA/HubSpot/Shopify, Vietnamese + English docs).* ### π»π³ MoMo Β· VietQR Β· Napas247 <p align="center"> <img src="https://github.com/aiecosvietnam/aiecos-social-crm/releases/download/v1.0.0/donate-momo.jpg" alt="MoMo / VietQR donate" width="320" /> </p> <p align="center"> <b>NGUYEN TAN HOANG</b><br> <code>PSG2614514200000011</code> Β· NH: MoMo<br> <sub>Scan with MoMo / any VietQR-compatible app (Vietcombank, Techcombank, MB, TPBank, β¦)</sub> </p> ### π Other ways to support | Action | Why it helps | |---|---| | β **Star this repo** | Boosts visibility β more devs find it β more contributors | | π **Open issues / PRs** | Real-world feedback shapes the roadmap | | π’ **Share with your network** | Especially if you work on Vietnam social-commerce | | πΌ **Hire AIECOS** for custom builds | [aiecos.ai](https://aiecos.ai) β AI Sale Agent / AI Customer Care / custom CRM | | π¦ **Tag us when shipping** | Twitter / LinkedIn β we'll amplify | **CαΊ£m Ζ‘n π** β every star, comment, donation keeps this momentum going. --- ## Credits Built by **[AIECOS](https://aiecos.ai)** β open-source AI infrastructure for Vietnamese businesses. Released under MIT. PRs welcome.