Admin Panel
Managing players, scores, and races from the FangDash admin panel.
The admin panel is only accessible to users with admin or dev roles. Regular players
will not see the Admin link.
TL;DR - Dashboard with player count, games played, total meters, and race stats - Manage
players (search, ban/unban) and scores (flag suspicious, delete) - Use the promote-admin CLI
script to grant admin access by Twitch username
The admin panel lives at /admin and gives you full control over your FangDash instance.
Dashboard Overview
The top of the admin panel shows five key stats:
| Stat | Description |
|---|---|
| Total Players | Number of registered player accounts |
| Games Played | Total games completed across all players |
| Meters Run | Combined distance run by everyone |
| Distinct Races | Number of unique multiplayer races held |
| Race Entries | Total individual race participations |
Players Tab
A paginated, searchable list of all players.
You can:
- Search by username
- Ban a player with a reason and optional duration
- Unban a previously banned player
Scores Tab
A paginated list of all submitted scores.
The admin panel highlights suspicious scores that look abnormally high for their run duration. You can:
- Review flagged scores
- Delete a score — the player's aggregate stats (total score, distance, etc.) are automatically rolled back
Races Tab
Race history grouped by race, showing all participants and their placements. Top 3 placements get gold, silver, and bronze badges.
Getting Admin Access
Use the promote-admin CLI script to grant roles by Twitch username (case-insensitive). The user must have logged in at least once.
# Local (default) — single user
bun run promote-admin MrDemonWolf
# Multiple users at once
bun run promote-admin MrDemonWolf SomeOtherUser
# Production
bun run promote-admin MrDemonWolf --remote
# Set a different role (e.g. dev)
bun run promote-admin MrDemonWolf --role devYou can also run the script directly from the API workspace: bun run --filter @fangdash/api promote-admin MrDemonWolf
The script looks up users by their name column in the database and prints success/failure for each username.
API Endpoints
The admin tRPC router includes the following mutations and queries used by the admin panel:
| Endpoint | Type | Description |
|---|---|---|
unlockAllSkins | Mutation | Unlocks all skins for the authenticated player (dev/admin only). Also accessible from the debug panel's CHEATS tab. |
Troubleshooting
"Forbidden" when accessing admin panel
- Verify your user has the
adminordevrole. Check with:
bunx wrangler d1 execute fangdash-db --remote \
--command "SELECT id, name, role FROM user WHERE name = 'YourTwitchUsername';"- If the role is
user, runbun run promote-admin YourTwitchUsername(add--remotefor production).
Can't ban or unban users
- The ban/unban actions require Better Auth to be fully configured. If you see "Auth not configured", ensure all required secrets (
BETTER_AUTH_SECRET,TWITCH_CLIENT_ID,TWITCH_CLIENT_SECRET) are set.
Banned user can still play
- After banning a user, their active sessions continue until they expire (up to 30 minutes with cookie caching). The ban is enforced on the next API request after session refresh.
- All protected API routes (score submission, race results, skin equipping) check ban status and return
FORBIDDENfor banned users.
Deleted score didn't update player stats
- Score deletion automatically rolls back the player's aggregate stats (total score, distance, obstacles, games played, XP, and level). If stats look wrong, check the D1 database directly:
bunx wrangler d1 execute fangdash-db --remote \
--command "SELECT total_score, games_played, total_xp, level FROM player WHERE id = 'PLAYER_ID';"