Skip to content

HRG-OFFICIAL/Github-Insights-Extension

Repository files navigation

GitHub Insights Dashboard

Version License

A VS Code extension that provides GitHub repository analytics, data visualization, and report generation capabilities.

Technologies

  • TypeScript - Primary development language
  • VS Code Extension API - Extension framework
  • GitHub REST API - Data source for repository analytics
  • Chart.js - Data visualization library
  • HTML2Canvas & jsPDF - Report generation
  • Node.js - Runtime environment

Features

Comprehensive Analytics

  • Repository Metrics: Stars, forks, issues, contributors, and commit activity
  • Activity Heatmaps: GitHub-style contribution patterns
  • Contributor Analysis: Top contributors with detailed statistics
  • Issue & PR Tracking: Resolution times and merge rates
  • Health Scoring: Automated repository health assessment

Interactive Visualizations

  • Chart.js Integration: Charts and graphs using Chart.js library
  • Real-time Data: Live updates from GitHub API
  • Responsive Design: Adapts to different screen sizes
  • Theme Integration: Light/dark mode support

Export & Reporting

  • HTML Reports: Standalone reports with interactive charts
  • CSV Export: Raw data export for spreadsheet analysis
  • JSON Export: Structured data export for further processing
  • Print-friendly: Formatted for documentation and presentations

Screenshots

Dashboard Overview

Dashboard Overview

Main dashboard showing repository information and key metrics

Commit Analytics

Commit Analytics

Detailed commit activity charts and frequency analysis

Contributors View

Contributors View

Top contributors with contribution counts and activity patterns

Issues & Pull Requests

Issues & PRs

Issue and PR statistics with resolution time analysis

Analytics Dashboard

Analytics Dashboard

Repository health score and community engagement metrics

Sample Report

View Sample PDF Report - HTML/PDF export with interactive charts

Quick Start

1. Install the Extension

Install from the VS Code Marketplace by searching for "GitHub Insights Dashboard" and clicking Install.

Alternatively, install from VSIX:

code --install-extension github-insights-dashboard-1.0.1.vsix

2. Open a Repository

Open any GitHub repository in VS Code:

git clone https://github.com/your-username/your-repo.git
code your-repo

3. Launch Dashboard

  1. Press Ctrl+Shift+P (Cmd+Shift+P on Mac)
  2. Type "GitHub Insights: Show Dashboard"
  3. Press Enter

4. Set Up Authentication (Optional)

For private repositories or higher rate limits:

  1. Press Ctrl+Shift+P
  2. Type "GitHub Insights: Set GitHub Token"
  3. Enter your GitHub Personal Access Token

Quick Demo (For Interviewers)

# Validate the project setup
node tests/validate-setup.js

# Open VS Code and press F5 to launch extension
# Use Ctrl+Shift+P → "GitHub Insights: Test with Public Repository"

Configuration

Settings

Access via File > Preferences > Settings > Extensions > GitHub Insights:

Setting Description Default Range
githubInsights.defaultRangeDays Commit analysis range 30 7-365
githubInsights.exportFolder Export location workspace folder any path
githubInsights.cacheTTL Cache duration (ms) 900000 60000+
githubInsights.maxPages API pagination limit 5 1-20
githubInsights.mockMode Enable mock data false boolean

Commands

Command Description Shortcut
GitHub Insights: Show Dashboard Open main dashboard -
GitHub Insights: Set GitHub Token Configure authentication -
GitHub Insights: Refresh Insights Refresh current data -
GitHub Insights: Clear Cache Clear cached data -
GitHub Insights: Export CSV Export data to CSV -
GitHub Insights: Export HTML Report Generate HTML report -
GitHub Insights: Export JSON Export data to JSON -
GitHub Insights: Test with Public Repository Test with mock data -
GitHub Insights: Show Token Status Display token configuration -
GitHub Insights: Clear GitHub Token Remove stored token -

Dashboard Sections

Overview

  • Displays essential repository information such as stars, forks, and issue counts, along with key activity indicators and an overall health summary. It provides a quick snapshot of repository performance at a glance.

