A modular, scalable Telegram-based CRM system designed for small businesses, cafes, and service teams. This project automates customer communication analysis, provides live operational metrics, and visualizes business performance in real time via a modern dashboard.
- Collects and processes all incoming messages from Telegram chats.
- Supports groups, supergroups, and private chats.
- Automatically queues messages for processing and enrichment.
- Detects language and analyzes message sentiment using franc and sentiment libraries.
- Saves enriched message data into a PostgreSQL database using TypeORM.
- Displays live business KPIs and customer interaction metrics.
- Provides real-time WebSocket-powered updates for:
- SLA (% of timely replies)
- Messages per minute
- Customer sentiment distribution
- Built with Vite, Recharts, and React Query for efficient rendering.
- NestJS API service exposes:
- Swagger-based REST API for users and messages.
- WebSocket gateway streaming real-time metrics.
- Validation & OpenAPI auto-generation.
- Worker service processes message queues (BullMQ) and stores enriched data.
- Infrastructure module ready for future scaling with database migrations, Redis, and monitoring.
- TypeScript Monorepo (PnPM Workspace)
- NestJS, BullMQ, TypeORM, ioredis, PostgreSQL
- Telegraf (Telegram Bot Framework)
- React 19, Chakra UI, Recharts
- Jest, ESLint, Prettier for code quality
- Vite for frontend development
- Docker/Helm deployment-ready structure (planned)
- Add multi-tenant support for multiple cafes or businesses.
- Introduce role-based access controls for team management.
- Support additional communication channels (WhatsApp, Viber, etc.).
- Implement NLP-powered intent recognition.
- Add customer engagement scoring.
- Enhance SLA tracking with customizable alerting thresholds.
- Replace fake metrics with real ones from the database and message processing pipeline.
- Integrate external monitoring tools like Prometheus, Grafana, and alerts to Discord or Telegram admin channels.
- Add automatic workflows for follow-up messages or task assignment.
- Full Helm charts for Kubernetes deployment.
- Integrate Prometheus metrics (
/metrics) into the NestJS services. - Real-time alerts via Discord, Telegram, or other channels (Slack optional).
- Telegram bot with queue-based message processing.
- Worker service: language detection, sentiment analysis, PostgreSQL storage.
- Live React dashboard for key KPIs.
- NestJS API with Swagger documentation and basic user/message routes.
- Local development with PostgreSQL and Redis.
- Replace dummy metrics in WebSocket gateway with real business metrics.
- Add full Prometheus + Grafana + Alertmanager stack.
- Implement advanced user management and authentication.
- Production-ready Docker Compose & Helm charts.
/api - NestJS REST API & WebSocket Gateway
/bot - Telegram bot (Telegraf + Fastify)
/worker - BullMQ worker + sentiment/language analysis
/dashboard - React dashboard for real-time metrics
/infra - Infrastructure module (for future use)