@galaxy-stack/orbit-devtools
Developer dashboard for the Orbit framework — live routes, DI graph, module map and request metrics in a browser panel.
Installation
bun add @galaxy-stack/orbit-devtools
Usage
import { createDevtools } from '@galaxy-stack/orbit-devtools';
import { DevtoolsDashboard } from '@galaxy-stack/orbit-devtools';
const dashboard = createDevtools({
title: 'My App Devtools',
port: 9229,
path: '/__devtools',
theme: 'dark',
auth: { enabled: true, username: 'dev', password: 'secret' },
refreshInterval: 1000,
});
dashboard.setRoutes(routes);
dashboard.setProviders(providers);
dashboard.setModules(modules);
dashboard.pushMetrics({
requestsPerSecond: 120,
avgLatency: 2.5,
errorRate: 0,
activeConnections: 8,
memoryUsage: process.memoryUsage().heapUsed,
cpuUsage: 0.1,
});
Bun.serve({
port: 9229,
fetch: dashboard.createHandler(),
});
Features
- Overview panel — live route/provider/module counts and request metrics
- Routes table — methods, paths, handlers, guards, pipes, interceptors
- DI graph — providers grouped by scope (singleton / request / transient) with dependency links
- Modules map — controllers, providers, imports, exports per module
- Metrics timeline — RPS, latency, error rate, connections, memory (last 10 snapshots)
- JSON API —
GET /__devtools/api/data returns the full dashboard data for external tooling
- Auth — optional basic auth on the dashboard
Notes
- Metrics history is bounded to 60 snapshots; the render shows the last 10.
- The dashboard script polls
${path}/api/data every refreshInterval ms.