feat: Team management UI — admin draft board + coach filtered roster (Phase 10b) #16
Labels
No labels
domain:backend
domain:devops
domain:frontend
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/westside-landing#16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Lineage
plan-2026-03-08-tryout-prep→ Phase 10 (Team Placement) → Phase 10b (Frontend)Repo
forgejo_admin/westside-appUser Story
As an admin
I want a draft board page where I can assign players to teams and see team overviews
So that I can organize 45 players into teams before the season starts
As a coach
I want to see only my team's roster when I log in
So that I can focus on my players without sifting through the full roster
Context
Phase 10a (basketball-api Issue #81) adds the Team model and REST endpoints. This issue builds the frontend that consumes those endpoints. The app already has admin/coach/player role-based routing via Keycloak OIDC (Auth.js). All data fetching is server-side via
src/lib/server/api.js— the client never calls basketball-api directly.Key patterns already established:
+page.server.js, form actions for mutationsuse:enhance+invalidateAll()for reactive updatessession.roles.includes('admin')File Targets
Files the agent should create:
src/routes/admin/teams/+page.server.js— load teams + unassigned players from basketball-api, form actions for create/assign/unassignsrc/routes/admin/teams/+page.svelte— admin draft board UI: team cards with player lists, unassigned player pool, assignment controlssrc/routes/teams/+page.server.js— load team overview (public summary or auth-gated)src/routes/teams/+page.svelte— team overview page (all teams, player counts, coaches)Files the agent should modify:
src/lib/server/api.js— add functions:fetchTeams(),fetchTeam(teamId),fetchTeamOverview(),createTeam(),assignPlayers(teamId, playerIds),unassignPlayer(teamId, playerId),fetchMyTeam(token)src/lib/components/AuthStatus.svelte— add "Teams" nav link for admin rolesrc/routes/coach/+page.server.js— modify to fetch coach's assigned team viaGET /api/teams/mineinstead of full roster (pass auth token)src/routes/coach/+page.svelte— show team name and coach assignment at top of rosterFiles the agent should NOT touch:
src/routes/admin/users/— user management is separatesrc/lib/server/keycloak-admin.js— no Keycloak changes neededsrc/routes/player/— player view is Phase 11Acceptance Criteria
/admin/teamsshows all teams with player counts and assigned coach/coach) shows ONLY their team's roster (filtered by Keycloak identity)Test Expectations
Constraints
src/lib/server/api.js, called from+page.server.jsuse:enhance+invalidateAll()BASKETBALL_API_URLenv var from$env/dynamic/private/api/teams/mine)npm run checkandnpm run lintbefore committingChecklist
Related
westside-basketball— project