Skip to content

KodeSage/Dashhy

Repository files navigation

dashhy

A live monitoring dashboard for rustyochestrator — the A high-performance modular, open-source CI/CD ochestrator and pipeline runner with parallel execution and smart caching.

Built with Next.js 15, deployed to Vercel. Every pipeline run, task completion, cache hit, and batch execution from the CLI streams into the dashboard in real time.


What it shows

Page Content
Overview Active pipeline count, total runs, cache hit rate, active users, pipeline activity chart, cache donut, live pipeline table, activity feed, batch run tracker
Pipelines Full pipeline history with status filter (All / Running / Success / Failed / Cached) and search by name or user
Cache 24-hour hit/miss area chart, hit rate, total tasks, time saved
Users Every connected team member — pipelines run, cache hits, last active

The pipeline activity chart supports time range toggles: 10m · 30m · 1h · 6h · 12h · 24h, each with appropriately-sized buckets and poll rates.


The CLI fires events in background Tokio tasks — pipeline started, each task completed (with cache hit/miss), and pipeline finished. The dashboard never blocks the pipeline itself.


Batch runs (run-all)

The run-all command lets you launch every workflow in a directory simultaneously:

rustyochestrator run-all .github/workflows

This discovers all .yml/.yaml files in the given directory (alphabetically sorted for determinism), loads them all up front, and fires them in parallel via tokio::spawn — mirroring how GitHub Actions handles multiple workflows.

Log output is prefixed with the workflow name so interleaved lines stay identifiable:

[ci]      [INFO] Starting task: lint__cargo_fmt___check
[release] [INFO] Starting task: build__Install_cross_...
[release]   [build__Install_cross_...|err] Compiling libc v0.2.183
[ci]      [FAIL] Task 'lint__cargo_fmt___check' exited with status 1

The dashboard tracks batch runs as a first-class concept:

  • A Batch Runs section on the Overview page groups all workflows from a single run-all invocation into one collapsible card
  • Each card shows the source directory, a progress bar (N/total workflows complete), aggregate status, and an expandable list of individual workflows with their own status, cache ratio, and duration
  • Workflows that are part of a batch display a indicator in both the pipeline table and the pipelines list
  • The activity feed surfaces run-all started and run-all done events with pass/fail counts
  • Each workflow still gets its own full pipeline detail page — click any row in the batch card to drill in

CLI contract: the CLI must include two extra fields in the pipeline_started event for each workflow launched by run-all:

Field Description
batch_id A stable UUID shared across all workflows in the same run-all invocation
batch_dir The folder path passed to run-all (e.g. .github/workflows)

Everything else — task events, completion events, logs — works identically to a normal single run.


Prerequisites

  • Node.js 18+ and npm (or pnpm / yarn)
  • A GitHub OAuth App (for the Connect CLI authentication flow)
  • Vercel account (free tier is enough for production deployment)

Local development

1. Clone and install

git clone https://github.com/KodeSage/Dashhy.git
cd Dashhy
npm install

2. Create a GitHub OAuth App

Go to GitHub → Settings → Developer settings → OAuth Apps → New OAuth App and fill in:

Field Value
Application name dashhy (local)
Homepage URL http://localhost:3000
Authorization callback URL http://localhost:3000/api/auth/callback/github

Copy the Client ID and generate a Client secret.

3. Configure environment variables

cp .env.example .env.local

Open .env.local and fill in:

GITHUB_ID=your_client_id
GITHUB_SECRET=your_client_secret
NEXTAUTH_SECRET=any_random_string   # run: openssl rand -base64 32
NEXTAUTH_URL=http://localhost:3000

4. Start the dev server

npm run dev

Open http://localhost:3000.

5. Connect the CLI

In the dashboard, click Connect CLI, sign in with GitHub. The dashboard generates a signed token and shows you the exact command:

rustyochestrator connect --token <jwt> --url http://localhost:3000

Run it. From this point every rustyochestrator run and rustyochestrator run-all reports live to your local dashboard.

Local data persistence

Without Vercel KV, data is stored in .dashhy-data/db.json in the project root. This file survives hot-reloads and process restarts. It is gitignored.

To reset the local database:

rm -rf .dashhy-data

Production deployment (Vercel)

1. Push to GitHub

Push the dashhy/ folder (or the whole monorepo) to a GitHub repository.

2. Import on Vercel

