the web dashboard for black mesa at https://blackmesa.dhopcs.org/dashboard. built with Preact and Vite as a single-page application (SPA) with client-side routing.
install dependencies:
pnpm istart the dev server:
pnpm run devthis runs Vite at http://localhost:4173 with hot reload.
pnpm run buildoutputs static files to dist/. served with nginx in production + docs - see nginx.conf for config details.
| Variable | Required | Default | Description |
|---|---|---|---|
VITE_API_BASE_URL |
Yes | N/A | Complete API base URL without trailing slash. For subdomain deployment: https://api.blackmesa.bot. For path-based: https://blackmesa.dhopcs.org/api. |
VITE_DISCORD_CLIENT_ID |
Yes | N/A | Discord OAuth2 client ID for login link. |
VITE_BASE_PATH |
No | / |
Base path for deployment (e.g. /dashboard/). |
the dashboard is a single-page application (SPA) built with Preact and preact-router. it communicates with the bm-api service for all data operations (guild config, infractions, logging settings) via REST API calls. the API service in turn uses bm-lib for database access, caching, and Discord API interactions, the same as the bot service. this allows us to reuse all the core logic and data models in bm-lib without duplicating code or creating separate admin APIs in the bot.
the dashboard uses client-side routing with preact-router as a true SPA:
/→ redirects to selected guild or/guilds/login→ login page/guilds→ guild selector/oauth/discord→ OAuth callback/:guildId→ guild overview/:guildId/config/:tab?→ config editor (general, permissions, modules, etc.)/:guildId/infractions→ infractions list/:guildId/logging→ logging config/:guildId/automod→ automod editor
guild IDs are Discord snowflakes (17-20 digits). routes work both with and without guild ID prefixes for backward compatibility.
in prod, the dashboard is built and served as static files by nginx, the config and Dockerfile here is used in prod.
you can bring up the container yourself by doing
docker build -t black-mesa-dashboard . && \
docker run -d --name black-mesa-dashboard -p 8080:80 black-mesa-dashboard