Thanks for your interest in contributing! This guide will help you get started.
- Node.js 18+
- npm or yarn
git clone https://github.com/dkirby-ms/playgrid.git
cd playgrid
npm install
npm run devThe dev server runs on http://localhost:5173.
We use a simple flow: dev → uat → prod
- Feature/fix branches branch off from
dev - Code review happens in pull requests
- Merge to
devonce approved - Promote to
uatfor testing - Promote to
prodfor release
If you're working on a new feature:
git checkout dev
git pull origin dev
git checkout -b feature/my-featureWhen ready, open a PR against dev.
- Use the bug report template for bugs
- Use the feature request template for ideas
- Use the chore template for maintenance tasks
- Create a focused PR — one feature or fix per PR
- Write a clear description — explain what and why
- Link to the issue — reference the issue your PR solves (
closes #123) - Run tests locally — ensure nothing breaks
npm run test
npm run build- Use strict mode — all types should be explicit
- Prefer interfaces for type definitions
- Keep functions small and focused
- Add comments only where logic isn't obvious
Example:
interface Player {
id: string;
name: string;
elo: number;
}
export function calculateRating(winner: Player, loser: Player): number {
// Your logic here
}We use Vitest. Tests live next to their code:
src/
game-logic.ts
game-logic.test.ts
Write tests as you code:
npm run test # Run all tests
npm run test:watch # Watch mode
npm run test:ui # Interactive UIExample test:
import { describe, it, expect } from 'vitest';
import { calculateRating } from './game-logic';
describe('calculateRating', () => {
it('should increase winner ELO and decrease loser ELO', () => {
const winner = { id: '1', name: 'Alice', elo: 1600 };
const loser = { id: '2', name: 'Bob', elo: 1400 };
const newRating = calculateRating(winner, loser);
expect(newRating).toBeGreaterThan(winner.elo);
});
});playgrid/
├── client/ # Web UI (PixiJS, Vite)
├── server/ # Game server (Colyseus)
├── shared/ # Shared types and utils
├── docs/ # Architecture and guides
└── .squad/ # Team docs and decisions
For more details, see the README.
- Check docs/ for architecture and design decisions
- Open a discussion if you have questions
- Reach out to the team in the project Discord
Happy coding! 🎮