Skip to content
FangDash
Getting Started
Server admin

Admin Panel

Run your FangDash instance from the admin panel — view dashboard stats, ban or unban players, delete scores with rollback, and promote admins via CLI

The admin panel is only for accounts with the admin role. Regular players never see the Admin link. (The dev role is a cosmetic label only — it does not grant admin access.)

The admin panel lives at /admin and gives you full control over your FangDash instance: live stats, player moderation, score cleanup, and race history.

Dashboard overview

The top of the panel shows five key stats for your whole instance:

StatDescription
Total PlayersRegistered player accounts
Games PlayedGames completed across all players
Meters RunCombined distance run by everyone
Distinct RacesUnique multiplayer races held
Race EntriesTotal individual race participations

Players tab

A paginated, searchable list of every player. From here you can:

  • Search by username
  • Ban a player with a reason and an optional duration
  • Unban a previously banned player

A ban duration of 0 is permanent. Any other value bans the player for that length of time, after which they can play again automatically.

Scores tab

A paginated list of every submitted score. From here you can:

  • Review any player's runs
  • Delete a score — the player's aggregate stats (total score, distance, obstacles, games played, XP, and level) are automatically rolled back

Scores are already validated server-side when they're submitted, so blatantly forged runs are caught before they land: they're stored but grant no XP, stats, or unlocks, and they're excluded from public leaderboards. Manual deletion is for cleaning up anything that slips through or that you simply want removed.

Races tab

Race history grouped by race, showing every participant and their placement. The top three finishers get gold, silver, and bronze badges. The list is paginated.

Unlock-all-skins

The admin router exposes an unlockAllSkins mutation that unlocks every skin for the calling account (yourself) — handy for testing or capturing screenshots. It requires the admin role and is also reachable from the debug panel's CHEATS tab (Ctrl+Shift+D).

EndpointTypeDescription
unlockAllSkinsMutationUnlocks all skins for the authenticated caller (admin only). Also on the debug panel CHEATS tab

Getting admin access

Use the promote-admin CLI script to grant roles by Twitch username (case-insensitive). The user must have signed in with Twitch at least once so their account exists in the database.

# Local (default) — single user
bun run promote-admin MrDemonWolf

# Multiple users at once
bun run promote-admin MrDemonWolf SomeOtherUser

# Production (remote D1)
bun run promote-admin MrDemonWolf --remote

# Set a specific role explicitly (admin is the default target for panel access)
bun run promote-admin MrDemonWolf --role admin

You can also run it straight from the API workspace: bun run --filter @fangdash/api promote-admin MrDemonWolf

The script looks users up by their name column and prints a success or failure line for each username you pass.

Troubleshooting

"Forbidden" when opening the admin panel

Confirm your account has the admin role:

bunx wrangler d1 execute fangdash-db --remote \
  --command "SELECT id, name, role FROM user WHERE name = 'YourTwitchUsername';"

If the role is user, run bun run promote-admin YourTwitchUsername (add --remote for production), then sign out and back in.

Can't ban or unban users

Ban and unban rely on Better Auth being fully configured. If you see "Auth not configured", make sure all required secrets — BETTER_AUTH_SECRET, TWITCH_CLIENT_ID, and TWITCH_CLIENT_SECRET — are set on the API.

Banned user can still play

  • Sessions use a short cookie cache, so a banned user's current session can stay valid for up to 5 minutes before it refreshes. The ban is enforced on the next API request after that refresh.
  • All protected API routes (score submission, race results, skin equipping) check ban status and return FORBIDDEN for banned users.

Deleted score didn't update player stats

Deleting a score automatically rolls back the player's aggregates (total score, distance, obstacles, games played, XP, and level). If the numbers still look off, inspect D1 directly:

bunx wrangler d1 execute fangdash-db --remote \
  --command "SELECT total_score, games_played, total_xp, level FROM player WHERE id = 'PLAYER_ID';"

On this page