Skip to content

feat(dashboard): add monitoring dashboard package#4

Open
AllyMurray wants to merge 30 commits intomainfrom
feat/dashboard
Open

feat(dashboard): add monitoring dashboard package#4
AllyMurray wants to merge 30 commits intomainfrom
feat/dashboard

Conversation

@AllyMurray
Copy link
Owner

Summary

  • Adds @http-client-toolkit/dashboard — a browser-based React SPA for monitoring cache, dedup, and rate limit stores in real time
  • Supports multiple named clients scoped under /api/clients/:name/... so applications with several HTTP clients can monitor them independently
  • Provides three integration modes: Node.js middleware (createDashboard), Web Standards fetch handler (createDashboardHandler), and standalone server (startDashboard)
  • Auto-detects store backends (Memory, SQLite, DynamoDB) and adapts UI capabilities accordingly
  • Adds listing methods to store-memory and store-sqlite for dashboard support
  • Includes docs-site page with screenshots and full API reference

Test plan

  • 151 dashboard tests pass (config, middleware, web handler, integration, adapters)
  • 895 total monorepo tests pass
  • pnpm build succeeds (Vite client + tsup server)
  • pnpm lint clean
  • Docs-site builds with optimized screenshots
  • Manual verification via examples/dev-server.ts with multi-client setup

🤖 Generated with Claude Code

AllyMurray and others added 30 commits February 17, 2026 09:02
Add listEntries(), listJobs(), and listResources() to in-memory store
implementations to enable paginated browsing via the dashboard UI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add listEntries(), listJobs(), and listResources() to SQLite store
implementations using Drizzle ORM queries with LIMIT/OFFSET pagination.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Create the @http-client-toolkit/dashboard package with Vite (client SPA)
and tsup (server middleware) dual build setup, Zod config schemas, and
public API entry point exporting createDashboard and startDashboard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement adapter layer that wraps concrete store implementations
(Memory, SQLite) with a uniform interface. Runtime duck-typing detects
the store backend automatically. Generic fallback for unknown stores.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement REST API with handlers for cache, dedup, and rate limit
operations. Includes embedded middleware (createDashboard), standalone
server (startDashboard), static file server with SPA fallback, and
request/response helpers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement browser dashboard with hash-based routing, polling hooks, and
capabilities-aware components for cache entries, dedup jobs, and rate
limit resources. Includes data tables, stat cards, pagination, and
confirmation dialogs for destructive actions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add dashboard TypeScript project reference and update pnpm-lock.yaml
for new dashboard dependencies. Core file has formatting-only changes
from linter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update root README with dashboard package link. Add dashboard guide
page to Starlight docs-site covering installation, embedded middleware,
standalone server, configuration, supported backends, and API endpoints.
Update sidebar, landing page, introduction, and installation pages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a root npm script to start the dashboard with seeded in-memory
stores for local development and testing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace default system fonts with DM Sans and JetBrains Mono, refine
the dark color palette, and restructure the overview layout to use
inline stat components instead of StatsCard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add createDashboardHandler() returning (Request) => Promise<Response>
for use with Hono, Bun, Deno, and other Web Standards-compatible
runtimes. Shares the same DashboardContext and store adapters as the
existing Node middleware.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Test all API routes, store-not-configured 404s, SPA fallback, and
basePath support using direct Request objects without an HTTP server.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wrap createDashboardHandler in a Node http server via a toNodeHandler
adapter and make real HTTP requests against it, proving the
Request/Response contract works end-to-end over the network.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add integration tests for single dedup job lookup, single rate limit
resource lookup, PUT config with JSON body parsing, 405 method not
allowed, and basePath support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Document createDashboardHandler() with usage examples for Hono, Bun,
and Deno alongside the existing middleware and standalone sections.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace DashboardOptionsSchema with ClientConfigSchema + multi-client
DashboardOptionsSchema. Client names must be URL-safe, unique, and each
client must provide at least one store.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ypes

Rename DashboardContext to ClientContext (with name field) and add
MultiClientContext wrapping a Map of clients. Update handleHealth to
return per-client store info and rename handleStores to handleClients.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… paths

Change extractParam patterns from /api/cache/entries/:hash to
/cache/entries/:hash (and similar for dedup and rate-limit handlers)
so routers can strip the /api/clients/:name prefix before dispatching.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Refactor api-router, web-handler, and middleware to accept
MultiClientContext. Routes are now /api/health (aggregate),
/api/clients (list), and /api/clients/:name/... (per-client store
endpoints). Unknown client names return 404.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add ClientStoreInfo and ClientInfo types, replace StoreInfo. All store
API methods now take clientName as first parameter and route through
/api/clients/:name/... paths. Add api.clients() endpoint.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update useCacheStats, useCacheEntries, useDedupeStats, useDedupeJobs,
useRateLimitStats, and useRateLimitResources to accept clientName as
first parameter and pass it to API calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add client selection state to App with hash format #clientName/view.
Layout gains client selector buttons in sidebar. All view components
now receive clientName, stores, and pollIntervalMs props instead of
the full HealthResponse. Add client-selector CSS styles.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rewrite middleware, web-handler, web-handler integration, and standalone
tests to use clients config and /api/clients/:name/... paths. Add
multi-client routing tests and unknown client 404 tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Show two named clients (user-api and product-api) with independent
stores and seeded test data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant