Skip to content

Getting Started

This guide walks through running the monorepo locally, starting any single app, and running tests. If you only need the docs site, the quickstart for weiqui-docs section is enough.

ToolVersionNotes
Node.js>=18 (CI uses 22)Required for every app. Use a version manager (fnm, nvm).
pnpm9.15.0Pinned via Corepack. corepack enable && corepack prepare pnpm@9.15.0 --activate.
Dockerany recentUsed by weiqi-server, auth-app, and billing-indexer for Postgres / Redis / MinIO.
KataGobinary in $PATHNeeded only when running katago-service against a real engine (the default adapter shells out).
Gitany recentMonorepo uses sub-path package managers.
Terminal window
git clone <repo-url> sharp.go
cd sharp.go
corepack enable
corepack prepare pnpm@9.15.0 --activate
pnpm install

pnpm install reads pnpm.overrides from the root package.json to pin critical transitive deps (next 16.2.4, hono ^4.11.7, esbuild ^0.25.12, lodash ^4.17.23, @modelcontextprotocol/sdk 1.24.3, mcp-handler 1.0.5).

Every deployable app ships an .env.example. Copy the ones you need:

Terminal window
cp apps/weiqi-server/.env.example apps/weiqi-server/.env
cp apps/auth-app/.env.example apps/auth-app/.env.local
cp apps/billing-indexer/.env.example apps/billing-indexer/.env.billing-indexer
cp apps/katago-service/.env.example apps/katago-service/.env
cp apps/main-app-astro/.env.example apps/main-app-astro/.env
cp apps/game-web/.env.example apps/game-web/.env
cp apps/mcp-bridge/.env.example apps/mcp-bridge/.env

See Environment Variables for what each key does.

weiqi-server and billing-indexer each ship their own docker-compose.yml (Postgres + Redis + MinIO + seed jobs). From the relevant app directory:

Terminal window
# weiqi-server dependencies (Postgres 54320, Redis 6379, MinIO 9000)
cd apps/weiqi-server
docker compose up -d
# auth-app dependencies (Postgres 5433, MinIO 9000)
cd apps/auth-app
docker compose --profile setup run --rm setup
docker compose up -d
# recognition-service is optional; only needed when working on board photo scan
cd apps/weiqi-server
docker compose --profile recognition up -d
Terminal window
# Fan out dev mode across every app that defines a `dev` script (Turbo).
pnpm dev

This is convenient for a top-level overview but slow on cold start. Prefer running the apps you actually need.

Terminal window
pnpm --dir apps/<name> dev
AppPortCommand
weiqi-docs4321pnpm --dir apps/weiqi-docs dev
main-app-astro3001pnpm --dir apps/main-app-astro dev
weiqi-server3002pnpm --dir apps/weiqi-server dev
mcp-bridge3003pnpm --dir apps/mcp-bridge dev
auth-app3004pnpm --dir apps/auth-app dev
game-web3001+pnpm --dir apps/game-web dev
katago-service4011pnpm --dir apps/katago-service dev
recognition-service4010pnpm --dir apps/recognition-service dev
billing-indexer9090pnpm --dir apps/billing-indexer dev

game-web and main-app-astro both default to Vite’s port 3001; run only one at a time or override vite --port.

Terminal window
pnpm --dir apps/weiqi-docs dev
# open http://localhost:4321/

The docs site is fully static — no Docker, no env files, no database. Pagefind search index is regenerated on each astro build.

There is no root turbo test task. Run tests per package:

Terminal window
pnpm --dir packages/weiqi-engine test # vitest (watch mode)
pnpm --dir packages/glicko test # vitest
pnpm --dir apps/game-web test # vitest run (one-shot)
pnpm --dir apps/weiqi-server test # jest

Vitest configs are at apps/<name>/vitest.config.ts and packages/<name>/vite.config.ts. The engine package mirrors src/ under tests/ (e.g. packages/weiqi-engine/tests/engine/rules/base/canPlaceStone.test.ts).

Terminal window
pnpm lint # turbo fan-out
pnpm format # prettier write (defaults: 3.8.1)
pnpm --dir apps/weiqi-server typecheck # tsc --noEmit

ESLint flat config extends from packages/eslint-config (exports ./base, ./next, ./react-internal). TypeScript config extends from packages/typescript-config (exports base.json, vite.json, nextjs.json, react-library.json).

Terminal window
pnpm clean
# rimraf node_modules .turbo packages/*/node_modules apps/*/node_modules