Skip to content

elbruno/nuget-repo-dashboard

Repository files navigation

NuGet + GitHub Dashboard

A public dashboard that tracks NuGet packages and GitHub repos — collecting download counts, versions, stars, issues, PRs, and more.

🌐 Live dashboard: https://elbruno.github.io/nuget-repo-dashboard/

Architecture

The dashboard uses a two-pipeline architecture:

Pipeline 1: Discovery

Automatically discovers NuGet packages and their associated GitHub repositories:

  1. Query NuGet Search API — search for packages by owner (owner:elbruno)
  2. Build package list — deduplicate and filter discovered packages
  3. Extract GitHub repos — parse projectUrl from package metadata to build deduplicated repo list

Pipeline 2: Collection

Collects metrics from NuGet and GitHub APIs using the discovered lists:

  1. Collect NuGet metrics — fetch download counts, versions, and metadata → data.nuget.json
  2. Collect GitHub metrics — fetch stars, forks, issues, PRs → data.repositories.json
config/dashboard-config.json   ← NuGet profile + ignore list
config/tracked-packages.json   ← optional manual package mappings
         ↓
   src/Collector/              ← .NET 10 console app (two-pipeline architecture)
         ↓
   data/latest/                ← latest snapshots
   ├── data.nuget.json         ← NuGet package metrics
   └── data.repositories.json  ← GitHub repository metrics
         ↓
   data/history/YYYY/MM/DD/    ← daily history

Quick Start

Prerequisites

Build

dotnet build src/Collector/Collector.csproj

Run

dotnet run --project src/Collector/Collector.csproj

Environment Variables

Variable Required Description
NUGET_PROFILE No Override the NuGet profile username from dashboard-config.json
GITHUB_TOKEN No GitHub personal access token for higher rate limits
DASHBOARD_REPO_ROOT No Override the repo root path (useful in CI)

GitHub Token Setup

The GITHUB_TOKEN can be provided via .NET User Secrets (recommended for local development) or environment variables.

Option 1: .NET User Secrets (recommended for local dev)

cd src/Collector
dotnet user-secrets set "GITHUB_TOKEN" "ghp_your_token_here"

User Secrets are stored outside the repo in your OS user profile, so they are never committed to source control.

Option 2: Environment Variable

# Linux / macOS
export GITHUB_TOKEN="ghp_your_token_here"

# Windows PowerShell
$env:GITHUB_TOKEN = "ghp_your_token_here"

Note: If both User Secrets and an environment variable are set, the environment variable takes precedence.

NuGet Profile Override

The NuGet profile defaults to "elbruno" in config/dashboard-config.json. You can override it via .NET User Secrets or an environment variable without editing the config file.

Precedence: Environment Variable > User Secrets > config file default.

Option 1: .NET User Secrets

cd src/Collector
dotnet user-secrets set "NUGET_PROFILE" "someuser"

Option 2: Environment Variable

# Linux / macOS
export NUGET_PROFILE="someuser"

# Windows PowerShell
$env:NUGET_PROFILE = "someuser"

The Collector will show which source is active at startup:

  [1/3] Loading config...
    Profile: someuser (source: environment variable)

⚠️ Single Profile Design: This dashboard is designed and optimized for tracking a single NuGet user profile. In the future we may rebuild to support multiple profiles, but currently it targets one NuGet user at a time.

Configuration

Dashboard Config (config/dashboard-config.json)

Primary configuration for auto-discovery:

{
  "nugetProfile": "elbruno",
  "mergeWithTrackedPackages": true,
  "ignorePackages": [
    "LocalEmbeddings",
    "Microsoft.Extensions.AI"
  ]
}

Fields:

  • nugetProfile — NuGet username for auto-discovery (queries owner:{username})
  • mergeWithTrackedPackages — merge manual package mappings from tracked-packages.json
  • ignorePackages — exclude specific packages from collection (case-insensitive)

Tracked Packages (config/tracked-packages.json)

Optional manual package-to-repo mappings (merged with discovered packages):

[
  { "packageId": "Microsoft.Extensions.AI", "repos": ["dotnet/extensions"] }
]

Output

The collector writes two JSON files:

data.nuget.json

