Skip to content
BilgeGates edited this page Jun 28, 2026 · 3 revisions

Setup

Prerequisites

Requirement Version
Node.js 22 or later
pnpm 10 or later
Git Any recent version

Installation

git clone https://github.com/chessvision-org/chess-vision.git
cd chess-vision
pnpm install

The install step runs husky install through the prepare script, wiring up pre-commit and commit-message hooks. In CI environments, set HUSKY=0 to skip hook installation.

Development

pnpm dev

Vite serves the application on http://localhost:3000 with hot module replacement.

Quality gates

pnpm validate   # typecheck + lint + format check + tests

All four must pass before opening a pull request. CI runs the same command.

Individual commands:

pnpm typecheck      # tsc --noEmit
pnpm lint           # ESLint --max-warnings=0
pnpm format:check   # Prettier check
pnpm test           # node --test

Production build

pnpm build      # Vite build + prerender → dist/
pnpm preview    # serve dist/ locally

The build runs Vite followed by a Puppeteer-based prerender step. Vendor chunks are split manually:

  • vendor-react
  • vendor-icons
  • vendor-motion
  • vendor-dnd
  • vendor-supabase

Docker

# Production
docker compose up --build -d web          # http://localhost:3000

# Development with HMR
docker compose --profile dev up --build dev   # http://localhost:5173

Environment variables

Copy .env.example to .env.local and fill in the values:

cp .env.example .env.local
Variable Required Purpose
VITE_SUPABASE_URL For auth/sync Supabase project URL
VITE_SUPABASE_ANON_KEY For auth/sync Supabase anon key

The application runs fully without Supabase — auth and cloud sync features are disabled when these are absent.

Path aliases

@/*           →  src/*
@hooks        →  src/shared/hooks
@app-types    →  src/shared/types

Bundle analysis

pnpm build:analyze

Opens an interactive bundle treemap via vite-bundle-visualizer.

Clone this wiki locally