A self-hosted service for managing Telegram accounts, message templates, and scheduling broadcasts through a convenient web dashboard.
- Multi-Account Management: Manage multiple Telegram accounts
- Message Templates: Create reusable message templates with variables
- Channel Management: Organize target channels, groups, and users
- Smart Scheduling: Cron-based scheduling with timezone support
- Job Queue: Background job processing with retry logic
- Real-time Logs: Monitor all message deliveries and errors
- Web Dashboard: Modern Next.js UI with TailwindCSS
- Self-Hosted: Complete Docker setup, no external SaaS dependencies
┌─────────────────────────────────────────┐
│ Web UI (Next.js + TypeScript) │
│ • Admin Dashboard │
│ • CRUD: Accounts, Templates, Schedules │
└──────────────┬──────────────────────────┘
│ REST API
▼
┌─────────────────────────────────────────┐
│ Go Backend │
│ • Telegram Session Manager │
│ • Job Scheduler (cron) │
│ • Message Dispatcher │
│ • Rate Limiter │
└──────────────┬──────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ Infrastructure │
│ • PostgreSQL - Database │
│ • Redis - Queue & Cache │
└─────────────────────────────────────────┘
- Docker & Docker Compose
- Telegram API credentials (get from https://my.telegram.org)
-
Clone the repository
git clone https://github.com/GezzyDax/Timelith.git cd Timelith -
Configure environment
cp .env.example .env # Edit .env and fill in your Telegram API credentials -
Start the services
docker compose up -d
-
Access the dashboard
- Web UI: http://localhost:3000
- Backend API: http://localhost:8080
-
Create admin user First, you need to create an admin user. You can do this by sending a POST request to the backend:
curl -X POST http://localhost:8080/api/auth/register \ -H "Content-Type: application/json" \ -d '{"username":"admin","password":"your_password"}'
| Service | Port | Description |
|---|---|---|
| Web UI | 3000 | Next.js dashboard |
| Go Backend | 8080 | REST API & Scheduler |
| PostgreSQL | 5432 | Database |
| Redis | 6379 | Queue & Cache |
| Variable | Required | Description |
|---|---|---|
POSTGRES_PASSWORD |
Yes | PostgreSQL password |
TELEGRAM_APP_ID |
Yes | Telegram API ID |
TELEGRAM_APP_HASH |
Yes | Telegram API Hash |
JWT_SECRET |
Yes | JWT signing secret |
ENCRYPTION_KEY |
Yes | 32-byte key for session encryption |
ENVIRONMENT |
No | production or development |
NEXT_PUBLIC_API_URL |
No | Backend API URL |
- Go to https://my.telegram.org
- Log in with your phone number
- Go to "API development tools"
- Create a new application
- Copy your
api_idandapi_hash
- Go to Accounts page
- Click "Add Account"
- Enter phone number (with country code, e.g., +1234567890)
- You'll receive a code via Telegram
- Enter the code to complete authentication
- Go to Templates page
- Click "Add Template"
- Enter template name and message content
- Save the template
- Go to Schedules page
- Click "Add Schedule"
- Select account, template, and target channel
- Set cron expression (e.g.,
0 9 * * *for daily at 9 AM) - Choose timezone
- Save the schedule
| Expression | Description |
|---|---|
0 9 * * * |
Daily at 9:00 AM |
0 */2 * * * |
Every 2 hours |
0 9 * * 1 |
Every Monday at 9:00 AM |
0 9,18 * * * |
Daily at 9:00 AM and 6:00 PM |
We provide convenient scripts and Makefile commands for solo developers:
# First time setup
git clone https://github.com/GezzyDax/Timelith.git
cd Timelith
# Install all dependencies (Go + npm)
make install
# Setup git hooks for automatic pre-commit checks
make setup-hooks
# Show all available commands
make help
# Quick start infrastructure (PostgreSQL, Redis)
make quick-start
# Before committing - run all checks (lint, test, build)
make pre-commit
# Run all tests
make test-allLocated in scripts/ directory:
| Script | Description |
|---|---|
quick-start.sh |
Start infrastructure services |
pre-commit.sh |
Run pre-commit checks (lint, test, build) |
test-all.sh |
Run comprehensive test suite |
clean-all.sh |
Clean build artifacts and caches |
bump-version.sh |
Manually bump semantic version |
setup-git-hooks.sh |
Install git hooks for automatic checks |
Setup:
make install # Install all dependencies (Go + npm)
make update # Update all dependencies
make setup-hooks # Install git pre-commit hooksDevelopment:
make quick-start # Start PostgreSQL & Redis
make pre-commit # Pre-commit checks (lint, test, build)
make test-all # All tests
make clean # Clean artifactsBackend (Go):
make backend-build # Build binary
make backend-test # Run tests
make backend-lint # Run linter
make backend-run # Run locally
make backend-fmt # Format codeFrontend (Next.js):
make web-install # Install dependencies
make web-dev # Dev server
make web-build # Production build
make web-lint # Run ESLint
make web-type-check # TypeScript checkDocker:
make build # Build images
make up # Start services
make down # Stop services
make logs # View logs
make restart # Restart allBackend:
cd go-backend
cp .env.example .env
go mod download
go run cmd/server/main.goFrontend:
cd web-ui
npm install
npm run devOur automated CI/CD includes:
-
Continuous Integration: Runs on every push and PR
- Go: linting, testing, building
- TypeScript: linting, type checking, building
- Docker: image builds with caching
- Integration tests
-
Pull Request Checks: Additional PR-specific validation
- Security scanning with Trivy
- Dependency vulnerability checks
- Commit message validation
- PR statistics
-
Automatic Versioning: On main branch pushes
- Semantic versioning (major.minor.patch)
- Automatic changelog generation
- GitHub releases
- Docker image tagging
Version Bump Convention:
feat:orfeature:commits → minor version bumpBREAKING CHANGE:ormajor:→ major version bump- Other commits → patch version bump
# Interactive version bump
make bump-version
# Or use the script directly
./scripts/bump-version.sh- All Telegram sessions are encrypted with AES-256 before storage
- JWT authentication for web dashboard
- API key support for external integrations
- No plaintext credentials in database
- All services run in isolated Docker network
- View job execution logs in Logs page
- Check system status in Dashboard
- Monitor active schedules and their next run times
- Track account statuses and last login times
- Check if PostgreSQL is running:
docker compose ps - Verify environment variables in
.env - Check logs:
docker compose logs go-backend
- Verify
TELEGRAM_APP_IDandTELEGRAM_APP_HASH - Ensure phone number format includes country code
- Check if you're receiving the code in Telegram
- Check account status in Accounts page
- Verify schedule is active
- Check Logs for error messages
- Ensure rate limits aren't exceeded
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
This tool is for legitimate use only. Ensure you comply with Telegram's Terms of Service and local laws. The authors are not responsible for misuse of this software.
Built with:
- Go - Backend
- Next.js - Frontend
- gotd/td - Telegram client
- Fiber - Web framework
- PostgreSQL - Database
- Redis - Queue & Cache
For issues and questions, please use the GitHub Issues page.