1.9 KiB
1.9 KiB
Habland Admin Panel
Next.js 16 control surface for managing the multi-emulator stack (Arcturus, Havana, Kepler, Roseau) from one UI. Ships with container controls, live stats, config editing, and log viewing.
Prerequisites
- Node.js 20+
- Docker running locally (the app talks to the Docker socket when containerized)
.envwith admin credentials (see below)
Quickstart (local dev)
cd admin-panel
npm install
cp ../.env.example .env # reuse root values; add admin credentials
npm run dev # http://localhost:3000
Production (Docker Compose)
The root docker-compose.yml builds this app as admin-panel on port 3000 and mounts /var/run/docker.sock so it can manage other containers. Update .env before docker compose up -d.
Key Features
- Container manager: start/stop/restart per service or per emulator group
- Live stats cards: online counts per emulator (polls
/api/stats) - Config editor: edit mounted emulator configs directly from the UI
- Log viewer: tail per-container logs with filtering
- Global search and quick actions (keyboard shortcuts supported)
Scripts
npm run dev– start Next dev servernpm run build– production buildnpm start– serve built appnpm run lint– lint the codebase
Environment Variables
Define in .env (or the root .env that gets baked into Docker):
ADMIN_USER/ADMIN_PASSWORD– required. Basic credential pair used by the credentials auth provider insrc/auth.ts.
Useful Paths
- UI entry:
src/app/page.tsx - Dashboard:
src/components/Dashboard.tsx - API routes:
src/app/api/* - Auth config:
src/auth.ts,src/auth.config.ts
Notes
- The dashboard polls
/api/containersand/api/statsevery few seconds; ensure the emulator containers and the unified DB are up for meaningful data. - When running via Docker, the app needs access to the Docker socket for container control.