A comprehensive git repository analytics platform that visualizes key performance metrics based on code changes. Track developer productivity, code quality, collaboration patterns, and team health with beautiful, interactive visualizations.
-
Developer Productivity
- Lines of code added/removed/changed
- Commit frequency and patterns
- Individual contributor statistics
- Role identification (Core, Regular, Occasional)
-
Code Quality Indicators
- Code churn analysis
- File hotspots (frequently changed files)
- Average commit size metrics
- Commit message quality scoring
-
Team Health & Collaboration
- Bus factor calculation
- Knowledge distribution analysis
- Collaboration patterns
- Active contributor tracking
-
Temporal Analysis
- Development velocity trends
- Commit patterns by time of day
- Commit patterns by day of week
- Weekly/daily metrics tracking
- Interactive charts powered by Apache ECharts
- Real-time metric updates
- Responsive design with dark mode
- Multiple chart types: line, bar, pie, and more
- GitHub - Full support for public and private repositories
- Bitbucket - Complete Bitbucket Cloud integration
- Easy to extend for other git providers
- FastAPI - Modern, fast Python web framework
- SQLite - Local database for metrics storage
- Python 3.8+ - Core programming language
- PyGithub & Bitbucket APIs - Repository data fetching
- React 18 - UI framework
- TypeScript - Type-safe development
- Vite - Lightning-fast build tool
- Apache ECharts - Professional charting library
- Tailwind CSS - Utility-first styling
- React Router - Client-side routing
- Python 3.8 or higher
- Node.js 16 or higher
- npm or yarn package manager
- Navigate to the backend directory:
cd backend- Install Python dependencies:
pip install -r requirements.txt- Start the FastAPI server:
python main.pyThe API will be available at http://localhost:8000
- Navigate to the frontend directory:
cd frontend- Install Node dependencies:
npm install- Start the development server:
npm run devThe frontend will be available at http://localhost:5173
-
Navigate to the home page
-
Click "Add Repository"
-
Fill in the repository details:
- Name: A friendly name for your repository
- URL: The git repository URL (e.g.,
https://github.com/username/repo) - Provider: Select GitHub or Bitbucket
- Access Token: (Optional for public repos, required for private)
- GitHub: Create a personal access token at https://github.com/settings/tokens
- Bitbucket: Create an app password at https://bitbucket.org/account/settings/app-passwords/
-
Click "Add Repository"
- On the home page, find your repository card
- Click "Sync Repository" to fetch commits and calculate metrics
- Monitor the progress bar during sync
- Once complete, navigate to the dashboard to view metrics
- Total Commits: Overall commit count
- Contributors: Number of unique contributors
- Lines Changed: Total code changes (additions + deletions)
- Bus Factor: Minimum critical contributors (lower = higher risk)
- Velocity Trends: Development activity over time
- Commit Patterns: When team members are most active
- Top Contributors: Ranked by commits and impact
- Contribution Distribution: Percentage breakdown
- Role Classification: Core, Regular, and Occasional contributors
- Detailed Statistics: Per-contributor metrics
- File Churn: Files with most changes (potential instability)
- Developer Churn: Individual change patterns
- High Risk Files: Files with single ownership
- Bus Factor Analysis: Knowledge distribution risks
GET /api/repositories- List all repositoriesPOST /api/repositories- Add a new repositoryGET /api/repositories/{id}- Get repository detailsDELETE /api/repositories/{id}- Remove a repository
POST /api/sync- Start repository syncGET /api/sync/{repo_id}/status- Get sync status
GET /api/metrics/{repo_id}/summary- Repository summaryGET /api/metrics/{repo_id}/contributors- Contributor statsGET /api/metrics/{repo_id}/hotspots- File hotspotsGET /api/metrics/{repo_id}/churn- Code churn analysisGET /api/metrics/{repo_id}/velocity- Velocity trendsGET /api/metrics/{repo_id}/bus-factor- Bus factor metricsGET /api/metrics/{repo_id}/commit-patterns- Commit patternsGET /api/metrics/{repo_id}/comprehensive- All metrics
The application uses SQLite with the following main tables:
- repositories - Repository configurations
- commits - Individual commit records
- file_changes - File-level change details
- contributors - Aggregated contributor metrics
- file_hotspots - Frequently changed files
- daily_metrics - Daily aggregated statistics
For private repositories or to avoid rate limits:
GitHub:
- Go to https://github.com/settings/tokens
- Generate a new token (classic)
- Select scopes:
repo(for private repos) orpublic_repo(for public only) - Copy and save the token
Bitbucket:
- Go to https://bitbucket.org/account/settings/app-passwords/
- Create app password
- Select permissions:
Repositories: Read - Copy and save the password
Backend:
cd backend
uvicorn main:app --reload --port 8000Frontend:
cd frontend
npm run devFrontend:
cd frontend
npm run buildThe built files will be in frontend/dist/
The minimum number of team members who would need to leave before project knowledge is at risk. Lower numbers indicate concentrated knowledge. Industry recommendation: aim for 3+.
Lines added + deleted over time. High churn may indicate:
- Active development areas
- Unstable or buggy code
- Code that needs refactoring
Files changed frequently. Can indicate:
- Core system files
- Complex or coupled code
- Potential technical debt areas
Understanding when your team commits helps:
- Identify work-life balance issues
- Optimize meeting schedules
- Understand global team distribution
If you hit GitHub/Bitbucket rate limits:
- Add an access token to increase limits
- For GitHub: 60 req/hour (unauthenticated) vs 5,000 req/hour (authenticated)
For large repositories:
- First sync takes longer (fetches all commits)
- Subsequent syncs are incremental
- Consider limiting the initial sync period in
git_providers.py
If you need to reset the database:
cd backend
rm git_metrics.db
python main.py # Will recreate databaseContributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
Future enhancements:
- Pull request metrics
- Code review statistics
- Issue tracking integration
- Jira/Linear integration
- Team comparison views
- Export reports (PDF/CSV)
- Slack/Teams notifications
- GitLab support
- Docker deployment
- Multi-repository dashboards
For issues, questions, or contributions, please open an issue on GitHub.
Built with ❤️ using FastAPI, React, and Apache ECharts