A modern, responsive React application for visualizing GitHub Copilot metrics and analytics. Built with React, TypeScript, Vite, and Nivo charts.
Comprehensive 28-day metrics visualization with daily activity trends, feature usage breakdown, language statistics, and lines of code analysis.
View and manage GitHub Copilot seat assignments with detailed information about active users, teams, plan types, and editor distribution.
Try it out: View Demo Dashboard
Explore the full dashboard with sample data - no GitHub token required! The demo includes:
- Enterprise Metrics Demo - Overview, Usage, Performance, Adoption, and Seats pages with realistic sample data
- Organization Metrics Demo - Complete set of demo visualizations
- Admin Demo Mode - View the configuration interface (inputs disabled in demo)
Note: The demo site uses sample data. To view your organization's real metrics, follow the setup instructions below.
β¨ Modern UI - Clean, dark-themed interface with smooth transitions π Rich Visualizations - Interactive charts using Nivo (Line, Bar, Pie charts) π± Responsive Design - Works seamlessly on desktop, tablet, and mobile π― Multiple Dashboards - Organized by metric categories:
- Enterprise Metrics (Demo & Live Data):
- Overview - Key metrics and high-level insights
- Usage - Detailed usage patterns and trends
- Performance - Chat performance and productivity metrics
- Adoption - User engagement and adoption analytics
- Seats - Copilot seat assignments and management
- 28-Day Report - Comprehensive 28-day metrics visualization
- Organization Metrics (Demo & Live Data):
- Overview - Organization-wide insights
- Usage Metrics - Detailed usage patterns
- Performance - Acceptance rates and productivity
- Adoption - User engagement analytics π Demo Mode - Explore all features with realistic sample data before connecting your GitHub organization π Secure Deployment - Environment variables and tokens never committed or deployed
- React 18 - Modern React with hooks
- TypeScript - Type-safe development
- Vite - Fast build tool and dev server
- Nivo - Beautiful, responsive charts
- Tailwind CSS - Utility-first styling
- React Router - Client-side routing
- Lucide React - Modern icon library
- Node.js 16+ and npm
- Clone the repository:
git clone https://github.com/warrenandre/GitHub_Copilot_Simple_Metrics_Dashboard.git
cd GHCPDashboardApp- Install dependencies:
npm install- Start the development server:
npm run devThe app will be available at http://localhost:5173
The app supports multiple ways to configure the GitHub Copilot Metrics API:
Option 1: Admin UI (Recommended)
- Navigate to
/adminin the app - Enter your GitHub organization name and personal access token
- Configure date ranges and team settings
- Download metrics data
Option 2: Local Config File
# Copy the example config
cp src/config/apiConfig.local.example.ts src/config/apiConfig.local.ts
# Edit with your credentials (this file is git-ignored)
# Update apiConfig.ts to import your local configOption 3: Environment Variables
# Create .env.local file
echo "VITE_GITHUB_ORG=your-org" >> .env.local
echo "VITE_GITHUB_TOKEN=ghp_your_token" >> .env.local
# Update src/config/apiConfig.ts to read from envπ For detailed configuration instructions, see docs/API_CONFIGURATION.md
Start the development server:
npm run devThe app will be available at http://localhost:5173
Build for production:
npm run buildPreview production build:
npm run previewThe easiest way to deploy this application to Azure:
-
Prerequisites:
- Install Azure Developer CLI (azd)
- Azure subscription
-
Deploy:
# Login to Azure azd auth login # Deploy everything (creates resources + deploys app) azd up
-
Configuration:
- The deployed app uses sample data from
.env.example - Your local
.envfile with real credentials is never deployed (excluded via.azdignore) - To use real data in production, configure environment variables in Azure Portal:
- Go to your App Service β Configuration β Application settings
- Add:
VITE_GITHUB_ORG,VITE_GITHUB_TOKEN, etc.
- The deployed app uses sample data from
-
Update Deployment:
# Redeploy after code changes azd deploy
What azd up creates:
- Resource Group
- App Service Plan (Free/Basic tier)
- App Service (Static Web App)
- Automatically builds and deploys your app
Alternatively, deploy the built files from dist/ folder to any static hosting service:
- Azure Static Web Apps
- Netlify
- Vercel
- GitHub Pages
- AWS S3 + CloudFront
Build the app first:
npm run buildThen upload the dist/ folder contents to your hosting provider.
src/
βββ components/ # Reusable UI components
β βββ Layout.tsx # Main layout with sidebar
β βββ MetricCard.tsx # Metric display cards
β βββ LineChart.tsx # Line chart component
β βββ BarChart.tsx # Bar chart component
β βββ PieChart.tsx # Pie chart component
βββ config/ # Configuration files
β βββ apiConfig.ts # API configuration with validation
β βββ apiConfig.local.example.ts # Example local config
βββ pages/ # Page components
β βββ Overview.tsx # Dashboard overview
β βββ Usage.tsx # Usage metrics
β βββ Performance.tsx # Performance analytics
β βββ Adoption.tsx # Adoption metrics
β βββ Admin.tsx # API configuration page
β βββ live/ # Live data pages
βββ services/ # API and services
β βββ api.ts # Mock data service
β βββ githubApi.ts # GitHub API integration
β βββ dataTransform.ts # Data transformation
βββ types/ # TypeScript type definitions
β βββ metrics.ts # Metrics data types
βββ App.tsx # Main app component
βββ main.tsx # Application entry point
βββ index.css # Global styles
The app integrates with the GitHub Copilot Metrics API to display real-time metrics for your organization.
- Demo Data Mode - Explore the dashboard with mock data
- Live Data Mode - Connect to real GitHub API for your org metrics
- Admin Console - Easy configuration interface with validation
- Secure Storage - API config stored securely (tokens never committed)
- Auto-Refresh - Live pages refresh automatically every 5 minutes
- Dual Storage - Data saved to both localStorage and local files for persistence
-
Get a Personal Access Token:
- Go to GitHub Settings β Developer settings β Personal access tokens
- Create a token with
manage_billing:copilot,read:org, orread:enterprisescope - You must be an organization owner
-
Configure in the App:
- Navigate to
/admin - Enter your org name and token
- Set optional date range and team slug
- Click "Download & Save Locally"
- Navigate to
-
Save Data File (Optional for persistence):
- A JSON file will be downloaded to your Downloads folder
- Move it to
public/data/folder in the project - Rename to
copilot-metrics.json - The app will automatically load from this file if localStorage is empty
-
View Live Metrics:
- Navigate to Live Data pages
- Data automatically loads from localStorage or local file
- Refresh anytime or wait for auto-refresh
The app uses a dual-storage approach:
- localStorage (Primary) - Fast, immediate access for current browser session
- Local File (Backup) -
/public/data/copilot-metrics.jsonfor persistence across sessions
When you download data from Admin page:
- Data is saved to localStorage automatically
- A JSON file is downloaded to your Downloads folder
- Manually move this file to
public/data/copilot-metrics.jsonfor automatic loading
The live pages will:
- Check localStorage first (fastest)
- Fall back to loading from
/public/data/copilot-metrics.jsonif localStorage is empty - Save file data to localStorage for faster subsequent access
- Organization with 5+ active Copilot licenses
- Organization owner permissions
- Personal access token with correct scopes
- Copilot Metrics API access enabled
For detailed documentation: docs/API_CONFIGURATION.md
API Documentation: GitHub Copilot Metrics API
If you encounter issues calling the GitHub Copilot API:
π Quick Start: See DEBUGGING_QUICK_START.md for common errors and quick fixes
π Full Guide: See docs/DEBUGGING_API.md for comprehensive debugging steps
Quick Debug Checklist:
- Open Browser DevTools (F12) β Console tab
- Look for detailed debug logs (π π€ π₯ β or β emojis)
- Check Network tab for API request/response
- Verify token has correct scopes
- Test with curl to isolate issues
Edit tailwind.config.js to customize colors:
theme: {
extend: {
colors: {
primary: { /* your colors */ }
}
}
}Chart configurations are in individual component files (src/components/*Chart.tsx). Modify Nivo chart props to customize appearance and behavior.
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - feel free to use this project for your own purposes.
You are free to use, modify, and distribute this repository under the MIT License, with the following requirement:
The application footer containing developer attribution ("Developed by Warren Joubert - Microsoft Software Engineer") must remain intact and unmodified.
This footer is protected by multiple validation systems:
- Cryptographic validation on application startup
- Real-time DOM monitoring and integrity checks
- Automatic application reload if footer is removed or modified
- CSS-based protection against tampering
What you can do:
- β Use this code for personal or commercial projects
- β Modify any functionality, styling, or features
- β Deploy to your own infrastructure
- β Fork and create derivative works
What you cannot do:
- β Remove or modify the footer attribution
- β Disable the footer protection mechanisms
- β Claim authorship of the original work
The footer serves as attribution for the original development work while allowing full usage of the codebase. If you have specific requirements that conflict with this, please open an issue to discuss.
- GitHub Copilot for powering AI-assisted development
- Nivo for excellent chart components
- The React and Vite communities

