Ek modern system jo GitHub repositories ko track, analyze aur manage karta hai. Automatic webhooks, code analysis aur distributed processing ke sath.
- GitHub se login karo aur apni repositories dekho
- Automatic webhook setup
- Repository clone aur analysis
- Real-time updates jab bhi code change ho
- Queue-based processing (no overload)
- Azure Blob me files store
- Scalable architecture (jitne chahiye utne workers)
User β Frontend β API β MongoDB (data save)
β
Redis Queue
β
Worker β Git Clone β Azure Storage
β
Analysis Complete!
Backend:
- Node.js + TypeScript
- Express (API)
- MongoDB (Database)
- BullMQ + Redis (Queue)
- GitHub OAuth
Worker:
- Background job processing
- Git operations
- Azure Blob Storage
Frontend:
- React + Vite
- Clean UI
git clone <your-repo-url>
cd kurserdocker-compose up -dmain/.env file:
MONGODB_URI=your_mongodb_atlas_url
GITHUB_CLIENT_ID=your_github_app_id
GITHUB_CLIENT_SECRET=your_github_app_secret
JWT_SECRET=random_secret_key
REDIS_HOST=redis
REDIS_PORT=6379worker/.env file:
REDIS_HOST=redis
REDIS_PORT=6379
MONGODB_URI=same_as_main
WORKER_CONCURRENCY=5- Frontend: http://localhost:3001
- API: http://localhost:3000
Sabse easy: Railway.app (free tier available) Best for Azure: App Service + Blob Storage
Complete guide: DEPLOYMENT.md
- Railway.app pe account banao
- GitHub repo connect karo
- 4 services add karo: Redis, Main, Worker, Frontend
- Environment variables set karo
- Deploy! β¨
URLs automatically mil jayengi:
- Example:
kurser-api.railway.app
Agar aap large repositories clone kar rahe ho, to Azure Blob Storage use karo:
# Storage account banao
az storage account create --name kurserdata --resource-group kurser-rg
# Connection string lo
az storage account show-connection-string --name kurserdataWorker .env me add karo:
AZURE_STORAGE_CONNECTION_STRING=your_connection_stringWebsite kahan milegi:
- Railway: Dashboard me automatic URL milti hai
- Azure:
https://your-app-name.azurewebsites.net - Vercel: Deploy karne pe URL milti hai
GitHub Webhook URL:
- Format:
https://your-api-url.com/webhook - Yeh URL GitHub repository settings me dalna hoga
kurser/
βββ main/ # Main API service
β βββ src/
β β βββ config/ # Configuration files
β β βββ controller/ # Route controllers
β β βββ middleware/ # Express middleware
β β βββ models/ # MongoDB models
β β βββ routes/ # API routes
β β βββ index.ts # Entry point
β βββ Dockerfile
β βββ package.json
β
βββ worker/ # Worker service
β βββ src/
β β βββ config/ # Queue & env config
β β βββ processors/ # Job processors
β β βββ workers/ # Worker definitions
β β βββ services/ # Git & Azure services
β β βββ index.ts # Entry point
β βββ Dockerfile
β βββ package.json
β
βββ frontend/ # React frontend
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Page components
β β βββ services/ # API services
β β βββ App.tsx # Main app
β βββ Dockerfile
β βββ package.json
β
βββ docker-compose.yml # Docker Compose config
βββ DEPLOYMENT.md # Deployment guide
βββ WORKER_SETUP.md # Worker setup guide
βββ README.md # This file
When GitHub sends a webhook:
- Main API receives and validates webhook
- Saves event to MongoDB
- Adds job to Redis queue
- Worker picks up and processes
- Updates event status
When repository is added:
- Job added to clone queue
- Worker clones repository to local storage
- Can checkout specific branches
- Triggers analysis job
Worker analyzes:
- Total file count
- File type distribution
- Lines of code
- Project type detection
- Latest commit information
| Repositories | Workers | Concurrency | Redis Memory |
|---|---|---|---|
| 0-100 | 1 | 5 | 256MB |
| 100-500 | 2-3 | 5 | 512MB |
| 500-2000 | 5-10 | 5-10 | 1-2GB |
| 2000+ | 10-20+ | 10 | 4GB+ |
For enterprise scale (2000+ repos):
# Add to worker/.env
AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=https;...Benefits:
- 20,000 messages/sec throughput
- 7-day message retention
- 99.9% SLA
- Geo-redundancy
# Check Redis
docker-compose ps redis
docker exec -it kurser-redis redis-cli ping
# Check queue has jobs
docker exec -it kurser-redis redis-cli KEYS bull:*
# Restart worker
docker-compose restart worker- Verify
PUBLIC_URLis set - Check GitHub webhook settings
- Ensure URL is publicly accessible
- Check webhook delivery in GitHub
# Reduce concurrency
WORKER_CONCURRENCY=3 docker-compose up -d
# Or add more workers
docker-compose up -d --scale worker=5- Fork the repository
- Create feature branch (
git checkout -b feature/amazing) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing) - Open Pull Request
- Use Redis persistence for job recovery
- Scale workers horizontally instead of increasing concurrency too high
- Monitor queue depth and scale proactively
- Clean up old cloned repos regularly
- Use Azure Queues for very high throughput
- JWT tokens for authentication
- GitHub OAuth for secure login
- Environment variables for secrets
- CORS configured for frontend
- Rate limiting (recommended to add)
ISC
- Documentation: See
/docsfolder - Issues: GitHub Issues
- Discussions: GitHub Discussions
- Bull Board dashboard integration
- Prometheus metrics
- Advanced code analysis (complexity, dependencies)
- Slack/Discord notifications
- Multi-tenant support
- GraphQL API
- Real-time updates via WebSocket
- BullMQ for reliable queue processing
- simple-git for Git operations
- GitHub API for repository data
- Railway/Nixpacks for easy deployment
Made with β€οΈ for scalable GitHub repository management