Go to vercel.com/new, import the repository, and set the Root Directory to dashhy if you pushed the monorepo.

3. Add Vercel KV

In your Vercel project, go to Storage → Create → KV. This provisions a Redis instance and automatically injects the KV_REST_API_URL and KV_REST_API_TOKEN environment variables.

4. Create a GitHub OAuth App for production

Create a second OAuth App (or update the existing one) with the callback URL pointing at your Vercel deployment:

https://your-dashhy.vercel.app/api/auth/callback/github

5. Set environment variables in Vercel

In your project's Settings → Environment Variables, add:

Variable Value
GITHUB_ID Client ID of the production OAuth App
GITHUB_SECRET Client secret of the production OAuth App
NEXTAUTH_SECRET Run openssl rand -base64 32 to generate
NEXTAUTH_URL https://your-dashhy.vercel.app

6. Deploy

Vercel builds and deploys automatically. Visit your deployment URL — the dashboard is live.

7. Connect the CLI to production

In the deployed dashboard, click Connect CLI, sign in with GitHub, copy the command, and run it:

rustyochestrator connect --token <jwt> --url https://your-dashhy.vercel.app

All subsequent rustyochestrator run and rustyochestrator run-all calls on any machine that runs this command will report to the same dashboard.


Connecting the CLI

The connection is a one-time setup per machine. The token is stored at ~/.rustyochestrator/connect.json.

# Connect
rustyochestrator connect --token <jwt> --url https://your-dashhy.vercel.app

# Verify the connection is active
rustyochestrator status
# Connected
#   Dashboard : https://your-dashhy.vercel.app
#   User      : @your-github-username

# Disconnect
rustyochestrator disconnect

Once connected, run pipelines as normal — no changes to your pipeline files or workflow:

# Single workflow
rustyochestrator run pipeline.yaml

# All workflows in a directory (parallel)
rustyochestrator run-all .github/workflows

Events appear in the dashboard within seconds.


API reference

The dashboard exposes a set of API routes. All write routes require a valid Bearer JWT issued by the dashboard.

GET /api/pipelines

Returns all recorded pipelines and computed dashboard stats.

{
  "pipelines": [...],
  "stats": {
    "activePipelines": 2,
    "totalRuns": 148,
    "cacheHitRate": 76.4,
    "activeUsers": 3,
    "totalTasksRun": 1840,
    "avgDurationMs": 34200
  }
}

GET /api/batches

Returns recent batch runs (from run-all) with their full pipeline objects attached.

{
  "batches": [
    {
      "id": "uuid",
      "dir": ".github/workflows",
      "status": "success",
      "totalWorkflows": 3,
      "completedWorkflows": 3,
      "failedWorkflows": 0,
      "startedAt": "...",
      "finishedAt": "...",
      "user": "@username",
      "pipelineIds": ["...", "...", "..."],
      "pipelines": [...]
    }
  ]
}

GET /api/chart?window=<range>

Returns pipeline activity bucketed into the requested time window.

window Bucket size Bars
10m 1 minute 10
30m 3 minutes 10
1h 5 minutes 12
6h 30 minutes 12
12h 1 hour 12
24h 2 hours 12
{
  "chartData": [
    { "time": "14:00", "success": 4, "cached": 2, "failed": 0 }
  ],
  "window": "1h"
}

GET /api/cache

Returns cache statistics and a 24-hour hit/miss history.

GET /api/users

Returns all connected users and their activity stats.

GET /api/activity

Returns the last 50 activity events, newest first. Includes batch_started and batch_completed event types in addition to per-pipeline events.

POST /api/events

Ingest endpoint used by the CLI. Requires Authorization: Bearer <jwt>.

Accepted event types:

{ "type": "pipeline_started",   "pipeline_id": "...", "pipeline_name": "ci", "total_tasks": 8, "started_at": "...", "user_login": "...", "batch_id": "uuid", "batch_dir": ".github/workflows" }
{ "type": "task_completed",     "pipeline_id": "...", "task_id": "build", "cache_hit": true, "duration_ms": 0, "success": true }
{ "type": "pipeline_completed", "pipeline_id": "...", "pipeline_name": "ci", "status": "success", "total_tasks": 8, "cached_tasks": 6, "failed_tasks": 0, "duration_ms": 45000, "finished_at": "...", "user_login": "..." }
{ "type": "task_log",           "pipeline_id": "...", "task_id": "build", "level": "info", "message": "[ci] [INFO] task output..." }

