🤖

Telegram Bot Manager

Full-Stack AI-Powered Bot Management Platform

Full-Stack Architecture
AI Integration
Enterprise Security
Telegram Bot Manager UI showing a dashboard with multiple bots

Project Overview

The Telegram Bot Manager is a comprehensive full-stack application that enables users to register, configure, and manage multiple Telegram bots from a unified dashboard. Each bot can be powered by Groq's Llama 3.1 8B Instant AI model with optional keyword-driven fallback modes for specific tool invocations.

The system features a centralized MCP (Model Context Protocol) server that exposes all tool definitions over JSON-RPC, encrypted storage for sensitive bot tokens using AES-256-GCM, and a comprehensive admin panel for global moderation and user management.

Core Capabilities

  • • Multi-bot registration and management
  • • AI-driven conversations with tool orchestration
  • • Keyword-to-tool mapping for direct commands
  • • Real-time chat streaming and moderation
  • • Encrypted token storage and rotation

Technical Highlights

  • • Monorepo with shared TypeScript types
  • • Self-contained Node.js deployment
  • • Prometheus metrics and structured logging
  • • Email confirmation with SMTP fallback
  • • LRU caching for performance optimization

Key Features

Multi-Bot Management

Register and manage multiple Telegram bots from a single dashboard with encrypted token storage

AI Integration

Powered by Groq's Llama 3.1 8B Instant model for intelligent conversations and tool orchestration

MCP Server

Model Context Protocol server for exposing structured tools via JSON-RPC interface

Encrypted Storage

AES-256-GCM encryption for bot tokens and sensitive data at rest in Neon Postgres

Admin Moderation

Comprehensive admin panel for user management, bot oversight, and chat log moderation

Real-time Streaming

Server-sent events for streaming AI responses and live chat updates

Technology Stack

Frontend

⚛️Next.js

Backend

🟢Node.js
🚀Express

AI

🧠Groq AI

Integration

🔗MCP Protocol
📱Telegram API

Database

🐘Neon Postgres
🔷Prisma ORM

Security

🔐JWT Auth
🛡️AES-256-GCM

Observability

📝Pino Logging
📊Prometheus

System Architecture

Frontend

Next.js Dashboard
User Registration
Bot Management UI
Admin Panel
Real-time Chat

API Layer

Express Server
JWT Authentication
Rate Limiting
Webhook Handlers
Streaming Endpoints

Services

AI Service (Groq)
Telegram Service
Email Service
MCP Client
Cache Service

MCP Server

Tool Registry
JSON-RPC Handler
Database Tools
External API Tools
Custom JS Sandbox

Data Layer

Neon Postgres
Prisma ORM
Encrypted Storage
Chat Logs
Audit Trails

Implementation Highlights

Security & Encryption

  • AES-256-GCM encryption for bot tokens at rest
  • JWT-based authentication with HTTP-only cookies
  • Password strength validation using zxcvbn
  • Rate limiting and CORS protection

AI & Tool Integration

  • Groq Llama 3.1 8B Instant for AI responses
  • MCP server with JSON-RPC tool orchestration
  • Sandboxed JavaScript execution for custom tools
  • Keyword-driven fallback for direct commands

Development Philosophy

KISS Principles

Keep It Simple, Stupid - avoiding unnecessary infrastructure complexity while maintaining enterprise-grade security and scalability.

Self-Contained

Entirely runs within Node.js processes with no external dependencies beyond Groq API, Neon Postgres, and SMTP.

Developer Experience

Turborepo monorepo with shared TypeScript types, comprehensive testing, and seamless local-to-production deployment.

Interested in This Architecture?

This comprehensive project specification demonstrates my approach to full-stack architecture, security implementation, and AI integration. The complete technical documentation includes database schemas, API specifications, and deployment strategies.