A fully automated system that monitors your YouTube videos 24/7 and replies to comments based on keywords with human-like behavior.
Live at: tryreply.app
- Monitors your YouTube channel videos automatically
- Filters comments by custom keywords (e.g., "MCP", "help", "tutorial")
- Replies automatically with customizable templates
- Prevents duplicate replies with sub-millisecond database checks
- Uses human-like delays to avoid YouTube ban
- Tracks quota usage (10,000 units/day limit)
- Provides analytics dashboard with real-time system health
+------------------+
| Next.js | Frontend (Vercel)
| Frontend | - Video management
| (Vercel) | - Settings UI
+--------+---------+ - Analytics
|
| HTTPS/REST
v
+------------------+
| FastAPI | Backend (AWS EC2)
| Backend | - OAuth authentication
| (Docker) | - YouTube API integration
+--------+---------+ - Auto-reply engine
|
+----+----+----------+----------+
| | | |
v v v v
+--------+ +------+ +--------+ +---------+
| RDS | |Redis | |YouTube | | Celery |
|Postgres| |(Docker)| | API | | Worker |
+--------+ +------+ +--------+ +---------+
| Service | Spec | Cost/Month |
|---|---|---|
| AWS EC2 | t3.small (Ubuntu) | ~$15 |
| AWS RDS | PostgreSQL db.t3.micro | ~$13 |
| Elastic IP | 1 (attached) | FREE |
| Vercel | Hobby tier | FREE |
| TOTAL | ~$28/month |
git clone https://github.com/farizanjum/reply.git
cd reply-commentscd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Set up environment
cp .env.example .env
# Edit .env with your credentials
# Run locally
uvicorn main:app --reload# SSH into your EC2 instance
ssh -i your-key.pem ubuntu@your-ec2-ip
# Clone and deploy
git clone https://github.com/farizanjum/reply.git app
cd app
# Configure environment
cp backend/.env.example backend/.env.prod
# Edit .env.prod with production credentials
# Deploy with Docker Compose
sudo docker-compose -f docker-compose.prod.yml up -dcd frontend
npm install
npm run devDeploy to Vercel by connecting your GitHub repository.
- Google OAuth authentication
- YouTube API integration
- Video synchronization
- Keyword-based filtering
- Auto-reply engine
- Duplicate prevention (< 1ms lookup)
- Human-like delays
- Text variation
- Quota management
- Analytics dashboard
- Real-time system health monitoring
- Notification preferences (email alerts)
-
Random Delays
- Before reply: 0.8-3.5 seconds
- After reply: 1.0-2.5 seconds
- Between batches: 2-5 minutes
-
Batch Processing
- Random batch size: 8-15 comments
- Randomized intervals
-
Reply Variation
- Random greetings
- Random closings
- Template selection
-
Gradual Ramp-up
- Week 1: 10 replies/day
- Week 2: 25 replies/day
- Week 3: 50 replies/day
- Week 4: 100 replies/day
- Week 5+: 180 replies/day
Each video can be configured with:
{
"auto_reply_enabled": true,
"keywords": ["MCP", "help", "tutorial"],
"reply_templates": [
"Hey {name}! Check out this resource: {link}",
"Thanks for watching! Here's what you need: {link}"
],
"schedule_type": "hourly"
}Backend:
DATABASE_URL- PostgreSQL connection (AWS RDS)REDIS_URL- Redis connectionGOOGLE_CLIENT_ID- OAuth client IDGOOGLE_CLIENT_SECRET- OAuth secretYOUTUBE_API_KEY- YouTube API keySECRET_KEY- JWT secretFRONTEND_URL- Frontend URL (https://tryreply.app)REDIRECT_URI- OAuth redirect
Frontend:
DATABASE_URL- Prisma database URLNEXT_PUBLIC_BACKEND_URL- Backend API URLBETTER_AUTH_SECRET- Auth secretGOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRET- OAuth credentials
- Duplicate Check: < 1ms per lookup
- Batch Check: 2-5ms for 100 comments
- Reply Speed: 100 comments in ~3 minutes
- Daily Capacity: 150-180 replies/day (within quota)
- Uptime: 99.9% (AWS SLA)
reply-comments/
├── backend/ # FastAPI backend
│ ├── main.py # App entry point
│ ├── config.py # Configuration
│ ├── database_pg.py # PostgreSQL functions
│ ├── routers/ # API routes
│ ├── services/ # Business logic
│ ├── middleware/ # Auth middleware
│ └── docker-compose.prod.yml
├── frontend/ # Next.js frontend
│ ├── src/app/ # App Router pages
│ ├── src/components/ # React components
│ └── src/lib/ # Utilities
└── README.md # This file
- OAuth 2.0 authentication
- JWT token-based sessions
- Environment variable secrets
- HTTPS only (Caddy reverse proxy)
- CORS protection
- SQL injection prevention (parameterized queries)
# SSH into EC2
ssh -i your-key.pem ubuntu@your-ec2-ip
# View all container logs
sudo docker-compose -f docker-compose.prod.yml logs --tail=100
# View specific service
sudo docker-compose -f docker-compose.prod.yml logs web --tail=50curl https://your-api-url/health
# Returns: {"status":"healthy","postgres":true,"redis":true}# Connect to RDS PostgreSQL
psql -h your-rds-endpoint -U postgres -d youtube_autoreply-
OAuth Error
- Verify redirect URI matches Google Console
- Check client ID and secret
-
Database Connection Error
- Verify DATABASE_URL in .env.prod
- Check RDS security group allows EC2 access
-
Quota Exhausted
- Check daily usage in analytics
- Wait for midnight PT reset
-
Container Not Starting
- Check logs:
docker-compose logs web - Verify environment variables
- Check logs:
1. AI Video Analysis
- Automatically analyze video content
- Smart link recommendations based on context
- Auto-insert relevant links in replies
2. Instagram DM Auto-Reply
- Automated responses to Instagram DMs
- Keyword-based filtering
- Template-based personalized replies
- Analytics and engagement tracking
3. One-Click Instagram Connect
- Seamless Instagram Business account connection
- Facebook OAuth integration
- Real-time DM webhook notifications
4. Google OAuth Verification
- Complete app verification for production
- Remove "unverified app" warning
| Phase | Features | Duration |
|---|---|---|
| Phase 1 | AI Video Analysis | 3 weeks |
| Phase 2 | Instagram Connect | 2 weeks |
| Phase 3 | Instagram DM Auto-Reply | 2 weeks |
| Phase 4 | Testing & Polish | 1 week |
MIT License - see LICENSE file
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
Built with ❤️ for YouTube creators