Website for Brackt.com
Find a file
Chris Parsons f1af4b5171
Decouple database migrations from server startup (#265)
* Use Docker Compose init service pattern for database migrations

Replaces the fragile double-migration approach (server.ts startup +
drizzle-kit CLI in CI) with a one-shot migrate service in Docker Compose
that the app depends on via condition: service_completed_successfully.

- Add scripts/migrate.mjs: programmatic drizzle-orm migration (uses
  production deps, not drizzle-kit which is devOnly and absent from image)
- Dockerfile: copy scripts/ into image, remove drizzle.config.ts (only
  needed by drizzle-kit CLI)
- server.ts: remove runMigrations() entirely; migrations are now handled
  by the migrate container before the app starts
- deploy.yml: remove explicit docker run migration step; replace sleep 10
  health check with a poll loop and explicit migrate exit-code check

Production server's docker-compose.yaml needs a one-time manual update
to add the migrate service — see plan for exact config.

https://claude.ai/code/session_01ReaqH3o9NVH4QU4qE9WMMQ

* Move drizzle-kit to devDependencies; use docker compose wait in deploy

drizzle-kit is a dev-only tool (schema generation and local migrations).
Now that production migrations run via the programmatic drizzle-orm API
in the migrate init container, drizzle-kit has no runtime role.

Also replaces the polling health check loop with docker compose wait,
which blocks until the migrate service exits and returns its exit code
cleanly — no sleep or manual status inspection needed.

https://claude.ai/code/session_01ReaqH3o9NVH4QU4qE9WMMQ

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-06 00:07:36 -04:00
.claude Fix lint hook: output additionalContext JSON so Claude sees errors in-context 2026-03-24 21:52:23 -07:00
.github/workflows Decouple database migrations from server startup (#265) 2026-04-06 00:07:36 -04:00
.storybook Initial storybook components. 2026-03-29 22:09:45 -07:00
.vscode feat: add Sentry error monitoring (#132) 2026-03-10 23:35:33 -07:00
app Replace isDraftable boolean with draftOn/draftOff date range (#263) 2026-04-05 22:09:52 -04: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 Replace isDraftable boolean with draftOn/draftOff date range (#263) 2026-04-05 22:09:52 -04:00
drizzle Replace isDraftable boolean with draftOn/draftOff date range (#263) 2026-04-05 22:09:52 -04:00
plans Update claude.md to push more tests. (#84) 2026-03-07 22:31:04 -08:00
public Fixes missing icon. 2026-03-11 14:20:53 -07:00
scripts Decouple database migrations from server startup (#265) 2026-04-06 00:07:36 -04:00
server Add CS2 Major Qualifying Points simulator and stage management (#260) 2026-04-05 16:40:05 -04:00
.dockerignore Initial commit from create-react-router 2025-10-10 23:04:50 -07:00
.env.example Add support page with Discord link and contact form, fixes #233 (#234) 2026-03-26 17:17:49 -07:00
.gitignore Install Storybook with React Router Vite plugin fix, closes #229 (#243) 2026-03-29 15:20:48 -07:00
.mcp.json MCP update 2026-03-11 21:45:19 -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
CLAUDE.md Add "Games to Score" widget to admin dashboard (#183) 2026-03-19 19:25:37 -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 Decouple database migrations from server startup (#265) 2026-04-06 00:07:36 -04:00
drizzle.config.ts Initial commit from create-react-router 2025-10-10 23:04:50 -07:00
instrument.server.mjs Filter unnecessary sentry css and js errors. 2026-03-15 10:24:57 -07:00
package-lock.json Install Storybook with React Router Vite plugin fix, closes #229 (#243) 2026-03-29 15:20:48 -07:00
package.json Decouple database migrations from server startup (#265) 2026-04-06 00:07:36 -04: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 feat: add Sentry error monitoring (#132) 2026-03-10 23:35:33 -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.