@galaxy-stack/orbit-devtools
v0.9.0
Published
Developer tools dashboard for Orbit - routes, DI graph, real-time metrics
Readme
@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-devtoolsUsage
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,
});
// feed it live data from your app
dashboard.setRoutes(routes); // method, path, controller, handler
dashboard.setProviders(providers); // name, scope, dependencies, module
dashboard.setModules(modules); // controllers, providers, imports, exports
dashboard.pushMetrics({
requestsPerSecond: 120,
avgLatency: 2.5,
errorRate: 0,
activeConnections: 8,
memoryUsage: process.memoryUsage().heapUsed,
cpuUsage: 0.1,
});
// serve over HTTP — HTML dashboard + JSON data endpoint
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/datareturns 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/dataeveryrefreshIntervalms.