batch_id and batch_dir are optional. Include them only when the pipeline is part of a run-all invocation.


Project structure

dashhy/
├── app/
│   ├── layout.tsx                  — root layout, wraps AuthProvider
│   ├── page.tsx                    — Overview dashboard (includes Batch Runs section)
│   ├── pipelines/page.tsx          — Pipeline history with filters
│   ├── pipelines/[id]/page.tsx     — Individual pipeline detail with console output
│   ├── cache/page.tsx              — Cache analytics
│   ├── users/page.tsx              — Team activity
│   ├── auth/signin/page.tsx        — OAuth error page with setup guide
│   └── api/
│       ├── events/route.ts         — CLI event ingest (POST)
│       ├── pipelines/route.ts      — Pipeline data (GET/POST)
│       ├── pipelines/[id]/route.ts — Single pipeline detail (GET)
│       ├── batches/route.ts        — Batch run data from run-all (GET)
│       ├── chart/route.ts          — Activity chart by time window (GET)
│       ├── cache/route.ts          — Cache stats and history (GET)
│       ├── users/route.ts          — User list (GET)
│       ├── activity/route.ts       — Activity feed (GET)
│       ├── pipeline-logs/route.ts  — Raw pipeline console output (GET)
│       └── auth/
│           ├── [...nextauth]/      — NextAuth GitHub OAuth handler
│           └── cli-token/route.ts  — Generates signed CLI JWT
├── components/
│   ├── Sidebar.tsx                 — Navigation with active route highlight
│   ├── Header.tsx                  — Live clock, Connect CLI button
│   ├── ConnectCLIModal.tsx         — 3-step GitHub OAuth + token flow
│   ├── AuthProvider.tsx            — NextAuth SessionProvider wrapper
│   ├── StatsCard.tsx               — Metric card with icon and trend
│   ├── PipelineChart.tsx           — Self-contained bar chart with range toggles
│   ├── PipelineTable.tsx           — Pipeline rows with status dots and batch indicator
│   ├── BatchRunCard.tsx            — Collapsible card for run-all batch tracking
│   ├── CacheDonut.tsx              — Pie/donut hit vs miss chart
│   ├── ActivityFeed.tsx            — Live scrollable event log
│   └── UsersTable.tsx              — Team members table
├── lib/
│   ├── types.ts                    — Shared TypeScript interfaces (Pipeline, BatchRun, …)
│   ├── db.ts                       — Data access layer (Vercel KV / local fallback)
│   ├── localStore.ts               — File-backed singleton store for local dev
│   └── sidebar-context.tsx         — Sidebar collapse state context
├── .env.example                    — Required environment variables
├── .gitignore
├── next.config.ts
├── tailwind.config.ts
└── vercel.json

Troubleshooting

Sign-in fails with OAuthCallback error

The GitHub OAuth App callback URL does not match. Check that it is set to exactly:

  • Local: http://localhost:3000/api/auth/callback/github
  • Production: https://your-dashhy.vercel.app/api/auth/callback/github

Dashboard shows no data after connecting the CLI

Run a pipeline and check the CLI output. If the reporter fires, you should see events within seconds. If nothing arrives:

  1. Check rustyochestrator status — verify the dashboard URL is correct
  2. Ensure NEXTAUTH_SECRET is the same value used to sign the token
  3. Check the Vercel function logs for /api/events errors

Batch runs don't appear on the Overview page

The Batch Runs section only renders when at least one batch has been recorded. Confirm that:

  1. The CLI is sending batch_id and batch_dir in each pipeline_started event when using run-all
  2. The batch_id is identical across all workflows in the same invocation
  3. Check /api/batches directly to see what the server has stored

Data resets on every npm run dev restart (local)

The .dashhy-data/db.json file should persist data. If it is not being created, check that the dashhy/ directory is writable. You can also inspect its content:

cat .dashhy-data/db.json | jq .

Users table is empty

Users are added when they sign into the dashboard and click Connect CLI (which calls POST /api/auth/cli-token). They are also added automatically the first time the CLI sends a pipeline_started event. If neither has happened yet, the table will be empty.


License

MIT — part of the rustyochestrator project.

About

A live monitoring dashboard for rustyochestrator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors