Skip to content

Commity is an open-source tool that tracks and ranks developer contributions on GitHub. Explore leaderboards, view stats, and celebrate both open-source and private work with daily updates.

License

Notifications You must be signed in to change notification settings

waleedcodes/Commity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

49 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ† GitHub Analytics Tool (Commity)

A comprehensive platform for tracking, analyzing, and ranking GitHub contributors. This tool provides detailed insights into developer activity, repository statistics, and community engagement metrics.

GitHub Analytics Tool Node.js MongoDB React

โœจ Features

๐Ÿ” User Analytics

  • Comprehensive GitHub profile analysis
  • Contribution history and patterns
  • Repository statistics and insights
  • Programming language distribution
  • Activity timeline and trends

๐Ÿ… Leaderboard System

  • 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

๐Ÿ“Š Advanced Analytics

  • Contribution trends over time
  • Repository performance metrics
  • Developer activity patterns
  • Collaboration network analysis
  • Growth and engagement statistics

๐Ÿš€ Real-time Features

  • Live data synchronization with GitHub API
  • Real-time leaderboard updates
  • Instant profile refresh capabilities
  • WebSocket-based notifications
  • Caching for optimal performance

๐Ÿ—๏ธ Project Structure

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

๐Ÿš€ Quick Start

Prerequisites

  • Node.js (v16 or higher)
  • MongoDB (local installation or MongoDB Atlas)
  • GitHub Personal Access Token

1. Clone Repository

git clone https://github.com/waleedcodes/Commity.git
cd Commity

2. Install Dependencies

npm run install:all

3. Environment Setup

# 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

4. GitHub Token Setup

  1. Go to GitHub Settings โ†’ Developer settings โ†’ Personal access tokens
  2. Generate new token with scopes:
    • โœ… read:user (access user profile data)
    • โœ… read:org (access organization data)
    • โœ… repo (optional, for private repository data)
  3. Add token to your .env file

5. Database Setup

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)

  1. Create account at MongoDB Atlas
  2. Create new cluster
  3. Get connection string
  4. Update MONGODB_URI in .env

6. Run the Application

# 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

๐Ÿณ Docker Setup

Using Docker Compose

# Build and start all services
npm run docker:up

# View logs
npm run docker:logs

# Stop services
npm run docker:down

Manual Docker Build

# 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

๐Ÿ“š API Documentation

Base URL

http://localhost:3000/api

Authentication

  • Public Endpoints: No authentication required
  • Protected Endpoints: Bearer token in Authorization header
  • Rate Limiting: 100 requests/hour for public, 500+ for authenticated

Core Endpoints

๐Ÿ‘ค Users

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

๐Ÿ† Leaderboard

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

๐Ÿ“Š Analytics

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

๐Ÿ” Search

GET    /api/users/search?q=query     # Search users

Response Format

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"
}

๐Ÿงช Testing

Backend Tests

cd backend

# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Generate coverage report
npm run test:coverage

Frontend Tests

cd frontend

# Run frontend tests
npm test

# Run tests with coverage
npm run test:coverage

๐Ÿ“ˆ Development Workflow

Backend Development

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

Code Quality Standards

  • ESLint: Airbnb JavaScript style guide
  • Prettier: Consistent code formatting
  • Jest: Unit and integration testing
  • Husky: Pre-commit hooks for quality gates

๐Ÿ“Š Architecture Overview

Backend Architecture

  • 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

Key Design Patterns

  • 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

Performance Optimizations

  • 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

๐Ÿ”’ Security Features

  • 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

๐Ÿš€ Deployment

Environment Setup

Development

NODE_ENV=development

Production

NODE_ENV=production
# Additional production configurations...

Production Deployment Checklist

  • 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

Monitoring and Logging

  • Winston: Structured logging
  • Health Checks: Application health monitoring
  • Error Tracking: Comprehensive error reporting
  • Performance Metrics: Response time and throughput monitoring

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Process

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Code Standards

  • Follow the existing code style
  • Write tests for new features
  • Update documentation as needed
  • Ensure all tests pass
  • Follow commit message conventions

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • GitHub API: For providing comprehensive developer data
  • Open Source Community: For the amazing tools and libraries
  • Contributors: Everyone who helps improve this project

๐Ÿ“ž Support

๐Ÿ”ฎ Roadmap

Phase 1: Core Features โœ…

  • Backend API development
  • Database design and models
  • GitHub API integration
  • Basic authentication system

Phase 2: Frontend Development ๐Ÿšง

  • React frontend implementation
  • User dashboard and profiles
  • Leaderboard visualization
  • Analytics dashboard

Phase 3: Advanced Features ๐Ÿ“‹

  • Real-time updates with WebSockets
  • Advanced analytics and insights
  • Team and organization support
  • Export and reporting features

Phase 4: Enhancement ๐Ÿ”„

  • Mobile application
  • Advanced caching strategies
  • Machine learning insights
  • Community features

โญ Star this repository if you find it helpful!

Made with โค๏ธ by WaleedCodes

About

Commity is an open-source tool that tracks and ranks developer contributions on GitHub. Explore leaderboards, view stats, and celebrate both open-source and private work with daily updates.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •