# PintRush — notes for AI assistants

Bar entertainment SaaS: marketing site + live trivia game ("The Rush") played on phones, shown on TVs.
Spec: `docs/PintRush_Build_Spec.md`. Design + every resolved ambiguity: `docs/ARCHITECTURE.md` (read it first).

## Machine setup (important)
- This repo lives at `C:\dev\PintRush` on purpose: the owner's Desktop is synced by OneDrive, which must
  never see `node_modules`. A source backup is mirrored to the OneDrive `Webhost\PintRush` folder.
- Node is portable, not installed. **Every Bash command must start with `source /c/dev/tools/env.sh`**
  (puts Node 24 + pnpm 12 on PATH). PowerShell: `$env:PATH = "C:\dev\tools\node;" + $env:PATH`.
- Do not install anything system-wide. Do not run `pnpm add`/`pnpm install` unless you are the one
  coordinating dependencies; other agents may be working in the same checkout.
- Local Postgres: `pnpm db:start` (embedded, port 54329, user/pass `pintrush`, DBs `pintrush` and
  `pintrush_test`). It may already be running — check `netstat -ano | grep 54329` first.

## Commands
- Tests: `npx vitest run --project engine` (projects: engine, protocol, db, game-server, web)
- Typecheck one package: `pnpm --filter @pintrush/engine typecheck`
- Prisma: `cd packages/db && npx prisma db push` / `npx prisma generate`
- Web: `pnpm --filter @pintrush/web dev` (port 3000) — only one Next dev/build at a time in this folder.

## Conventions
- TypeScript strict, ESM, `moduleResolution: Bundler`, extensionless relative imports, `import type` for types
  (`verbatimModuleSyntax`), `noUncheckedIndexedAccess`.
- Workspace packages are consumed as TS source (`exports: ./src/index.ts`); no build step for packages.
- Engine is pure: no I/O, no `Date.now()`, no `Math.random()`. Time comes in on commands as `now`.
- Server time only for scoring. Never send a correct answer to a client before reveal.
- Every tenant query is scoped by `venueId`.
- Comments explain *why*, briefly. No dead code, no TODO stubs pretending to work.
- Never pretend an external service (email, payments, DNS, deploy) is configured: log-only defaults.
