This is the repository that contains the sources to the Durachok game server, game client and the library that is shared between the two.
The repository is structured as follows:
apps/web- The client for the game, a React application that serves as the client for the game.apps/server- The server for the game, a Node.js application that serves as the server for the game.packages/engine- The shared library for the game, a TypeScript library that contains the shared code between the client and the server.packages/transport- Shared data transport types used for communication between client and server.
Before you begin, ensure you have the following installed:
- Node.js (v22 or later recommended)
- pnpm (v10 or later)
- MongoDB (see server README for details)
- Install the dependencies for the repository:
pnpm install-
Set up pre-commit hooks (see Pre-commit Setup below).
-
Configure the
apps/serverenvironment, read the README.md for more information. -
Configure the
apps/webenvironment, read the README.md for more information. -
Run the following command to start the development server:
pnpm run devThis will start the server and the client in development mode.
This project uses pre-commit to run linting, formatting, and type checking before each commit. This ensures code quality and consistency across the codebase.
macOS (using Homebrew):
brew install pre-commitLinux/macOS (using pip):
pip install pre-commitWindows (using pip):
pip install pre-commitAfter installing pre-commit, run the following command from the repository root to install the git hooks:
pre-commit installThe pre-commit configuration runs three checks on staged files:
- oxlint - Lints JavaScript/TypeScript files and auto-fixes issues where possible
- oxfmt - Formats JavaScript/TypeScript/JSON files
- typecheck - Runs TypeScript type checking via
pnpm turbo check
You can run the hooks manually on all files:
pre-commit run --all-filesOr run a specific hook:
pre-commit run oxlint --all-files
pre-commit run oxfmt --all-files
pre-commit run typecheck --all-filesIf you need to bypass the hooks for a specific commit:
git commit --no-verify -m "your message"pnpm dev- Start all applications in development modepnpm build- Build all applicationspnpm lint- Run linting across all packagespnpm fmt- Format code across all packagespnpm check- Run TypeScript type checkingpnpm test- Run tests across all packages
