Skip to content

nickcomua/crm-chat

Repository files navigation

CRM Chat

An AI-powered application that aggregates conversations from Telegram (with potential future integrations to other messengers), stores them, and generates summaries for each contact. It highlights promises, plans, and recurring discussion topics, providing a personal CRM-like assistant.

How It Works

  1. Connect your Telegram account via phone number or QR code
  2. CRM Chat syncs your conversations and media in real-time
  3. Browse, search, and manage your contacts and chat history from the web interface

Architecture

Browser (React) ◄──WebSocket──► Convex (Database) ◄──Rust SDK──► Worker ◄──► Telegram
                                                                   │
                                                                Restate
                                                              (Workflows)
  • Frontend: React + Vite with real-time Convex subscriptions, Clerk auth, shadcn/ui
  • Backend: Self-hosted Convex for database, functions, and file storage
  • Worker: Rust service using grammers for Telegram integration
  • Restate: Durable workflow engine for reliable multi-step operations

See Architecture for detailed diagrams and data flow.

Quick Start

cp .env.example .env
# Fill in: TG_ID, TG_HASH, CLERK_M2M_SECRET_KEY, VITE_CLERK_PUBLISHABLE_KEY, CLERK_SECRET_KEY

docker compose up -d
docker compose exec backend ./generate_admin_key.sh
# Copy the key into .env as CONVEX_SELF_HOSTED_ADMIN_KEY

cd bins/convex-backend && bun install
CONVEX_SELF_HOSTED_URL=http://127.0.0.1:3210 \
CONVEX_SELF_HOSTED_ADMIN_KEY=<key-from-above> \
bun x convex deploy

Documentation

Guide Description
Getting Started What CRM Chat does, prerequisites, and first-time setup
Local Development Setup Full dev environment with Nix, step-by-step
Deployment Guide Docker production deployment, reverse proxy, monitoring
Architecture System design, data flow diagrams, database schema
Environment Variables Complete reference for all configuration

Project Structure

bins/
  convex-backend/    # Convex schema, queries, mutations
  crm-chat-web/      # React + Vite frontend
  crm-worker/        # Rust Telegram sync worker
libs/
  messanger-interface/  # Platform-agnostic messenger traits
  messanger-telegram/   # Telegram implementation (grammers)
  hack/                 # Shared utilities
  convex-typegen/       # Rust type generation from Convex schema
docs/                # Documentation
tests/
  e2e-telegram/      # End-to-end Telegram tests

Development

This project uses Nix for reproducible development environments and Jujutsu (jj) for version control.

# Enter dev environment
direnv allow    # or: nix develop

# Run checks
nix flake check

# Build
cargo build                              # Rust workspace
cd bins/crm-chat-web && bun x vite build # Frontend

About

An AI-powered application that aggregates conversations from Telegram (with potential future integrations to other messengers), stores them, and generates summaries for each contact. It highlights promises, plans, and recurring discussion topics, providing a personal CRM-like assistant.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors