Telegram • Spring Boot • PostgreSQL • Docker • REST API • LLM Integration
Telegram AI SaaS Bot is a backend application that provides an AI-powered assistant inside Telegram.
The project demonstrates a production-style backend architecture using Spring Boot, PostgreSQL, Flyway, Docker and REST principles.
The bot integrates with Large Language Models (LLM), stores user conversations, tracks token usage and supports multiple subscription plans.
This project is being actively developed as a portfolio and commercial SaaS application.
- 🤖 AI chat inside Telegram
- 💬 Conversation history
- 🧠 LLM API integration
- 📊 Token usage tracking
- 👤 User registration
- 💳 Subscription plans
- 🛡 Admin commands
- 🗄 PostgreSQL persistence
- 🔄 Flyway database migrations
- 🐳 Docker support
Telegram User
│
▼
Telegram Bot API
│
▼
Spring Boot Backend
│
┌────────────────┼────────────────┐
▼ ▼ ▼
PostgreSQL LLM API Service Token Tracking
│
▼
Conversation History
- Java 21
- Spring Boot 3
- Spring Data JPA
- Hibernate
- REST API
- Maven
- Lombok
- PostgreSQL
- Flyway
- Docker
- Large Language Model API Integration
src
└── main
├── config
├── controller
├── dto
├── entity
├── repository
├── service
├── telegram
├── util
└── exception
| Feature | Status |
|---|---|
| Telegram Bot | ✅ |
| AI Responses | ✅ |
| User Registration | ✅ |
| Chat History | ✅ |
| Token Tracking | ✅ |
| Subscription Plans | ✅ |
| PostgreSQL Storage | ✅ |
| Admin Commands | ✅ |
| Docker Support | ✅ |
- Payment integration
- Multiple AI providers
- Web Dashboard
- User analytics
- Rate limiting
- Monitoring
- Logging improvements
- Export conversations
- User profile management
Main entities:
- User
- ChatMessage
- TokenUsage
Database migrations are managed using Flyway.
- Java 21
- Maven
- Docker
- PostgreSQL
git clone https://github.com/Redstoun-VG/telegram-ai-saas.gitmvn clean installmvn spring-boot:runThe project was created to practice production backend development and build a scalable SaaS architecture for AI-powered Telegram assistants.
It focuses on:
- Clean Architecture
- Spring Boot
- REST API
- Database design
- Docker deployment
- AI integration
- SaaS architecture
🟡 Active Development
New functionality is continuously being added.
Redstoun-VG
GitHub:
https://github.com/Redstoun-VG
⭐ If you found this project interesting, feel free to leave a star.