GitHub Analyzer - bu GitHub repositoriyalarini tahlil qilish va AI yordamida dasturchilar faoliyatini baholash uchun mo'ljallangan to'liq ishlaydigan loyiha.
- AI-Powered Analysis: Leverage multiple AI providers (OpenAI, Anthropic, Google) for intelligent code analysis
- Repository Insights: Deep analysis of commit patterns, code quality, and development trends
- Multi-Format Reports: Generate reports in JSON, PDF, and Excel formats
- Real-time Processing: Asynchronous task processing with Celery
- Scalable Architecture: Microservices-based design with Docker containerization
- Comprehensive Monitoring: Built-in monitoring with Prometheus and Grafana
- Security First: Production-ready security configurations and best practices
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Frontend β β Backend β β AI Services β
β (Next.js) βββββΊβ (Django) βββββΊβ (OpenAI, etc) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Nginx β β PostgreSQL β β Redis β
β (Load Balancer)β β (Database) β β (Cache) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Traefik β β Celery β β Monitoring β
β (Reverse Proxy) β β (Task Queue) β β (Prometheus) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
- Docker and Docker Compose
- Node.js 18+ (for local development)
- Python 3.11+ (for local development)
- Git
git clone https://github.com/your-username/github-analyzer.git
cd github-analyzer# Copy environment template
cp backend/.env.example backend/.env
# Edit the .env file with your configuration
nano backend/.env# Make setup script executable
chmod +x scripts/setup.sh
# Run full setup (installs dependencies and sets up environment)
./scripts/setup.sh --full# Start all services
docker-compose up -d
# View logs
docker-compose logs -f- Frontend: http://localhost:3000
- Backend API: http://localhost:8000/api/
- Admin Panel: http://localhost:8000/admin/ (admin/admin123)
- API Documentation: http://localhost:8000/api/docs/
Key environment variables to configure:
# Django Settings
SECRET_KEY=your-secret-key-here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/github_analyzer
# Redis
REDIS_URL=redis://localhost:6379/0
# GitHub API
GITHUB_TOKEN=your-github-token
GITHUB_CLIENT_ID=your-client-id
GITHUB_CLIENT_SECRET=your-client-secret
# AI Providers
OPENAI_API_KEY=your-openai-key
ANTHROPIC_API_KEY=your-anthropic-key
GOOGLE_AI_API_KEY=your-google-key
# Email (for notifications)
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_HOST_USER=your-email@gmail.com
EMAIL_HOST_PASSWORD=your-app-passwordThe system supports multiple AI providers. Configure at least one:
- OpenAI: Set
OPENAI_API_KEY - Anthropic: Set
ANTHROPIC_API_KEY - Google AI: Set
GOOGLE_AI_API_KEY
# Via API
POST /api/analysis/tasks/
{
"repository_url": "https://github.com/owner/repo",
"analysis_type": "comprehensive",
"ai_provider": "openai"
}# Generate Excel report
POST /api/analysis/exports/
{
"analysis_id": "uuid-here",
"format": "excel",
"include_details": true
}# Check task status
GET /api/analysis/tasks/{task_id}/# Copy production environment
cp backend/.env.example backend/.env.prod
# Edit production configuration
nano backend/.env.prod
# Set production environment
export ENVIRONMENT=production# Generate SSL certificates (Let's Encrypt recommended)
certbot certonly --standalone -d yourdomain.com# Make deploy script executable
chmod +x scripts/deploy.sh
# Deploy to production
./scripts/deploy.sh deployAccess monitoring dashboards:
- Grafana: http://yourdomain.com:3001 (admin/admin)
- Prometheus: http://yourdomain.com:9090
The API uses JWT authentication:
# Login
POST /api/auth/login/
{
"username": "your-username",
"password": "your-password"
}
# Use token in subsequent requests
Authorization: Bearer <your-jwt-token>GET /api/repositories/- List repositoriesPOST /api/analysis/tasks/- Create analysis taskGET /api/analysis/results/- List analysis resultsPOST /api/analysis/exports/- Export analysisGET /api/statistics/- Get system statistics
# Backend tests
docker-compose exec backend python manage.py test
# Frontend tests
docker-compose exec frontend npm test
# Integration tests
docker-compose exec backend python manage.py test apps.analysis.tests.IntegrationTestCase# Install locust
pip install locust
# Run load tests
locust -f tests/load_test.py --host=http://localhost:8000# View application logs
docker-compose logs -f backend
# View all logs
docker-compose logs -f
# View specific service logs
docker-compose logs -f postgresKey metrics monitored:
- Request rate and response time
- Error rates (4xx, 5xx)
- Database performance
- Celery task queue status
- GitHub API rate limits
- System resources (CPU, memory, disk)
Configured alerts for:
- Service downtime
- High error rates
- Resource exhaustion
- Database issues
- Task queue backlog
- JWT authentication with refresh tokens
- Rate limiting on API endpoints
- CORS configuration
- Security headers (CSP, HSTS, etc.)
- Input validation and sanitization
- SQL injection protection
- XSS protection
- Environment Variables: Never commit secrets to version control
- HTTPS: Always use HTTPS in production
- Database: Use strong passwords and limit access
- API Keys: Rotate API keys regularly
- Updates: Keep dependencies updated
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow PEP 8 for Python code
- Use ESLint for JavaScript/TypeScript
- Write tests for new features
- Update documentation
- Follow conventional commit messages
This project is licensed under the MIT License - see the LICENSE file for details.
- Port conflicts: Change ports in docker-compose.yml
- Permission errors: Check file permissions and Docker group membership
- Memory issues: Increase Docker memory allocation
- API rate limits: Configure GitHub token with higher limits
- π Documentation
- π Issue Tracker
- π¬ Discussions
- Django and Django REST Framework
- Next.js and React
- OpenAI, Anthropic, and Google AI
- Docker and Docker Compose
- Prometheus and Grafana
- All open-source contributors