How andrewflbarnes/krm-ui works
Kings Results Manager is a browser-based tool for configuring and running Kings ski races, then recording and viewing their results. The main workflow is to load league/team data, configure teams and rounds, run races through their stages, enter results, and review standings. Round configuration and race progression are distinct domain steps, supported by Kings-specific scheduling and result utilities. The README describes optional Clerk login and Firestore persistence, plus scraping Kingsski.club for configuration data. Some page-to-API wiring is unsampled, so only documented or excerpt-supported links are shown.
Main entry points: App.tsx Routes and providers · krm.ts Round lifecycle API · auth.tsx Optional sign-in · RaceNew.tsx Round setup flow
Components 22
Application
- Routes and providers
src/App.tsx - Home and portal
src/pages/Home.tsx
League setup
- League configuration
src/pages/Config.tsx - Team setup
src/pages/TeamConfig.tsx - League config loader
netlify/functions/ksc-results/ksc-results.mts - Kings domain model
src/kings/config.ts - Round config editor
src/pages/ConfigRound.tsx
Race operations
- Round setup flow
src/pages/RaceNew.tsx - Round lifecycle API
src/api/krm.ts - Race stage pages
src/pages/RaceInProgress.tsx - Race result entry
src/components/MiniLeague.tsx - Scheduling and scoring
src/kings/utils/index.ts
Results and tracking
- Round listing
src/ui/RoundInfoList.tsx - Race results view
src/pages/Race.tsx - League tracker
src/pages/Tracker.tsx - Tracker data API
src/api/tracker.ts
Identity and persistence
- Optional sign-in
src/hooks/auth.tsx - Firebase integration
src/firebase.ts
Other components
- Race organizer
- Firestore
- Clerk identity
- Kingsski.club
Connections 26
- Race organizer → Routes and providers: uses
- Routes and providers → Home and portal: routes to
- Routes and providers → League configuration: routes to
- Routes and providers → Team setup: routes to
- Routes and providers → Round setup flow: routes to
- Routes and providers → Race stage pages: routes to
- Routes and providers → League tracker: routes to
- Team setup → League config loader: requests config
- League config loader → Kingsski.club: scrapes
- Round setup flow → Kings domain model: reads config
- Round setup flow → Scheduling and scoring: seeds teams
- Round config editor → Kings domain model: edits templates
- Round lifecycle API → Scheduling and scoring: calculates progression
- Round lifecycle API → Firestore: syncs rounds
- Round lifecycle API → Firestore: loads rounds
- Race stage pages → Round lifecycle API: loads and advances
- Race result entry → Scheduling and scoring: calculates results
- Race stage pages → Race result entry: presents stage
- Round listing → Round lifecycle API: displays rounds
- Race results view → Round lifecycle API: loads race
- League tracker → Tracker data API: requests standings
- Tracker data API → Kingsski.club: fetches results
- Optional sign-in → Clerk identity: authenticates
- Optional sign-in → Firebase integration: signs in
- Optional sign-in → Firestore: writes user profile
- Firebase integration → Firestore: connects