A comprehensive platform for tracking, analyzing, and ranking GitHub contributors. This tool provides detailed insights into developer activity, repository statistics, and community engagement metrics.
- Comprehensive GitHub profile analysis
- Contribution history and patterns
- Repository statistics and insights
- Programming language distribution
- Activity timeline and trends
- Global and location-based rankings
- Multiple ranking categories (commits, repos, followers, etc.)
- Time-based leaderboards (daily, weekly, monthly, yearly)
- Language-specific leaderboards
- Custom filtering and sorting
- Contribution trends over time
- Repository performance metrics
- Developer activity patterns
- Collaboration network analysis
- Growth and engagement statistics
- Live data synchronization with GitHub API
- Real-time leaderboard updates
- Instant profile refresh capabilities
- WebSocket-based notifications
- Caching for optimal performance
github-analytics-tool/
โโโ backend/ # Node.js + Express API
โ โโโ src/
โ โ โโโ config/ # Database and API configurations
โ โ โโโ controllers/ # Route controllers
โ โ โโโ middleware/ # Authentication, validation, error handling
โ โ โโโ models/ # MongoDB schemas
โ โ โโโ routes/ # API endpoints
โ โ โโโ services/ # Business logic and GitHub API integration
โ โ โโโ utils/ # Helper functions and utilities
โ โ โโโ index.js # Application entry point
โ โโโ tests/ # Backend tests
โ โโโ package.json
โโโ frontend/ # React + TypeScript frontend
โ โโโ src/
โ โ โโโ components/ # React components
โ โ โโโ pages/ # Application pages
โ โ โโโ hooks/ # Custom React hooks
โ โ โโโ services/ # API client services
โ โ โโโ utils/ # Frontend utilities
โ โ โโโ types/ # TypeScript type definitions
โ โโโ package.json
โโโ docs/ # Documentation
โโโ docker-compose.yml # Docker orchestration
โโโ README.md # This file
โโโ package.json # Root package configuration
- Node.js (v16 or higher)
- MongoDB (local installation or MongoDB Atlas)
- GitHub Personal Access Token
git clone https://github.com/waleedcodes/Commity.git
cd Commity
npm run install:all
# Copy environment template
cp backend/.env.example backend/.env
# Edit the environment file
nano backend/.env
Required Environment Variables:
NODE_ENV=development
PORT=3000
MONGODB_URI=mongodb://localhost:27017/github-analytics
GITHUB_TOKEN=your_github_personal_access_token_here
JWT_SECRET=your_secure_jwt_secret_here
FRONTEND_URL=http://localhost:3000
- Go to GitHub Settings โ Developer settings โ Personal access tokens
- Generate new token with scopes:
- โ
read:user
(access user profile data) - โ
read:org
(access organization data) - โ
repo
(optional, for private repository data)
- โ
- Add token to your
.env
file
Option A: Local MongoDB
# Install MongoDB locally
brew install mongodb/brew/mongodb-community # macOS
# or follow MongoDB installation guide for your OS
# Start MongoDB
brew services start mongodb/brew/mongodb-community
Option B: MongoDB Atlas (Recommended)
- Create account at MongoDB Atlas
- Create new cluster
- Get connection string
- Update
MONGODB_URI
in.env
# Start backend server
npm run dev
# In another terminal, start frontend (when ready)
npm run dev:frontend
The API will be available at http://localhost:3000/api
# Build and start all services
npm run docker:up
# View logs
npm run docker:logs
# Stop services
npm run docker:down
# Build backend
cd backend
docker build -t github-analytics-backend .
# Run with environment variables
docker run -p 3000:3000 --env-file .env github-analytics-backend
http://localhost:3000/api
- Public Endpoints: No authentication required
- Protected Endpoints: Bearer token in Authorization header
- Rate Limiting: 100 requests/hour for public, 500+ for authenticated
GET /api/users # List all users
GET /api/users/:username # Get user profile
PUT /api/users/:username # Update user profile
GET /api/users/:username/repos # Get user repositories
GET /api/users/:username/activity # Get user activity
POST /api/users/:username/refresh # Refresh user data
GET /api/leaderboard # Global leaderboard
GET /api/leaderboard/stats # Leaderboard statistics
GET /api/leaderboard/location/:location # Location-based leaderboard
GET /api/leaderboard/language/:language # Language-based leaderboard
GET /api/analytics # Global analytics
GET /api/analytics/user/:username # User-specific analytics
GET /api/analytics/trends # Contribution trends
GET /api/analytics/compare # Compare multiple users
GET /api/users/search?q=query # Search users
Success Response:
{
"success": true,
"data": { ... },
"pagination": {
"currentPage": 1,
"totalPages": 10,
"totalItems": 100,
"hasNextPage": true
},
"timestamp": "2023-12-01T10:00:00.000Z"
}
Error Response:
{
"success": false,
"error": {
"type": "ValidationError",
"message": "Invalid input parameters",
"details": { ... }
},
"timestamp": "2023-12-01T10:00:00.000Z"
}
cd backend
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverage
cd frontend
# Run frontend tests
npm test
# Run tests with coverage
npm run test:coverage
cd backend
# Start development server with auto-reload
npm run dev
# Run linting
npm run lint
# Format code
npm run format
# Validate code quality
npm run validate
- ESLint: Airbnb JavaScript style guide
- Prettier: Consistent code formatting
- Jest: Unit and integration testing
- Husky: Pre-commit hooks for quality gates
- Framework: Express.js with middleware pipeline
- Database: MongoDB with Mongoose ODM
- Authentication: JWT-based stateless authentication
- Caching: In-memory caching with node-cache
- API Integration: GitHub REST API v4 and GraphQL v4
- MVC Pattern: Separation of concerns
- Service Layer: Business logic abstraction
- Repository Pattern: Data access abstraction
- Middleware Pipeline: Request/response processing
- Error Handling: Centralized error management
- Caching Strategy: Multi-level caching system
- Rate Limiting: API protection and quota management
- Database Indexing: Optimized query performance
- Compression: Gzip response compression
- Connection Pooling: Efficient database connections
- Input Validation: Joi schema validation
- SQL Injection Protection: Mongoose ODM
- XSS Protection: Helmet security headers
- CORS: Cross-origin resource sharing configuration
- Rate Limiting: Request throttling and abuse prevention
- Authentication: Secure JWT implementation
- Error Handling: Secure error message sanitization
Development
NODE_ENV=development
Production
NODE_ENV=production
# Additional production configurations...
- Set production environment variables
- Configure production MongoDB URI
- Set secure JWT secrets
- Enable file logging
- Configure reverse proxy (Nginx)
- Set up SSL/TLS certificates
- Configure monitoring and alerting
- Set up backup strategies
- Configure CI/CD pipeline
- Winston: Structured logging
- Health Checks: Application health monitoring
- Error Tracking: Comprehensive error reporting
- Performance Metrics: Response time and throughput monitoring
We welcome contributions! Please see our Contributing Guide for details.
- 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 the existing code style
- Write tests for new features
- Update documentation as needed
- Ensure all tests pass
- Follow commit message conventions
This project is licensed under the MIT License - see the LICENSE file for details.
- GitHub API: For providing comprehensive developer data
- Open Source Community: For the amazing tools and libraries
- Contributors: Everyone who helps improve this project
- ๐ Bug Reports: Create an issue
- ๐ก Feature Requests: Start a discussion
- ๐ Documentation: Check the docs folder
- ๐ฌ Questions: Use GitHub Discussions
- Backend API development
- Database design and models
- GitHub API integration
- Basic authentication system
- React frontend implementation
- User dashboard and profiles
- Leaderboard visualization
- Analytics dashboard
- Real-time updates with WebSockets
- Advanced analytics and insights
- Team and organization support
- Export and reporting features
- Mobile application
- Advanced caching strategies
- Machine learning insights
- Community features
โญ Star this repository if you find it helpful!
Made with โค๏ธ by WaleedCodes