Admin Hub¶
The Admin Hub provides a dashboard for monitoring pipeline jobs, managing AI agents, viewing billing data, and managing the beta waitlist.
Overview¶
Backend: /opt/mdu-api/admin-hub.js (ESM module)
Frontend: admin.minidreamuniverse.com
All admin endpoints require JWT authentication + admin email verification.
Endpoints¶
Pipeline¶
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/admin/pipeline/jobs |
Admin | List pipeline jobs |
| GET | /api/admin/pipeline/metrics |
Admin | Daily pipeline metrics |
| GET | /api/admin/pipeline/stream |
Admin | SSE real-time updates |
Agents¶
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/admin/agents |
Admin | List registered agents |
| POST | /api/admin/agents |
Admin | Register new agent |
| GET | /api/admin/agents/stream |
Admin | SSE agent updates |
| GET | /api/admin/agents/:id |
Admin | Get agent details |
| PUT | /api/admin/agents/:id |
Admin | Update agent |
| DELETE | /api/admin/agents/:id |
Admin | Delete agent |
Note
/agents/stream is registered before /agents/:id to prevent "stream" from matching as an agent ID.
Billing¶
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/admin/billing/overview |
Admin | Revenue overview |
| GET | /api/admin/billing/invoices |
Admin | Recent invoices |
Waitlist¶
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/admin/waitlist |
Admin | List waitlist entries |
| POST | /api/admin/waitlist/invite |
Admin | Send invite to waitlisted user |
| GET | /api/admin/waitlist/funnel |
Admin | Conversion funnel metrics |
RAG¶
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /api/admin/rag/ingest |
Admin | Chunk + embed + store document |
| POST | /api/admin/rag/query |
Admin | Semantic search + LLM answer |
| GET | /api/admin/rag/documents |
Admin | List stored documents |
| GET | /api/admin/rag/metrics |
Admin | RAG usage metrics |
| DELETE | /api/admin/rag/documents/:id |
Admin | Delete document |
Logs¶
| Method | Path | Auth | Description |
|---|---|---|---|
| WS | /ws/admin/logs |
Admin | Docker log streaming |
WebSocket authentication via query parameter: /ws/admin/logs?token=<jwt>.
Container whitelist limits which Docker containers can be streamed.
Database Tables¶
| Table | Purpose |
|---|---|
pipeline_jobs |
Pipeline job tracking |
pipeline_events |
Pipeline event log |
pipeline_metrics_daily |
Aggregated daily metrics |
agent_registry |
Registered AI agents (15 seeded) |
agent_runs |
Agent execution history |
waitlist |
Beta waitlist entries |
Real-Time Features¶
SSE (Server-Sent Events)¶
Pipeline and agent streams use polling-based SSE:
const events = new EventSource('/api/admin/pipeline/stream', {
headers: { 'Authorization': `Bearer ${token}` }
});
events.onmessage = (e) => {
const data = JSON.parse(e.data);
// Update dashboard
};
WebSocket (Docker Logs)¶
const ws = new WebSocket(`wss://admin.minidreamuniverse.com/ws/admin/logs?token=${token}`);
ws.onmessage = (e) => {
const log = JSON.parse(e.data);
// { container, timestamp, message }
};
Nginx is configured with WebSocket upgrade headers and SSE proxy_buffering off.