A modern, interactive dashboard for visualizing GitHub repository statistics with a beautiful UI built using React, Vite, and Radix UI components. Track traffic, clones, forks, pull requests, and issues across all your repositories in one place.
- The app is deployed at https://gitmystats.netlify.app. All you need is a Github Token and you are good to go.
- Or deploy it localy using the command
pnpm run devand open the server address (http://localhost:5173) in a browser.
- Contributing Guide - Guidelines for contributing to this project
- Code of Conduct - Community guidelines and standards
- Security Policy - Security practices and vulnerability reporting
- Media Assets - Project media and branding assets
- Project Overview - High-level project architecture and design decisions
- Dashboard Data Flow - Detailed data flow and API interactions
- GitHub Content Fetching - GitHub API integration details
- LLM Architecture - AI analysis system architecture
- Diagrams - Visual documentation and flowcharts
- Presentation - Project presentation materials
- Grid Layout: Clean, responsive card-based layout displaying all your repositories
- Key Metrics: Each card shows:
- Total views and unique views
- Clone counts (total and unique)
- Fork count
- Star count
- Pull request count
- Issue count
- Primary programming language
- Repository Icons: Uses GitHub's social preview images (OpenGraph images) as repository icons
- Hover Effects: Smooth animations and visual feedback on card hover
- Smooth Animations: Cards expand with fluid animations into full-screen detail views
- Comprehensive Statistics:
- Traffic overview with total and unique metrics
- Activity summary (PRs, issues, stars, forks)
- Interactive charts showing traffic trends over the last 14 days
- Repository metadata (language, creation date, last update)
- Visual Data: Area charts powered by Recharts showing views and clones over time
- Easy Navigation: Click anywhere outside or use the close button to return to the grid
- Personal Access Token: Uses GitHub PAT for secure API access
- Local Storage: Token is stored only in your browser, never sent to any server except GitHub
- Privacy First: All API calls go directly from your browser to GitHub
- Multi-Provider Support: Support for multiple LLM providers (OpenRouter, Gemini, OpenAI)
- Repository Architecture Understanding: Analyzes overall project structure and design patterns
- Per-File Code Summaries: Provides detailed explanations of individual files and their purposes
- Improvement Suggestions: Offers actionable recommendations for code quality and optimization
- Context Management: Uses React Context API for LLM configuration and state management
The AI analysis feature consists of several key components:
LLMContext.jsx: React context providing LLM configuration and API keys across the applicationllmService.js: Unified service handling communication with different LLM providersuseRepoAnalysis.js: Custom hook managing the analysis workflow and stateRepoAnalysis.jsx: UI component displaying analysis results and suggestionsLLMSettingsDialog.jsx: Configuration interface for selecting providers and managing API keys
| Provider | Model Support | API Key Required | Configuration |
|---|---|---|---|
| OpenRouter | Various open-source models | Yes | API key from openrouter.ai |
| Google Gemini | Gemini Pro, Gemini Pro Vision | Yes | API key from ai.google.dev |
| OpenAI | GPT-3.5, GPT-4, GPT-4 Vision | Yes | API key from platform.openai.com |
- Repository Scanning: Fetches complete file tree and content using GitHub API
- Content Processing: Extracts and prepares code for analysis
- LLM Query: Sends structured prompts to the selected provider
- Response Parsing: Processes JSON responses containing analysis data
- UI Presentation: Displays results in an organized, readable format
- A GitHub account
- A GitHub Personal Access Token with appropriate permissions
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click "Generate new token (classic)"
- Give your token a descriptive name (e.g., "Stats Dashboard")
- Select the following scopes:
repo- Full control of private repositories (required for traffic data)- OR
public_repo- Access to public repositories only
- Click "Generate token"
- Copy the token immediately - you won't be able to see it again!
- Open the deployed dashboard URL
- Paste your GitHub Personal Access Token into the input field
- Click "Load Repositories"
- Browse your repository cards
- Click any card to view detailed statistics and charts
To use the AI-powered code analysis feature:
- Access the settings by clicking the settings icon in the dashboard header or within a repository detail view
- Select your preferred LLM provider (OpenRouter, Gemini, or OpenAI)
- Enter your API key for the selected provider:
- Your API keys are stored locally in your browser's localStorage for convenience
- Frontend Framework: React 19
- Styling: Tailwind CSS with custom design system
- UI Components: shadcn/ui (Radix UI primitives)
- Icons: Lucide React
- Charts: Recharts
- Animations: Framer Motion
- Build Tool: Vite
- Package Manager: pnpm
The dashboard fetches data from the following GitHub REST API endpoints:
-
GET /user/repos- List user repositories- Retrieves all repositories accessible to the authenticated user
- Supports sorting by
updated,created,pushed,full_name - Used to populate the main repository grid
-
GET /repos/{owner}/{repo}- Repository details- Gets detailed information about a specific repository
- Includes metadata like description, language, creation date, etc.
-
GET /repos/{owner}/{repo}/traffic/views- View statistics (last 14 days)- Provides daily view counts (total and unique) for the past 2 weeks
- Requires repository owner or collaborator access
-
GET /repos/{owner}/{repo}/traffic/clones- Clone statistics (last 14 days)- Provides daily clone counts (total and unique) for the past 2 weeks
- Requires repository owner or collaborator access
-
GET /repos/{owner}/{repo}/pulls- Pull request data- Retrieves pull request information for statistics
- Supports filtering by state (
open,closed,all)
-
GET /repos/{owner}/{repo}/issues- Issue data- Retrieves issue information for statistics
- Supports filtering by state (
open,closed,all)
-
GET /repos/{owner}/{repo}/git/trees/{branch}?recursive=1- Repository file tree- Gets the complete file structure of a repository
- Used for AI-powered code analysis features
-
GET /repos/{owner}/{repo}/contents/{path}- File contents- Retrieves the contents of specific files
- Used for AI-powered code analysis features
Each repository card displays:
- Repository name and description - Truncated for optimal display
- Social preview image (OpenGraph) - Fallback to default GitHub icon if not available
- Views (total and unique) - Traffic data from GitHub API
- Clones (total and unique) - Clone statistics with visual indicators
- Forks count - Number of repository forks
- Stars count - Repository star count with star icon
- Pull requests count - Open and total PR counts
- Issues count - Open and total issue counts
- Primary programming language badge - Color-coded language indicator
The expanded detail view includes:
- Full repository header with icon and description
- External link to view repository on GitHub
- Overview section with large metric cards showing key statistics
- Activity section showing recent PRs and issues
- Interactive traffic chart with 14-day trend data using Recharts
- Repository information including language, creation date, last update, and owner details
- Smooth card-to-detail expansion using Framer Motion's
layoutIdfor seamless transitions - Hover animations on cards with scale and shadow effects
- Fade transitions between grid and detail views
- Micro-interactions throughout the UI for enhanced user experience
- Responsive animations that work across different screen sizes
- GitHub API Hook (
useGitHubAPI.js) - Manages API calls, loading states, and error handling - Mobile Detection Hook (
useMobile.js) - Responsive behavior management - LLM Context Provider - Global state management for AI analysis configuration
- Local Storage Integration - Persists user preferences and API keys
- Node.js: Version 18.0 or higher
- pnpm: Version 8.0 or higher (recommended package manager)
- Git: For version control
# Clone the repository
git clone https://github.com/TheRealFREDP3D/github-stats-dashboard
cd github-stats-dashboard
# Install dependencies
pnpm install
# Start development server
pnpm run dev
# The application will be available at http://localhost:5173pnpm run dev- Start development server with hot reloadpnpm run build- Build for productionpnpm run preview- Preview production build locallypnpm run lint- Run ESLint code quality checks
Build Errors:
# Clear pnpm cache and reinstall
pnpm store prune
pnpm install
# Clear Vite cache
rm -rf node_modules/.viteGitHub API Issues:
- Verify your Personal Access Token has the correct scopes (
repoorpublic_repo) - Check that you haven't exceeded GitHub's rate limits (5,000 requests/hour)
- Ensure the token is valid and not expired
LLM Integration Issues:
- Verify API keys are correctly configured in the settings dialog
- Check that the selected provider supports the models you're trying to use
- Ensure API keys have sufficient permissions and credits
Performance Issues:
- Large repositories may take time to analyze due to file size limits
- Consider using more powerful LLM models for better analysis quality
- The dashboard fetches data on load; refresh the page to update statistics
Development Tools:
- Browser DevTools for network requests and console errors
- React DevTools for component inspection
- GitHub API rate limit monitoring in browser Network tab
Logging:
- The application logs API errors to the browser console
- LLM analysis progress and errors are logged for debugging
github-stats-dashboard/
├── src/
│ ├── components/
│ │ ├── ui/ # shadcn/ui components (46 components)
│ │ ├── Dashboard.jsx # Main dashboard container
│ │ ├── RepoCard.jsx # Repository card component
│ │ ├── RepoDetail.jsx # Detailed view component
│ │ ├── LLMSettingsDialog.jsx # LLM provider configuration
│ │ └── RepoAnalysis.jsx # AI-powered code analysis component
│ ├── hooks/
│ │ ├── useMobile.js # Mobile detection hook
│ │ ├── useGitHubAPI.js # GitHub API integration hook
│ │ └── useRepoAnalysis.js # LLM analysis hook
│ ├── services/
│ │ ├── githubContentService.js # GitHub content fetching service
│ │ └── llmService.js # LLM integration service
│ ├── contexts/
│ │ └── LLMContext.jsx # React context for LLM configuration
│ ├── lib/
│ │ └── utils.js # Utility functions
│ ├── assets/ # Static assets
│ ├── App.jsx # Main application component
│ ├── App.css # Global styles and theme
│ └── main.jsx # Application entry point
├── public/ # Static assets
├── .gitignore # Git ignore patterns
├── components.json # shadcn/ui configuration
├── eslint.config.js # ESLint configuration
├── index.html # HTML template
├── jsconfig.json # JavaScript project configuration
├── package.json # Project dependencies and scripts
├── pnpm-lock.yaml # pnpm lock file
├── vite.config.js # Vite configuration
└── README.md # This file- Traffic Data: GitHub API only provides traffic data for the last 14 days
- Rate Limiting: GitHub API has rate limits (5,000 requests/hour for authenticated requests)
- Repository Access: You can only see statistics for repositories you have access to
- Real-time Updates: Data is fetched on load; refresh to see updated statistics
Potential features for future versions:
- Historical data storage to track trends beyond 14 days
- Comparison view between multiple repositories
- Export functionality for statistics
- Dark/light theme toggle
- Filtering and sorting options
- Search functionality
- Organization repository support
- Webhook integration for real-time updates
- Your GitHub token is stored only in your browser's memory during the session
- The token is never sent to any server except GitHub's official API
- Always use tokens with minimal required permissions
- Regularly rotate your tokens for security
- Never share your tokens or commit them to version control
- LLM API keys are stored in your browser's localStorage; consider rotating them regularly and avoid using keys with excessive permissions
Distributed under the MIT License. See LICENSE for more information.
- GitHub REST API
- Vite for the amazing development experience
- Radix UI for accessible UI primitives
- Tailwind CSS for utility-first CSS
- Lucide for beautiful icons
This project is open source and available for personal and commercial use.
For issues, questions, or contributions, please refer to the project repository.
Built with ❤️ using React, Tailwind CSS, and GitHub API





