2025-10-11 00:07:39 -07:00
|
|
|
import { type RouteConfig, index, route } from "@react-router/dev/routes";
|
2025-10-10 23:04:50 -07:00
|
|
|
|
2025-10-11 00:07:39 -07:00
|
|
|
export default [
|
|
|
|
|
index("routes/home.tsx"),
|
2025-10-14 12:20:36 -07:00
|
|
|
route("i/:inviteCode", "routes/i.$inviteCode.tsx"),
|
2025-10-11 00:07:39 -07:00
|
|
|
route("leagues/new", "routes/leagues/new.tsx"),
|
|
|
|
|
route("leagues/:leagueId", "routes/leagues/$leagueId.tsx"),
|
2025-10-11 00:29:04 -07:00
|
|
|
route("leagues/:leagueId/settings", "routes/leagues/$leagueId.settings.tsx"),
|
2026-03-27 00:49:16 -07:00
|
|
|
route(
|
|
|
|
|
"leagues/:leagueId/upcoming-events",
|
|
|
|
|
"routes/leagues/$leagueId.upcoming-events.tsx"
|
|
|
|
|
),
|
2025-11-12 23:44:33 -08:00
|
|
|
route(
|
|
|
|
|
"leagues/:leagueId/sports-seasons/:sportsSeasonId",
|
|
|
|
|
"routes/leagues/$leagueId.sports-seasons.$sportsSeasonId.tsx"
|
|
|
|
|
),
|
2025-10-17 12:30:58 -07:00
|
|
|
route(
|
|
|
|
|
"leagues/:leagueId/draft/:seasonId",
|
|
|
|
|
"routes/leagues/$leagueId.draft.$seasonId.tsx"
|
|
|
|
|
),
|
2025-10-20 15:03:11 -07:00
|
|
|
route(
|
|
|
|
|
"leagues/:leagueId/draft-board/:seasonId",
|
|
|
|
|
"routes/leagues/$leagueId.draft-board.$seasonId.tsx"
|
|
|
|
|
),
|
2025-11-13 13:24:03 -08:00
|
|
|
route(
|
|
|
|
|
"leagues/:leagueId/standings/:seasonId",
|
|
|
|
|
"routes/leagues/$leagueId.standings.$seasonId.tsx"
|
|
|
|
|
),
|
2025-11-14 20:01:21 -08:00
|
|
|
route(
|
|
|
|
|
"leagues/:leagueId/standings/:seasonId/teams/:teamId",
|
|
|
|
|
"routes/leagues/$leagueId.standings.$seasonId.teams.$teamId.tsx"
|
|
|
|
|
),
|
2025-10-14 22:04:37 -07:00
|
|
|
route("teams/:teamId/settings", "routes/teams/$teamId.settings.tsx"),
|
2025-10-11 00:53:39 -07:00
|
|
|
route("api/webhooks/clerk", "routes/api/webhooks/clerk.ts"),
|
2025-10-17 17:42:40 -07:00
|
|
|
route("api/queue/add", "routes/api/queue.add.ts"),
|
|
|
|
|
route("api/queue/remove", "routes/api/queue.remove.ts"),
|
|
|
|
|
route("api/queue/clear", "routes/api/queue.clear.ts"),
|
|
|
|
|
route("api/queue/reorder", "routes/api/queue.reorder.ts"),
|
2025-10-18 14:55:26 -07:00
|
|
|
route("api/draft/make-pick", "routes/api/draft.make-pick.ts"),
|
|
|
|
|
route("api/draft/start", "routes/api/draft.start.ts"),
|
2025-10-18 23:19:41 -07:00
|
|
|
route("api/draft/pause", "routes/api/draft.pause.ts"),
|
|
|
|
|
route("api/draft/resume", "routes/api/draft.resume.ts"),
|
2025-10-18 14:55:26 -07:00
|
|
|
route("api/draft/force-autopick", "routes/api/draft.force-autopick.ts"),
|
|
|
|
|
route("api/draft/force-manual-pick", "routes/api/draft.force-manual-pick.ts"),
|
2026-02-20 22:47:29 -08:00
|
|
|
route("api/draft/replace-pick", "routes/api/draft.replace-pick.ts"),
|
|
|
|
|
route("api/draft/rollback", "routes/api/draft.rollback.ts"),
|
2026-02-22 16:16:51 -08:00
|
|
|
route("api/draft/adjust-time-bank", "routes/api/draft.adjust-time-bank.ts"),
|
2025-10-25 10:04:21 -07:00
|
|
|
route("api/autodraft/update", "routes/api/autodraft.update.ts"),
|
2026-03-02 00:35:23 -08:00
|
|
|
route("api/seasons/:seasonId/draft", "routes/api/seasons.$seasonId.draft.ts"),
|
2025-10-11 00:53:39 -07:00
|
|
|
route("user-profile", "routes/user-profile.tsx"),
|
2025-10-12 16:42:15 -07:00
|
|
|
route("how-to-play", "routes/how-to-play.tsx"),
|
Add rules page, rewrite how-to-play, and fix scoring display (#20)
- Add new /rules route with official league rules covering rosters,
scoring, major-based QP scoring, tiebreakers, draft, and season rules
- Rewrite how-to-play page with a tutorial/marketing tone, highlighting
the Fischer increment draft clock as a novel feature
- Add Rules link to navbar (desktop and mobile)
- Align QP values in both pages with DEFAULT_QP_VALUES in code
- Fix tiebreaker description to match placement-count logic in code
- Update all fantasy point displays from toFixed(1) to toFixed(2) across
StandingsTable, TeamScoreBreakdown, and PointProgressionChart
- Update tests to match new two-decimal-place point display format
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 21:58:51 -08:00
|
|
|
route("rules", "routes/rules.tsx"),
|
2026-03-26 17:17:49 -07:00
|
|
|
route("support", "routes/support.tsx"),
|
2026-03-27 00:49:16 -07:00
|
|
|
route("upcoming-events", "routes/upcoming-events.tsx"),
|
2025-10-17 12:15:07 -07:00
|
|
|
route("test-socket", "routes/test-socket.tsx"),
|
|
|
|
|
|
2025-10-12 21:54:49 -07:00
|
|
|
// Admin routes
|
|
|
|
|
route("admin", "routes/admin.tsx", [
|
|
|
|
|
index("routes/admin._index.tsx"),
|
|
|
|
|
route("sports", "routes/admin.sports.tsx"),
|
|
|
|
|
route("sports/new", "routes/admin.sports.new.tsx"),
|
2025-10-13 10:04:32 -07:00
|
|
|
route("sports/:id", "routes/admin.sports.$id.tsx"),
|
2025-10-12 21:54:49 -07:00
|
|
|
route("sports-seasons", "routes/admin.sports-seasons.tsx"),
|
|
|
|
|
route("sports-seasons/new", "routes/admin.sports-seasons.new.tsx"),
|
|
|
|
|
route("sports-seasons/:id", "routes/admin.sports-seasons.$id.tsx"),
|
2025-10-17 12:15:07 -07:00
|
|
|
route(
|
|
|
|
|
"sports-seasons/:id/participants",
|
|
|
|
|
"routes/admin.sports-seasons.$id.participants.tsx"
|
|
|
|
|
),
|
2025-10-31 22:13:12 -07:00
|
|
|
route(
|
|
|
|
|
"sports-seasons/:id/events",
|
|
|
|
|
"routes/admin.sports-seasons.$id.events.tsx"
|
|
|
|
|
),
|
|
|
|
|
route(
|
|
|
|
|
"sports-seasons/:id/events/:eventId",
|
|
|
|
|
"routes/admin.sports-seasons.$id.events.$eventId.tsx"
|
|
|
|
|
),
|
feat: Implement bracket expansion plan to support various tournament structures
- Added a comprehensive plan for bracket expansion, including support for 4, 8, 16, 32, and 68 team formats.
- Introduced a template-based bracket system with predefined templates for NCAA March Madness, NFL Playoffs, NBA Playoffs, and simple brackets.
- Updated UI flow for bracket creation, allowing admins to select templates and assign participants flexibly.
- Enhanced database schema to accommodate new scoring rules and bracket templates.
- Proposed updates to scoring logic to handle non-scoring rounds and participant placements correctly.
- Documented implementation phases for gradual rollout of new features.
- Addressed critical bugs in the playoff event processing and scoring logic, ensuring proper advancement and scoring rules across multiple leagues.
2025-11-03 09:36:16 -08:00
|
|
|
route(
|
|
|
|
|
"sports-seasons/:id/events/:eventId/bracket",
|
|
|
|
|
"routes/admin.sports-seasons.$id.events.$eventId.bracket.tsx"
|
|
|
|
|
),
|
2025-11-17 22:19:46 -08:00
|
|
|
route(
|
|
|
|
|
"sports-seasons/:id/expected-values",
|
|
|
|
|
"routes/admin.sports-seasons.$id.expected-values.tsx"
|
|
|
|
|
),
|
|
|
|
|
route(
|
|
|
|
|
"sports-seasons/:id/futures-odds",
|
|
|
|
|
"routes/admin.sports-seasons.$id.futures-odds.tsx"
|
|
|
|
|
),
|
2026-03-23 08:24:28 -07:00
|
|
|
route(
|
|
|
|
|
"sports-seasons/:id/elo-ratings",
|
|
|
|
|
"routes/admin.sports-seasons.$id.elo-ratings.tsx"
|
|
|
|
|
),
|
Add tennis Grand Slam simulator with surface Elo ratings, fixes #116 (#216)
Implements a Monte Carlo simulator for men's/women's tennis seasons scored
on the qualifying_points pattern. Simulates all 4 Grand Slam majors
(Australian Open, French Open, Wimbledon, US Open) using surface-specific
Elo ratings and ATP/WTA world rankings for seeding.
New table: participant_surface_elos — one row per (participant, season)
storing worldRanking, eloHard, eloClay, eloGrass.
Key design decisions:
- Seeding uses ATP/WTA world ranking (not Elo), matching real draw procedure
- Top 32 seeded with standard slot placement (1→0, 2→64, 3-4→quarters, etc.)
- QP per round with tie-splitting pre-applied: W=20, F=14, SF=9, QF=4, R16=1.5
- Completed majors read actual qualifyingPointsAwarded from eventResults
- 10,000 Monte Carlo simulations; column sums naturally 1.0 (no normalization)
Admin UI at /admin/sports-seasons/:id/surface-elo:
- 5-column grid (Player | Rank | Hard | Clay | Grass)
- Bulk import: "Name, ranking, hardElo, clayElo, grassElo" one per line
- Fuzzy name matching (bigram Dice coefficient) with "Did you mean?" suggestions
- Inline participant creation for unmatched names via useFetcher
- Saves Elos and auto-runs simulation on submit
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 23:59:35 -07:00
|
|
|
route(
|
|
|
|
|
"sports-seasons/:id/surface-elo",
|
|
|
|
|
"routes/admin.sports-seasons.$id.surface-elo.tsx"
|
|
|
|
|
),
|
Add PDC World Darts Championship simulator with Elo-based bracket (#248)
Fixes #123
* Add PDC World Darts Championship simulator (128-player bracket)
- New DartsSimulator: 128-player single-elimination, 7 rounds with
PDC-accurate best-of-sets formats (bo3/bo5/bo5/bo7/bo7/bo11/bo13).
ELO_DIVISOR=500 via set-level Bernoulli model. Two simulation paths:
Path A (bracket drawn) simulates from actual DB matches; Path B
(pre-bracket) seeds top 32 by world ranking in fixed positions and
randomly draws the remaining 96 per simulation run (50,000 iterations).
- darts_bracket added to simulatorTypeEnum and simulator registry.
- world_ranking nullable integer column added to participant_expected_values
(migration 0067); batchSaveSourceElos now accepts and persists it.
- Admin route /admin/sports-seasons/:id/darts-elo: bulk import with format
"Player Name, 2099, 1" (name, Elo, optional world ranking), fuzzy name
matching, auto-runs simulation and updates EV/snapshots on save.
- DARTS_128 bracket template added (scoring starts at Quarterfinals).
- 30 unit tests: math helpers, bracket seeding structure, Path A/B integration.
https://claude.ai/code/session_01WZ6FjMmC2eBeZ1564M9Ruz
* Review fixes: pre-compute hot-loop invariants, import normalizeName
- Pre-compute seededSlots and getSeededMatchOrder(32) before the 50k
simulation loop — was being recomputed every iteration
- Pad unseeded pool to 96 once before the loop instead of inside it
- Inline bracket-building in the hot loop using pre-computed seededSlots;
removes the per-iteration call to buildR1Bracket/getSeededMatchOrder
- Remove dead SEEDED_R1_PAIRS constant (was never referenced)
- Import normalizeName from ~/lib/fuzzy-match instead of redefining it locally
https://claude.ai/code/session_01WZ6FjMmC2eBeZ1564M9Ruz
* Fix lint failures: unused vars, eqeqeq, toSorted
- Remove unused seededSet/unseededSet variables in test
- Replace != null with !== null && !== undefined (eqeqeq rule)
- Replace .sort() with .toSorted() in simulator and route (unicorn/no-array-sort)
https://claude.ai/code/session_01WZ6FjMmC2eBeZ1564M9Ruz
* Fix TS2552: restore seededSet declaration removed during lint fix
https://claude.ai/code/session_01WZ6FjMmC2eBeZ1564M9Ruz
---------
Co-authored-by: Claude <noreply@anthropic.com>
2026-03-31 15:37:28 -07:00
|
|
|
route(
|
|
|
|
|
"sports-seasons/:id/darts-elo",
|
|
|
|
|
"routes/admin.sports-seasons.$id.darts-elo.tsx"
|
|
|
|
|
),
|
Add golf qualifying points simulator (Plackett-Luce Monte Carlo) (#223)
* Add golf QP simulator with Plackett-Luce model, fixes #120
- New `participant_golf_skills` table (migration 0061) for SG: Total and
per-major American odds per player/season
- New `app/models/golf-skills.ts` with getGolfSkillsMap, getGolfSkillsForSeason,
batchUpsertGolfSkills
- Full `GolfSimulator` implementation replacing the TODO stub: Plackett-Luce
ranking model (PL_BETA=1.5, FIELD_SIZE=156), 10k Monte Carlo iterations,
awards QP by finishing position, ranks by total QP across all 4 majors
- New admin route `sports-seasons/:id/golf-skills` with bulk CSV import,
fuzzy name matching, per-player SG + per-major odds inputs; saves skills
and auto-runs simulation on submit
- Simulator dropdown on sport admin sorted alphabetically; renamed to
"Golf Qualifying Points Monte Carlo"
- Golf Skills button shown on sports season admin when simulator type is
golf_qualifying_points
- Extract normalizeName/diceCoefficient to shared `app/lib/fuzzy-match.ts`,
removing duplication from surface-elo and golf-skills routes
- Parallelize 4 DB queries in GolfSimulator.simulate() with Promise.all
- O(1) field array removal via swap-to-end + pop (was O(N) splice)
- Fix source tag: performance_model (not elo_simulation) for SG-based model
- 23 unit tests covering americanToImplied, getMajorOddsKey, resolveSkill,
simulateMajor, and Monte Carlo calibration properties
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix oxlint errors: no-non-null-assertion and eqeqeq
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 21:46:02 -07:00
|
|
|
route(
|
|
|
|
|
"sports-seasons/:id/golf-skills",
|
|
|
|
|
"routes/admin.sports-seasons.$id.golf-skills.tsx"
|
|
|
|
|
),
|
2026-03-07 21:59:29 -08:00
|
|
|
route(
|
|
|
|
|
"sports-seasons/:id/standings",
|
|
|
|
|
"routes/admin.sports-seasons.$id.standings.tsx"
|
|
|
|
|
),
|
2026-03-21 00:12:01 -07:00
|
|
|
route(
|
|
|
|
|
"sports-seasons/:id/regular-standings",
|
|
|
|
|
"routes/admin.sports-seasons.$id.regular-standings.tsx"
|
|
|
|
|
),
|
2026-03-09 15:34:31 -07:00
|
|
|
route(
|
|
|
|
|
"sports-seasons/:id/simulate",
|
|
|
|
|
"routes/admin.sports-seasons.$id.simulate.tsx"
|
|
|
|
|
),
|
2025-10-12 21:54:49 -07:00
|
|
|
route("participants", "routes/admin.participants.tsx"),
|
|
|
|
|
route("templates", "routes/admin.templates.tsx"),
|
|
|
|
|
route("templates/new", "routes/admin.templates.new.tsx"),
|
|
|
|
|
route("templates/:id", "routes/admin.templates.$id.tsx"),
|
|
|
|
|
route("data-sync", "routes/admin.data-sync.tsx"),
|
2025-11-14 09:15:58 -08:00
|
|
|
route("standings-snapshots", "routes/admin.standings-snapshots.tsx"),
|
2025-10-12 21:54:49 -07:00
|
|
|
]),
|
2025-10-17 12:15:07 -07:00
|
|
|
route(
|
|
|
|
|
"api/admin/export-sports-data",
|
|
|
|
|
"routes/api.admin.export-sports-data.ts"
|
|
|
|
|
),
|
2025-10-11 00:07:39 -07:00
|
|
|
] satisfies RouteConfig;
|