Some checks failed
Deploy / deploy (push) Has been cancelled
Full-stack web application for Telegram management - Frontend: Vue 3 + Vben Admin - Backend: NestJS - Features: User management, group broadcast, statistics 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
4.9 KiB
4.9 KiB
Quick Start Guide
Get started with the Telegram Marketing Agent System in 5 minutes.
Prerequisites
- Docker and Docker Compose installed
- Node.js 18+ (for local development)
- MongoDB and Redis (or use Docker)
- Telegram account with API credentials
Installation
Option 1: Docker Compose (Recommended)
- Clone the repository:
git clone https://github.com/yourusername/telegram-marketing-agent.git
cd telegram-marketing-agent
- Create environment file:
cp .env.example .env
- Update
.envwith your configurations:
# Telegram API
TELEGRAM_API_ID=your_api_id
TELEGRAM_API_HASH=your_api_hash
# Claude API (optional)
CLAUDE_API_KEY=your_claude_key
# Database
MONGODB_URI=mongodb://mongodb:27017/marketing_agent
REDIS_URL=redis://redis:6379
# Security
JWT_SECRET=your-secret-key-change-this
- Start all services:
docker-compose up -d
- Access the application:
- Frontend: http://localhost:8080
- API Gateway: http://localhost:3000
- API Docs: http://localhost:3000/api-docs
Option 2: Local Development
- Install dependencies for each service:
# API Gateway
cd services/api-gateway
npm install
# Orchestrator
cd ../orchestrator
npm install
# Continue for all services...
- Start MongoDB and Redis:
# Using Docker
docker run -d -p 27017:27017 --name mongodb mongo
docker run -d -p 6379:6379 --name redis redis
- Start services:
# In separate terminals
cd services/api-gateway && npm start
cd services/orchestrator && npm start
cd services/gramjs-adapter && npm start
# Continue for all services...
- Start frontend:
cd frontend
npm install
npm run dev
First Steps
1. Login
Default credentials:
- Username:
admin - Password:
password123
2. Connect Telegram Account
- Go to Settings → Accounts
- Click Add Account
- Enter your phone number
- Follow the verification process
3. Import Users
- Go to Users → Import
- Download the sample CSV template
- Fill in user data
- Upload and import
4. Create Your First Campaign
- Go to Campaigns → Create New
- Fill in campaign details:
- Name: "Welcome Campaign"
- Type: "Message"
- Target: Select imported users
- Create message:
- Use template or write custom
- Add personalization tags
- Review and save as draft
5. Test Campaign
- Select a small test group
- Click Test Campaign
- Review test results
- Make adjustments if needed
6. Execute Campaign
- Click Execute Campaign
- Monitor real-time progress
- View analytics dashboard
Common Tasks
Creating User Segments
// API Example
POST /api/v1/segments
{
"name": "Active Users",
"criteria": [{
"field": "engagement.lastActivity",
"operator": "greater_than",
"value": "7d"
}]
}
Scheduling Recurring Campaigns
- Create campaign
- Go to Schedules → Create Schedule
- Select campaign and set recurrence:
- Daily at 10 AM
- Weekly on Mondays
- Monthly on 1st
Setting Up Webhooks
// API Example
POST /api/v1/webhooks
{
"name": "Campaign Events",
"url": "https://your-server.com/webhooks",
"events": ["campaign.completed", "campaign.failed"]
}
Troubleshooting
Cannot Connect to Telegram
- Check API credentials in
.env - Ensure phone number format:
+1234567890 - Check firewall/proxy settings
- View logs:
docker-compose logs gramjs-adapter
Campaign Not Sending
- Check account connection status
- Verify rate limits aren't exceeded
- Check user permissions
- Review compliance settings
Performance Issues
- Check Redis connection
- Monitor resource usage
- Adjust rate limiting settings
- Scale services if needed
Best Practices
- Test First: Always test campaigns on small groups
- Rate Limiting: Respect Telegram's rate limits
- Personalization: Use tags for better engagement
- Timing: Schedule during user's active hours
- Compliance: Follow local regulations
- Monitoring: Set up alerts for failures
Next Steps
Support
- GitHub Issues: Report bugs
- Documentation: Full docs
- Community: Join Discord
Quick API Reference
Authentication
curl -X POST http://localhost:3000/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"username": "admin", "password": "password123"}'
List Campaigns
curl -X GET http://localhost:3000/api/v1/campaigns \
-H "Authorization: Bearer <token>"
Execute Campaign
curl -X POST http://localhost:3000/api/v1/campaigns/<id>/execute \
-H "Authorization: Bearer <token>"
For more examples, visit the API Examples page.