How laboffuture/admin-dash works
Purpose and entry points
ADMIN-LINK is a password-gated central operations portal for LOF projects. It renders a registered project catalog, reports live reachability, embeds a selected project’s existing admin page, and provides an agent chat surface. Backend startup is server/index.js; HTTP composition is in server/app.js. The browser starts at client/src/main.jsx and mounts the application in client/src/App.jsx.
Project registry and module boundary
projects.json is the runtime registry and primary extensibility boundary: each project is added as data rather than a client rebuild. server/registry.js loads and validates/exposes registry content to API consumers. Registry entries drive the sidebar/catalog, selected-project view, status checks, and iframe destination; remote modules remain independently deployed systems rather than code imported into this repository.
Authentication and API boundary
The server exposes the hub’s /api surface through server/app.js. server/auth.js implements the single-password authentication flow backed by ADMIN_PASSWORD from environment configuration. The client’s API contract is centralized in client/src/api.js, while client/src/components/Login.jsx gates access to hub functionality. This separates browser session/UI handling from server-side password verification and protected operations.
Project status polling
server/poller.js performs server-side health/reachability polling for registered module URLs, avoiding browser-side cross-origin checks and presenting status through the hub API. server/registry.js supplies project targets; server/app.js exposes resulting state. The frontend consumes updates through client/src/hooks/useHubMessages.js, allowing status and hub events to update independently of iframe content.
Hub workspace UI
client/src/components/Dashboard.jsx is the authenticated shell coordinating navigation and workspace state. client/src/components/Sidebar.jsx presents the project list/navigation; client/src/components/Viewport.jsx hosts the selected project admin page, expected to accept ?embed=1. client/src/components/Overview.jsx provides the no-selection or hub-level view. The iframe is an explicit isolation boundary: ADMIN-LINK does not own embedded module UI or its internals.
Agent and operational data
server/agent.js provides the backend agent integration used by client/src/components/AgentChat.jsx. server/rates.js supplies related rate/usage or request-control data for that service. Agent interaction remains server-mediated, protecting credentials and external-provider calls from the browser. The agent-specific architecture is further documented in agent/ARCHITECTURE.md.
Runtime and deployment shape
The frontend is a Vite/React application (client/package.json, client/vite.config.js); the backend is a Node.js service (server/package.json, server/index.js). In development, Vite proxies /api to the API service. Production process orchestration is represented by ecosystem.config.js; reverse-proxy integration is documented/configured through docs/nginx-admin-link.conf. Environment secrets belong outside the repository, with .env.example defining expected inputs.
Main entry points: Dashboard.jsx Workspace shell · app.js API composition · App.jsx Hub app · poller.js Reachability poller
Components 20
Browser client
- React entry
client/src/main.jsx - Hub app
client/src/App.jsx - Login gate
client/src/components/Login.jsx - API contract
client/src/api.js - Workspace shell
client/src/components/Dashboard.jsx - Project navigation
client/src/components/Sidebar.jsx - Hub overview
client/src/components/Overview.jsx - Embedded viewport · Hosts the selected project admin page with embed mode.
client/src/components/Viewport.jsx - Status event hook
client/src/hooks/useHubMessages.js - Agent chat
client/src/components/AgentChat.jsx
Node API service
- Server startup
server/index.js - API composition · Exposes the protected /api surface.
server/app.js - Password auth · Verifies the single ADMIN_PASSWORD credential.
server/auth.js - Project registry · Loads and validates registered project targets.
server/registry.js - Reachability poller · Checks module URLs server-side to avoid browser cross-origin checks.
server/poller.js - Agent integration · Mediates provider calls and protects credentials.
server/agent.js - Rate and usage data
server/rates.js
Independent systems
- Remote project admin pages · Externally deployed modules, not imported hub code.
- Agent provider
Other components
- Registered projects · Primary data-driven extension boundary for projects.
projects.json
Connections 21
- React entry → Hub app: mounts
- Hub app → Login gate: gates access
- Hub app → Workspace shell: authenticated workspace
- Login gate → API contract: auth request
- Workspace shell → Project navigation: renders
- Workspace shell → Hub overview: renders
- Workspace shell → Embedded viewport: selects project
- Workspace shell → Status event hook: subscribes
- Workspace shell → Agent chat: renders
- API contract → API composition: /api
- Server startup → API composition: starts
- API composition → Password auth: authenticates
- API composition → Project registry: serves catalog
- API composition → Reachability poller: serves status
- API composition → Agent integration: mediates chat
- Project registry → Registered projects: loads
- Reachability poller → Project registry: gets targets
- Reachability poller → Remote project admin pages: checks reachability
- Embedded viewport → Remote project admin pages: iframe ?embed=1
- Agent integration → Rate and usage data: uses
- Agent integration → Agent provider: server-side calls