A modern, real-time multiplayer chess application built with a high-performance stack. This monorepo leverages Turborepo for efficient build orchestration.
The project is structured as a monorepo using Turborepo and pnpm workspaces:
apps/web: Next.js 15+ frontend with Tailwind CSS. Handles the UI, game rendering, and user interactions.apps/api: NestJS backend service. Manages RESTful endpoints (if any) and potential future orchestrations.apps/ws-server: Node.js WebSocket server usingws. Handles real-time game state, moves, and player connections for low-latency performance.
packages/chess-engine: Core chess logic (wrappingchess.js) shared across frontend and backend.packages/shared-types: TypeScript interfaces and DTOs shared between all apps to ensure type safety.packages/ui: Shared UI component library.packages/config: Shared configurations (ESLint, Tailwind, TypeScript).
-
Install dependencies:
pnpm install
-
Start all applications in development mode:
pnpm dev
- Web: http://localhost:3000
- API: http://localhost:3001
- WS Server:
ws://localhost:8080
Run the entire stack with a single command:
docker-compose up --buildThis will start:
- Web App on port
3000 - API Service on port
3001(mapped from 3000 inside container) - WS Server on port
8080
To build all apps and packages:
pnpm run buildTurborepo will cache the build artifacts, making subsequent builds extremely fast.