Website for Brackt.com
Find a file
Chris Parsons 27e8ae505a
Fix registry.ts leaking into client bundle via admin.sports edit route (#411)
* Fix circular dependency and client-bundle server-only code in simulator routes

NCAAM and NCAAW simulators imported getParticipantSimulatorInputs from
models/simulator, which imports manifest.ts, which imports registry.ts —
creating a cycle back through registry.ts → simulator files. This caused
a TDZ ReferenceError in the client bundle.

Fix: inline a direct seasonParticipantSimulatorInputs query in both
simulators (they already run direct DB queries) instead of going through
the model layer, breaking the cycle.

Also moves getSimulatorInputPolicy from the component body to the loader
on the simulator setup page. The component calling it pulled input-policy.ts
→ manifest.ts → registry.ts → all simulator implementations into the client
bundle, which contain Node.js-only code and caused "Error loading route
module" in production.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Move registry calls from component to loader in admin.sports.$id

SIMULATOR_TYPES and getSimulatorInfo were used directly in the component
body to build the simulator type dropdown. This dragged registry.ts —
which imports every simulator implementation — into the client bundle,
causing a TDZ ReferenceError that broke any route co-loaded with it
(observed as "Error loading route module" on admin events pages).

Fix: pre-build simulatorOptions in the loader and pass them as plain
serializable data. The registry imports remain for the action's
validator but are now only reachable from server-only code.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 22:54:59 -07:00
.claude Refactor league settings into per-section components (#379) 2026-05-05 14:19:50 -07:00
.github/workflows Fix migration check in deploy script to use reliable exit code (#267) 2026-04-06 00:44:04 -04:00
.opencode/plugins Add opencode oxlint plugin and UI refinements (#323) 2026-04-24 11:11:20 -07:00
.storybook New design (#309) 2026-04-23 13:14:55 -07:00
.vscode feat: add Sentry error monitoring (#132) 2026-03-10 23:35:33 -07:00
app Fix registry.ts leaking into client bundle via admin.sports edit route (#411) 2026-05-11 22:54:59 -07:00
cypress Fix oxlint warnings: no-shadow, consistent-function-scoping, no-non-null-assertion, and others (#196) 2026-03-21 10:59:51 -07:00
database Formalize simulator system with manifest, input-policy, runner, and admin UI (#409) 2026-05-11 21:09:53 -07:00
docs Formalize simulator system with manifest, input-policy, runner, and admin UI (#409) 2026-05-11 21:09:53 -07:00
drizzle Formalize simulator system with manifest, input-policy, runner, and admin UI (#409) 2026-05-11 21:09:53 -07:00
plans Add Cloudinary-backed avatar system (#385) 2026-05-06 14:47:37 -07:00
public Add branded dark-themed HTML email template (#402) 2026-05-10 11:18:57 -07:00
scripts Add branded dark-themed HTML email template (#402) 2026-05-10 11:18:57 -07:00
server Add Brackt as a league-private meta-sport (#200) (#377) 2026-05-04 20:31:44 -07:00
test-fixtures/baselines chore: capture pre-migration baselines 2026-04-30 23:09:24 -07:00
.dockerignore Initial commit from create-react-router 2025-10-10 23:04:50 -07:00
.env.example Add Cloudinary-backed avatar system (#385) 2026-05-06 14:47:37 -07:00
.gitignore Migrate authentication from Clerk to BetterAuth (#324) 2026-04-24 22:00:49 -07:00
.npmrc Migrate authentication from Clerk to BetterAuth (#324) 2026-04-24 22:00:49 -07:00
.nvmrc Optimize GitHub Actions CI/CD pipeline (#252) 2026-04-01 00:59:21 -07:00
.oxlintrc.json Replace console.* with structured logger, fix no-inferrable-types (closes #98) (#199) 2026-03-21 13:41:39 -07:00
AGENTS.md Docs update 2026-05-04 09:33:13 -07:00
BETTERAUTH_MIGRATION.md Migrate authentication from Clerk to BetterAuth (#324) 2026-04-24 22:00:49 -07:00
CLAUDE.md Docs update 2026-05-04 09:33:13 -07:00
components.json feat: add theme system with dark mode support and navbar component 2025-10-10 23:30:26 -07:00
cypress.config.js ci: add test job to GitHub workflow and setup testing dependencies 2025-10-21 12:47:11 -07:00
docker-compose.yml feat: add FIFA World Cup 48-team bracket template with group stage and projected scoring 2026-02-14 22:30:12 -08:00
Dockerfile Copy .npmrc into production Docker stage so npm ci --omit=dev respects legacy-peer-deps (#325) 2026-04-24 22:17:35 -07:00
drizzle.config.ts Add PgBouncer connection pooling support for Vultr managed PostgreSQL (#271) 2026-04-06 17:15:18 -04:00
instrument.server.mjs Filter unnecessary sentry css and js errors. 2026-03-15 10:24:57 -07:00
package-lock.json Add Cloudinary-backed avatar system (#385) 2026-05-06 14:47:37 -07:00
package.json Add Cloudinary-backed avatar system (#385) 2026-05-06 14:47:37 -07:00
plan.md Add implementation plan for commissioner-without-team feature (#6) 2026-02-20 08:45:09 -08:00
react-router.config.ts Add oxlint linting setup with zero errors (#194) 2026-03-21 09:44:05 -07:00
README.md Initial commit from create-react-router 2025-10-10 23:04:50 -07:00
server.ts Decouple database migrations from server startup (#265) 2026-04-06 00:07:36 -04:00
TESTING.md ci: add test job to GitHub workflow and setup testing dependencies 2025-10-21 12:47:11 -07:00
tsconfig.json refactor: update import paths to use absolute paths for better clarity and maintainability 2025-10-24 21:20:19 -07:00
tsconfig.node.json Add oxlint linting setup with zero errors (#194) 2026-03-21 09:44:05 -07:00
tsconfig.server.json Add oxlint linting setup with zero errors (#194) 2026-03-21 09:44:05 -07:00
tsconfig.vite.json Add oxlint linting setup with zero errors (#194) 2026-03-21 09:44:05 -07:00
vite.config.ts New design (#309) 2026-04-23 13:14:55 -07:00
vitest.config.ts Fix test:run failing in CI due to missing Playwright browser (#246) 2026-03-30 14:42:23 -07:00
vitest.shims.d.ts Install Storybook with React Router Vite plugin fix, closes #229 (#243) 2026-03-29 15:20:48 -07:00

Welcome to React Router!

A modern, production-ready template for building full-stack React applications using React Router.

Features

  • 🚀 Server-side rendering
  • Hot Module Replacement (HMR)
  • 📦 Asset bundling and optimization
  • 🔄 Data loading and mutations
  • 🔒 TypeScript by default
  • 🎉 TailwindCSS for styling
  • 💾 PostgreSQL + DrizzleORM
  • 📖 React Router docs

Getting Started

Installation

Install the dependencies:

npm install

Development

Copy .env.example to .env and provide a DATABASE_URL with your connection string.

Run an initial database migration:

npm run db:migrate

Start the development server with HMR:

npm run dev

Your application will be available at http://localhost:5173.

Building for Production

Create a production build:

npm run build

Deployment

Docker Deployment

To build and run using Docker:

# For npm
docker build -t my-app .

# Run the container
docker run -p 3000:3000 my-app

The containerized application can be deployed to any platform that supports Docker, including:

  • AWS ECS
  • Google Cloud Run
  • Azure Container Apps
  • Digital Ocean App Platform
  • Fly.io
  • Railway

DIY Deployment

If you're familiar with deploying Node applications, the built-in app server is production-ready.

Make sure to deploy the output of npm run build

├── package.json
├── package-lock.json (or pnpm-lock.yaml, or bun.lockb)
├── server.js
├── build/
│   ├── client/    # Static assets
│   └── server/    # Server-side code

Styling

This template comes with Tailwind CSS already configured for a simple default starting experience. You can use whatever CSS framework you prefer.


Built with ❤️ using React Router.