Commits

  • Visualizes daily commit trends, activity frequency, and contribution patterns over time. This section helps identify active development periods and overall commit distribution.

Contributors

  • Highlights the top contributors with their respective contribution counts and activity levels. It also includes a brief bus factor analysis to assess dependency on key contributors.

Issues & Pull Requests

  • Presents detailed statistics for issues and pull requests, including open and closed counts, merge rates, and average resolution times, giving insights into project responsiveness and workflow efficiency.

Analytics

  • Provides an overall health score of the repository, community engagement insights, and trend-based analysis to evaluate growth and long-term activity patterns.

Authentication

GitHub Personal Access Token

Required for:

  • Private repositories
  • Higher rate limits (5,000 vs 60 requests/hour)
  • Better API access

Token Permissions:

  • public_repo: Read access to public repositories
  • repo: Read access to private repositories (optional)
  • read:user: Read user profile information

Security:

  • Tokens stored using VS Code's encrypted SecretStorage API
  • Never shared or transmitted to external services
  • Can be cleared anytime via Command Palette

Creating a Token

  1. Go to GitHub Settings > Developer settings > Personal access tokens
  2. Click "Generate new token (classic)"
  3. Select scopes: public_repo (and repo for private repos)
  4. Copy the generated token
  5. Run "GitHub Insights: Set GitHub Token" in VS Code

API Rate Limits

Authentication Rate Limit Reset Time
Unauthenticated 60 requests/hour 1 hour
Authenticated 5,000 requests/hour 1 hour

Recommendations:

  • Use a Personal Access Token for better limits
  • Enable caching (default: 15 minutes) to reduce API calls
  • Avoid frequent refreshes to stay within limits

Troubleshooting

Common Issues

"No GitHub repository detected"

  • Ensure you're in a Git repository folder
  • Check that .git/config contains GitHub remote
  • Verify the remote URL points to GitHub

"Rate limit exceeded"

  • Wait for rate limit to reset (1 hour)
  • Set up a Personal Access Token for higher limits
  • Enable caching to reduce API calls

"Failed to load dashboard"

  • Check internet connection
  • Verify repository is accessible
  • Try refreshing the dashboard
  • Check VS Code Developer Console for errors

"Charts not loading"

  • Ensure Chart.js CDN is accessible
  • Check firewall settings
  • Try refreshing the page

Security & Privacy

  • Local Processing: All data processing happens on your machine
  • No External Services: Only communicates with GitHub API
  • Encrypted Storage: Tokens stored using OS credential store
  • No Analytics: No usage tracking or telemetry
  • HTTPS Only: All API requests use secure connections
  • Open Source: Full source code available for review

Project Structure

├── src/                    # Source code
│   ├── extension.ts        # Main extension entry point
│   ├── github-api.ts       # GitHub API client
│   ├── dashboard.ts        # Dashboard HTML generation
│   ├── data-processor.ts   # Data processing logic
│   ├── export-manager.ts   # Export functionality
│   ├── cache-manager.ts    # Caching implementation
│   ├── chart-manager.ts    # Chart configuration
│   └── http-client.ts      # HTTP utilities
├── tests/                  # Validation and build scripts
├── fixtures/               # Mock data for testing
├── screenshots/            # Documentation images
├── .github/                # GitHub workflows and templates
└── package.json           # Extension manifest

Requirements

  • VS Code: 1.104.0 or higher
  • Node.js: 16.0.0 or higher (for development)
  • Git: Required for repository detection
  • Internet: Required for GitHub API access

Development

Building from Source

# Clone the repository
git clone https://github.com/github-insights/github-insights-dashboard.git
cd github-insights-dashboard

# Install dependencies
npm install

# Validate setup
node tests/validate-setup.js

# Build the extension
npm run build

# Package the extension
node tests/build-extension.js

Testing & Validation

# Verify extension integrity
node tests/verify-extension.js

# Validate development setup
node tests/validate-setup.js

# Lint code
npm run lint

# Fix linting issues
npm run lint:fix

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

About

VS Code extension for GitHub repository analytics with interactive visualizations and export capabilities.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages