Admin Dashboard Overhaul — UI, Backend APIs, Auth, Testing & CI #3

Closed
mik-tf wants to merge 13 commits from development_ui_enhancements into development
Owner

Summary

Enhance hero_shrimp UI to a full-featured admin interface aligned with the Hero app suite.

UI

  • Bootstrap 5.3.3 + Bootstrap Icons, matching hero_embedder's visual style
  • 9 tabs: Messages, Audit, Usage, Memories, Jobs, Config, API Docs, MCP, Logs
  • Dark/light mode with iframe detection (standalone toggle, postMessage for Hero OS)
  • Hero Auth integration — login redirect, logout with ?logout=true, JWT token flow
  • Favicon (tsunami SVG matching navbar brand)

Backend

  • POST /rpc — JSON-RPC 2.0 (15 methods: info, health, stats, messages, audit, usage, memories, jobs, config, logs, tools)
  • POST /mcp — MCP server (initialize, tools/list, tools/call, ping) + SSE transport
  • GET /openrpc.json — OpenRPC 1.2.6 spec
  • GET /api/logs — log capture, POST /api/config — .env editing
  • JWT auth via jose (HERO_SECRET) with ADMIN_TOKEN fallback
  • Static files served before auth so JS can redirect to hero_auth

Tests & CI

  • 42 smoke tests (28 basic + 14 auth)
  • 77 Playwright E2E (navigation, dashboard, API, RPC, MCP, logs, auth, broker)
  • Forgejo CI workflow (lint + integration), green on run #7

Compliance

  • Port 3384 (registered in hero_ports), snake_case package name
  • Makefile follows makefile_helper skill, buildenv.sh + `scripts/setup.sh
**Summary** Enhance hero_shrimp UI to a full-featured admin interface aligned with the Hero app suite. **UI** - Bootstrap 5.3.3 + Bootstrap Icons, matching hero_embedder's visual style - 9 tabs: Messages, Audit, Usage, Memories, Jobs, Config, API Docs, MCP, Logs - Dark/light mode with iframe detection (standalone toggle, postMessage for Hero OS) - Hero Auth integration — login redirect, logout with `?logout=true`, JWT token flow - Favicon (tsunami SVG matching navbar brand) **Backend** - `POST /rpc` — JSON-RPC 2.0 (15 methods: info, health, stats, messages, audit, usage, memories, jobs, config, logs, tools) - `POST /mcp` — MCP server (initialize, tools/list, tools/call, ping) + SSE transport - `GET /openrpc.json` — OpenRPC 1.2.6 spec - `GET /api/logs` — log capture, `POST /api/config` — .env editing - JWT auth via `jose` (HERO_SECRET) with ADMIN_TOKEN fallback - Static files served before auth so JS can redirect to hero_auth **Tests & CI** - 42 smoke tests (28 basic + 14 auth) - 77 Playwright E2E (navigation, dashboard, API, RPC, MCP, logs, auth, broker) - Forgejo CI workflow (lint + integration), green on run #7 **Compliance** - Port 3384 (registered in hero_ports), snake_case package name - Makefile follows makefile_helper skill, `buildenv.sh` + `scripts/setup.sh
feat: admin dashboard UI overhaul with Bootstrap 5, tests, and CI
Some checks failed
Test / lint (push) Successful in 15s
Test / integration (push) Failing after 37s
31aee2d24b
Tier 1 — UI Overhaul:
- Extract inline HTML from admin.ts into public/ directory
- Add Bootstrap 5.3.3 + Bootstrap Icons via CDN
- Gradient hero header with dark/light mode toggle
- Responsive layout with stat cards, nav pills, table-responsive
- Styled empty states with icons and descriptions

Tier 2 — Dashboard Polish:
- Color-coded badges for channels, roles, safety levels, status
- Usage visualization with CSS bar charts
- Grouped config display (LLM, Agent, Channels sections)
- Toast notifications for real-time SSE events
- Pagination (load more) on Messages and Audit tabs
- Copy-to-clipboard on expandable detail rows

Tier 3 — Testing & CI:
- scripts/smoke-test.sh: 29 tests (16 basic + 13 auth)
- Playwright E2E: 33 tests (navigation, dashboard, API, auth)
- .forgejo/workflows/test.yaml: lint + integration CI pipeline
- buildenv.sh: build environment config
- Enhanced Makefile with test/smoke-test/test-e2e/test-all targets

