Wire westside dashboard to live basketball-api data #2

Merged
forgejo_admin merged 1 commit from 1-wire-westside-dashboard-to-live-basketba into main 2026-03-13 18:48:17 +00:00
Contributor

Summary

Replace static mock data with a live fetch from the basketball-api roster endpoint. Add nginx reverse proxy to route /basketball-api/ requests to the in-cluster basketball-api service. Dashboard now shows loading state, handles errors gracefully, displays player photos when available, shows waiver status, and includes a "Send Form" button that copies the registration URL to clipboard.

Changes

  • k8s/deployment.yaml -- Added location /basketball-api/ reverse proxy block to the nginx ConfigMap, forwarding to basketball-api.basketball-api.svc.cluster.local:8000
  • 3-westside-dashboard/src/routes/+page.svelte -- Removed static $lib/data.js import; added onMount fetch from /basketball-api/api/roster/westside-kings-queens with field mapping (snake_case API -> camelCase component); added loading spinner, error state with retry, photo avatar support across all three views, waiver signed badge in admin view, "Send Form" clipboard button, and null-safe fallbacks throughout
  • 3-westside-dashboard/build/ -- Rebuilt static output

Test Plan

  • Verify the playground deployment restarts cleanly with the new nginx config
  • Confirm /basketball-api/api/roster/westside-kings-queens proxies correctly once the basketball-api endpoint is live
  • Check all three role views (Admin, Coach, Parent) render with live data
  • Verify "Send Form" button copies https://basketball-api.tail5b443a.ts.net/register?token={token} to clipboard
  • Confirm loading spinner appears while fetching and error state shows on failure

Review Checklist

  • Build passes (npm run build succeeds)
  • Nginx ConfigMap applied to cluster and deployment restarted
  • No hardcoded secrets or credentials
  • Field mapping matches expected API response shape
  • Graceful handling of missing/null fields throughout all views
  • Clipboard fallback for non-HTTPS contexts
  • Closes #1
## Summary Replace static mock data with a live fetch from the basketball-api roster endpoint. Add nginx reverse proxy to route `/basketball-api/` requests to the in-cluster basketball-api service. Dashboard now shows loading state, handles errors gracefully, displays player photos when available, shows waiver status, and includes a "Send Form" button that copies the registration URL to clipboard. ## Changes - **`k8s/deployment.yaml`** -- Added `location /basketball-api/` reverse proxy block to the nginx ConfigMap, forwarding to `basketball-api.basketball-api.svc.cluster.local:8000` - **`3-westside-dashboard/src/routes/+page.svelte`** -- Removed static `$lib/data.js` import; added `onMount` fetch from `/basketball-api/api/roster/westside-kings-queens` with field mapping (snake_case API -> camelCase component); added loading spinner, error state with retry, photo avatar support across all three views, waiver signed badge in admin view, "Send Form" clipboard button, and null-safe fallbacks throughout - **`3-westside-dashboard/build/`** -- Rebuilt static output ## Test Plan - Verify the playground deployment restarts cleanly with the new nginx config - Confirm `/basketball-api/api/roster/westside-kings-queens` proxies correctly once the basketball-api endpoint is live - Check all three role views (Admin, Coach, Parent) render with live data - Verify "Send Form" button copies `https://basketball-api.tail5b443a.ts.net/register?token={token}` to clipboard - Confirm loading spinner appears while fetching and error state shows on failure ## Review Checklist - [x] Build passes (`npm run build` succeeds) - [x] Nginx ConfigMap applied to cluster and deployment restarted - [x] No hardcoded secrets or credentials - [x] Field mapping matches expected API response shape - [x] Graceful handling of missing/null fields throughout all views - [x] Clipboard fallback for non-HTTPS contexts ## Related - Closes #1
Replace static mock data import with onMount fetch from
/basketball-api/api/roster/westside-kings-queens. Add nginx
reverse proxy location block to route /basketball-api/ to the
basketball-api service. Add loading spinner, error handling,
photo avatar support, waiver badge, and Send Form button that
copies registration URL to clipboard.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
forgejo_admin deleted branch 1-wire-westside-dashboard-to-live-basketba 2026-03-13 18:48:17 +00:00
Commenting is not possible because the repository is archived.
No reviewers
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/playground!2
No description provided.