This repository is a turborepo monorepo for the bao game project. It contains a browser client, REST API backend, Colyseus game server, shared core module, CLI tooling, and static assets.
packages/client— Next.js + React frontend, Pixi game rendering, Redux, Tailwind,react-scriptsunit tests.packages/api— Express REST API server (TypeScript), JWT authentication, MySQL support,ts-node-devdevelopment flow.packages/colyseus— Colyseus game server in TypeScript, realtime room logic,ts-node-devfor local development.packages/core— Shared TypeScript core module used by client and server packages.packages/cli—@bao/cliTypeScript CLI (map convert, DB seed, S3 deploy). Runnpx baofrom repo root.packages/assets— Static game assets (public/) and local dev server on:8787.
Use pnpm at the repo root.
pnpm install— install dependencies for all workspaces.pnpm dev— runturbo run devfor all packages.pnpm build— runturbo run buildfor all packages.pnpm lint— runturbo run lint.pnpm test— runcross-env NODE_ENV=testing turbo run test.pnpm format— runturbo run prettier.
Package-specific commands:
packages/client:pnpm dev,pnpm build,pnpm test,pnpm test:lint,pnpm prettierpackages/api:pnpm dev,pnpm start,pnpm lint,pnpm formatpackages/colyseus:pnpm dev,pnpm start,pnpm loadtest,pnpm prettierpackages/core:pnpm build,pnpm testpackages/cli:pnpm build,pnpm test,pnpm dev
- This is a monorepo with workspace-local package references like
workspace:*. - Use
pnpmfor package management andturbofor orchestration. - Keep frontend changes in
packages/client, API changes inpackages/api, realtime server changes inpackages/colyseus, shared business logic inpackages/core, and CLI changes inpackages/cli. packages/clientis a hybrid Next.js / CRA style app with a custom webpack/Tailwind + Pixi rendering stack.packages/api,packages/colyseus,packages/core, andpackages/cliare TypeScript.
- Root README:
README.md - CLI usage:
packages/cli/README.md - Static assets:
packages/assets/README.md - Client intro:
packages/client/README.md - Colyseus server intro:
packages/colyseus/README.md
- Prefer edits that match existing package structure and toolchain.
- If implementing features or fixes, update only the package that owns the relevant domain.
- Do not assume the repo uses npm or Yarn; use
pnpm. - Do not add or update dependencies without checking package-level scripts and workspace compatibility.
- For TypeScript changes in
packages/colyseus,packages/core, orpackages/cli, mention rebuilding withpnpm build. - For frontend changes, note that
packages/clientuses Next.js and also supportsreact-scriptstesting.
This file helps AI coding agents understand the repo layout, the primary package responsibilities, the standard commands, and the expected workflow for changes. It is deliberately minimal and links to package docs for details.