All 62 tests pass (smoke basic, smoke auth, E2E basic, E2E auth).
feat: admin dashboard UI overhaul with JSON-RPC, MCP, OpenRPC, JWT auth
Some checks failed
Test / lint (push) Successful in 11s
Test / integration (push) Failing after 41s
22d2725793
- Rewrite admin dashboard with Bootstrap 5.3.3 compact UI (9 tabs, sidebar, navbar)
- Add JSON-RPC 2.0 endpoint (POST /rpc) with 15 methods
- Add MCP server (POST /mcp) exposing agent tools + SSE transport
- Add OpenRPC 1.2.6 spec (GET /openrpc.json)
- Add server log capture with circular buffer and API/RPC access
- Add config editing endpoint (POST /api/config) writing to .env
- Add JWT auth via jose alongside existing ADMIN_TOKEN
- Add Hero Auth config (HERO_AUTH_URL, HERO_SECRET)
- Rewrite Makefile following makefile_helper skill pattern
- Add scripts/setup.sh interactive configuration helper
- Rewrite smoke tests: 28 basic + 14 auth mode
- Rewrite Playwright E2E: 80 tests (navigation, dashboard, API, RPC, MCP, logs, auth, broker)
- Update Forgejo CI workflow with lint + integration jobs
- Dark/light mode toggle with localStorage persistence
- SSE connection indicator and toast notifications
- Pagination, empty states, colored status badges
- Request logging for API/RPC/MCP endpoints
feat(ui): align dashboard to hero_embedder visual style
Some checks failed
Test / lint (push) Successful in 17s
Test / integration (push) Failing after 38s
a2af35edd2
- Navbar: flat bg-body-tertiary, no gradient, SSE status text
- Tabs: Bootstrap native nav-tabs with data-bs-toggle
- Sidebar: standard card-header/card-body pattern
- MCP cards: bg-dark border-secondary headers, pre blocks
- Logs: wrapped in card with header controls
- CSS: removed custom classes, added embedder-matching sizing
- JS: Bootstrap shown.bs.tab events, status-dot naming
- Tests: updated selectors for new HTML structure

Smoke: 28/28, Playwright: 66 pass, 15 skip
feat: theme toggle (iframe-aware), hero_auth integration, logout flow
Some checks failed
Test / lint (push) Successful in 15s
Test / integration (push) Failing after 38s
293a52bf12
- Theme toggle: show only when standalone (window.self === window.top),
  listen for postMessage hero-os-theme events when embedded
- Auth: serve static files before auth check, inject HERO_AUTH_URL into HTML,
  redirect to hero_auth on 401/403 with ?logout=true
- Logout: clear localStorage + redirect to hero_auth/login?logout=true
- Smoke tests: send auth token in basic mode when available,
  update auth tests for static-before-auth behavior (42/42 pass)
- Playwright: add fixtures.ts for localStorage token injection,
  add extraHTTPHeaders to config, update auth tests to use
  isolated request contexts (77/77 pass)
feat: add favicon.svg matching navbar tsunami icon
Some checks failed
Test / lint (push) Successful in 15s
Test / integration (push) Failing after 44s
6ce257c7bf
fix(ci): install curl in integration container
All checks were successful
Test / lint (push) Successful in 14s
Test / integration (push) Successful in 1m22s
c716a22662
The oven/bun:1 image (Debian trixie) does not include curl.
Smoke tests and health check loops all depend on curl.
fix: skill compliance — port 3384, snake_case name, update-deps target
All checks were successful
Test / lint (push) Successful in 14s
Test / integration (push) Successful in 1m23s
Test / lint (pull_request) Successful in 13s
Test / integration (pull_request) Successful in 1m23s
2797fb7ed1
- Change default admin port from 3131 to 3384 (hero_ports registry)
- Rename package.json name from hero-shrimp to hero_shrimp (naming convention)
- Add update-deps target to Makefile (makefile_helper compliance)
- Add test-results/ to .gitignore
- Update all references across CI, Dockerfile, buildenv.sh, smoke tests,
  Playwright config, auth tests, README, openrpc.json
@ -0,0 +1,8 @@
#!/bin/bash
Owner

why was this file needed?

why was this file needed?
@ -0,0 +1,129 @@
#!/bin/bash
Owner

this file is more hassle than copying th .env.example and changing it.

this file is more hassle than copying th .env.example and changing it.
@ -1,28 +1,147 @@
.PHONY: install start dev build binary clean typecheck docker-build docker-run
# ============================================================================
Owner

