Consolidate room leave/delete event handling into RoomManager emitter, remove redundant PLAYER_LEFT publishes from GameServer, and delete the chess game plugin (board, types, tests) in favor of the new plugin architecture. Add per-module CLAUDE.md files for leveling, guild-settings, feature-flags, db, api, and panel to improve agent navigability. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1.5 KiB
1.5 KiB
Panel (Admin Dashboard)
Stack
- React 19 + React Router v7 + Tailwind CSS v4 (Vite plugin) + Lucide icons.
- No component library (no Radix, no shadcn). All styling is inline Tailwind.
- No external state management. All state via custom hooks (
useAuth,useUsers,useItems,useDashboard,useGameRoom).
API Client
- Thin
fetchwrapper insrc/lib/api.tswith typed generics:get,post,put,del. - Credentials:
same-originonly — CORS requests will fail. - 401 responses redirect to Discord auth. No retry logic.
- 204 / empty responses return
undefined.
WebSocket
- Singleton pattern in
useWebSocket(). Global handler Set — multiple hooks share one connection. - Auto-reconnects with exponential backoff (max 30s).
send()andsubscribe()API for components.
Patterns
- Draft editing: Pages use
selectedUser → userDraftflow. Changes aren't auto-saved.saveDraft()commits,discardDraft()reverts,isDirty()detects changes. - Debounced search: 300ms debounce on search inputs.
- No cache invalidation: After mutations, manually call
refetch()to update lists.
Routing
- Role-based: player routes (
/dashboard,/games,/leaderboards) and admin routes (/admin/*). - Sidebar auto-hides admin routes for non-admins.
Theme
- Dark theme with "Celestial Gold" primary (
#e9c349). - Semantic colors: destructive, success, warning, info.
- 4-tier surface hierarchy. Utility:
cn()fromclsx + tailwind-merge.