NuGet package metrics with download counts, versions, and metadata.

data.repositories.json

GitHub repository metrics with stars, forks, issues, PRs, and additional metadata.

Both files are written to:

  • data/latest/ — latest metrics snapshot
  • data/history/{YYYY}/{MM}/{DD}/ — daily historical snapshots

Dashboard

The dashboard is automatically deployed to GitHub Pages after each metrics refresh. The Refresh Metrics workflow collects data and then deploys site/index.html with the latest JSON data.

Dependabot Security Alerts

High/critical Dependabot security PRs are automatically escalated via Dependabot Security Alert:

  • Adds labels: dependabot, dependabot:security, security, and severity:*
  • Posts/updates a sticky triage comment on the PR
  • Requests CODEOWNERS review (or repository owner fallback when CODEOWNERS is missing)

Only high/critical security updates trigger the special alert flow; lower-severity updates keep normal PR handling.

Enabling GitHub Pages

  1. Go to Settings → Pages in your repository
  2. Under Build and deployment, set Source to GitHub Actions
  3. The next workflow run will deploy the dashboard automatically

Dashboard URL

Once enabled, the dashboard is available at:

https://{owner}.github.io/{repo}/

For this repo: https://elbruno.github.io/nuget-repo-dashboard/

REST API

The dashboard exposes metrics data via REST API endpoints for programmatic access. This enables external tools, dashboards, and integrations to consume package and repository metrics.

API Endpoints

  • GET /api/packages/index.json — All NuGet packages with metrics
  • GET /api/repositories/index.json — All GitHub repositories with metrics
  • GET /api/trends/index.json — Historical trend data (90-day window)
  • GET /api/metadata.json — Metadata and generation timestamps

Example Usage

// Fetch all packages
const response = await fetch('https://elbruno.github.io/nuget-repo-dashboard/api/packages/index.json');
const data = await response.json();
console.log(data.packages);

API Documentation

For detailed API documentation, parameters, response formats, and examples, see:

Site Structure

The deployed site contains:

  • index.html — dashboard UI (from site/index.html)
  • api/packages/index.json — NuGet package metrics (API endpoint)
  • api/repositories/index.json — GitHub repository metrics (API endpoint)
  • api/trends/index.json — Historical trends (API endpoint)
  • data/data.nuget.json — NuGet package metrics (legacy)
  • data/data.repositories.json — GitHub repository metrics (legacy)

🎨 repo-identity

A .NET CLI tool that generates Oh My Posh terminal themes for every repository tracked by this dashboard — with deterministic accent colors and purpose-based icons. Your terminal prompt switches theme automatically as you cd between repos.

Quick install (after cloning)

# 1. Generate Oh My Posh profiles for all tracked repos
dotnet run --project src/RepoIdentity --framework net8.0 -- generate

# 2. Install profiles + wire up your PowerShell $PROFILE
dotnet run --project src/RepoIdentity --framework net8.0 -- install

Open a new PowerShell window and cd into any tracked repo — the theme activates automatically.

Run install --dry-run first to preview every change before it's applied.

📖 Full documentation:

All commands

# Preview profiles without writing any files
dotnet run --project src/RepoIdentity --framework net8.0 -- preview

# Generate Oh My Posh profiles into terminal/ohmyposh/
dotnet run --project src/RepoIdentity --framework net8.0 -- generate

# Install profiles and patch $PROFILE (dry-run to preview first)
dotnet run --project src/RepoIdentity --framework net8.0 -- install --dry-run
dotnet run --project src/RepoIdentity --framework net8.0 -- install

Output

Each tracked repo gets a file in terminal/ohmyposh/:

  • {owner}-{repo}.json — Oh My Posh theme with deterministic accent color and purpose icon
  • default.json — neutral fallback theme used outside tracked repos
  • index.json — manifest used by the auto-detection script at runtime
  • Set-RepoTheme.ps1 — auto-detection script (sourced from $PROFILE)

Optional: repo.identity.json

Place a repo.identity.json in any tracked repo to customize its profile:

{
  "name": "My Library",
  "type": "library",
  "accentColor": "#0078D4",
  "icon": "🧠"
}

Releases

No releases published

Packages

 
 
 

Contributors