clean up the Makefile from any "scripting" in targets, it should be a simple name stating the dependencies and invoking a script. NO CODING in the makefile.

clean up the Makefile from any "scripting" in targets, it should be a simple name stating the dependencies and invoking a script. *NO CODING* in the makefile.
@ -0,0 +1,45 @@
import { test, expect } from "@playwright/test";
Owner

remove this file completely. broker tests are relevant to aibroker project. you won't be testing Openrouter endpoints no?

remove this file completely. broker tests are relevant to aibroker project. you won't be testing Openrouter endpoints no?
@ -0,0 +1,83 @@
name: Test
Owner

add a job to make sure the project compiles and can always build the binary. This is a must to control any messing with imports and filepaths.

add a job to make sure the project *compiles* and can always build the binary. This is a must to control any messing with imports and filepaths.
- AIBROKER_API_ENDPOINT: localhost:8080 → localhost:3385
- MCP_BROKER_ENDPOINT: localhost:8080/mcp → localhost:3385/mcp
- Add note about auto-discovery via OpenRPC
- Add rpc.discover to RPC dispatcher (returns public/openrpc.json)
- Add rpc.discover method to openrpc.json spec
- Enables automatic service discovery (heroindex pattern)
- Delete env_manager tool (env_secrets violation: wrote .env files)
- Create service_discover tool (scan/discover/health/list via OpenRPC)
- Create src/core/discovery.ts (auto-scan hero_ports, periodic health)
- Update llm_client.ts: use discovered broker if no env var set
- Update mcp.ts: use discovered MCP broker if no env var set
- Remove handleConfigSave (wrote .env) from admin.ts
- Replace config edit modal with discovered services display + rescan
- Add service:discovered and service:status SSE events
- Update getConfigData() to use real health checks
- Update tool_router and _registry for service_discover
- Initialize discovery on startup, cleanup on shutdown
- Smoke test: add rpc.discover RPC method test
- Playwright rpc.spec: add rpc.discover returns OpenRPC spec test
- Playwright dashboard.spec: config tab checks rescanBtn (replaced configEditBtn)
test: add cross-repo integration test script
All checks were successful
Test / lint (push) Successful in 17s
Test / lint (pull_request) Successful in 16s
Test / integration (push) Successful in 1m27s
Test / integration (pull_request) Successful in 1m27s
96753c7c66
- scripts/integration-test.sh: starts both aibroker and hero_shrimp
- Tests: health checks, service discovery, rpc.discover, SSE, openrpc.json
- Auto-cleanup on exit, prerequisite checks
- Not part of CI (requires both repos + API keys)
chore: gitignore entire data/ directory
Some checks are pending
Test / lint (pull_request) Successful in 16s
Test / integration (pull_request) Successful in 1m38s
Test / lint (push) Waiting to run
Test / integration (push) Blocked by required conditions
8de44f5a77
Author
Owner

Thanks @thabeta I will check all your feedback and get back to you. :D

Thanks @thabeta I will check all your feedback and get back to you. :D
Author
Owner

All feedback from this PR has been addressed in PR #4 (development_hero_zero_standardize), which includes the merge of development_ui_enhancements plus all requested fixes:

  1. Removed scripts/setup.sh
  2. Cleaned all Makefile scripting — targets are now thin wrappers, logic lives in scripts/
  3. Removed broker.spec.ts (tested aibroker, not hero_shrimp)
  4. Added CI compile job (bun build --compile) between lint and integration
  5. buildenv.sh kept as part of the standard build_lib three-layer pattern used across all hero ecosystem repos

Closing in favor of PR #4.

All feedback from this PR has been addressed in PR #4 (`development_hero_zero_standardize`), which includes the merge of `development_ui_enhancements` plus all requested fixes: 1. Removed `scripts/setup.sh` 2. Cleaned all Makefile scripting — targets are now thin wrappers, logic lives in `scripts/` 3. Removed `broker.spec.ts` (tested aibroker, not hero_shrimp) 4. Added CI compile job (`bun build --compile`) between lint and integration 5. `buildenv.sh` kept as part of the standard build_lib three-layer pattern used across all hero ecosystem repos Closing in favor of PR #4.
mik-tf closed this pull request 2026-02-11 22:29:22 +00:00
Some checks are pending
Test / lint (pull_request) Successful in 16s
Test / integration (pull_request) Successful in 1m38s
Test / lint (push) Waiting to run
Test / integration (push) Blocked by required conditions

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_shrimp!3
No description provided.