[Relay] Admin Panel — Event Queue + Account Whitelist Dashboard #49

Closed
opened 2026-03-21 00:41:35 +00:00 by replit · 1 comment
Owner

What & Why

Timmy's relay operator needs a dashboard to oversee the relay without touching a CLI or SQL. This panel surfaces the event moderation queue, the account whitelist, and key relay health stats inside the existing Matrix workshop UI — scoped behind a simple admin gate.

Done looks like

  • New "Relay" section in Matrix UI sidebar (or /admin/relay route), visible only when ADMIN_TOKEN env var is set and user supplies it on first load
  • Queue tab: Lists pending events with sender pubkey (truncated), event kind, content preview, timestamp. Each row has Approve/Reject buttons calling admin queue endpoints
  • Accounts tab: Lists all relay accounts with access level, trust tier, granted date, and a Revoke button. Has pubkey input + "Grant write access" button for manual whitelist
  • Stats bar: Total events approved today, total pending, total accounts, live relay connection count
  • All admin API calls use ADMIN_TOKEN as Bearer header; token stored in localStorage after first entry

Out of scope

  • Mobile-responsive layout
  • Per-event full content viewer (preview only)
  • Relay log streaming in UI

Tasks

  1. Admin auth gate — On first visit to /admin/relay, prompt for token, store in localStorage, include as Bearer on all admin API calls. API server validates against ADMIN_TOKEN env var.
  2. Queue tab component — Fetch GET /api/admin/relay/queue?status=pending; render event list with Approve/Reject buttons; refresh every 15 s.
  3. Accounts tab component — Fetch GET /api/admin/relay/accounts; render whitelist table with Revoke button; pubkey input form for manual grants.
  4. Stats bar — Fetch GET /api/admin/relay/stats (event counts by status today, account count); render as metric cards at top of panel.
  5. Wire into Matrix UI — Add "Relay" nav entry in sidebar. Protect route behind admin token presence in localStorage.

Relevant files

  • artifacts/api-server/src/routes/index.ts
  • the-matrix/js/ui.js
  • the-matrix/index.html
## What & Why Timmy's relay operator needs a dashboard to oversee the relay without touching a CLI or SQL. This panel surfaces the event moderation queue, the account whitelist, and key relay health stats inside the existing Matrix workshop UI — scoped behind a simple admin gate. ## Done looks like - New "Relay" section in Matrix UI sidebar (or `/admin/relay` route), visible only when `ADMIN_TOKEN` env var is set and user supplies it on first load - **Queue tab**: Lists pending events with sender pubkey (truncated), event kind, content preview, timestamp. Each row has Approve/Reject buttons calling admin queue endpoints - **Accounts tab**: Lists all relay accounts with access level, trust tier, granted date, and a Revoke button. Has pubkey input + "Grant write access" button for manual whitelist - **Stats bar**: Total events approved today, total pending, total accounts, live relay connection count - All admin API calls use `ADMIN_TOKEN` as Bearer header; token stored in localStorage after first entry ## Out of scope - Mobile-responsive layout - Per-event full content viewer (preview only) - Relay log streaming in UI ## Tasks 1. **Admin auth gate** — On first visit to `/admin/relay`, prompt for token, store in localStorage, include as Bearer on all admin API calls. API server validates against `ADMIN_TOKEN` env var. 2. **Queue tab component** — Fetch `GET /api/admin/relay/queue?status=pending`; render event list with Approve/Reject buttons; refresh every 15 s. 3. **Accounts tab component** — Fetch `GET /api/admin/relay/accounts`; render whitelist table with Revoke button; pubkey input form for manual grants. 4. **Stats bar** — Fetch `GET /api/admin/relay/stats` (event counts by status today, account count); render as metric cards at top of panel. 5. **Wire into Matrix UI** — Add "Relay" nav entry in sidebar. Protect route behind admin token presence in localStorage. ## Relevant files - `artifacts/api-server/src/routes/index.ts` - `the-matrix/js/ui.js` - `the-matrix/index.html`
replit added the frontendbackendnostr labels 2026-03-21 00:41:35 +00:00
claude was assigned by Rockachopa 2026-03-22 23:37:26 +00:00
Collaborator

PR #75 created. The admin panel (auth gate, stats bar, queue tab, accounts tab) was already fully implemented in admin-relay-panel.ts with supporting APIs in admin-relay.ts and admin-relay-queue.ts. This PR wires it into the Matrix UI by adding a "RELAY ADMIN" button to the top action bar, visible only when the admin token is in localStorage.

PR #75 created. The admin panel (auth gate, stats bar, queue tab, accounts tab) was already fully implemented in `admin-relay-panel.ts` with supporting APIs in `admin-relay.ts` and `admin-relay-queue.ts`. This PR wires it into the Matrix UI by adding a "RELAY ADMIN" button to the top action bar, visible only when the admin token is in localStorage.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: replit/timmy-tower#49