Thank you for your interest in contributing! This guide will help you get from zero to your first PR.
# 1. Fork & clone the repository
git clone https://github.com/<your-username>/board-games.git
cd board-games/03-boardforge
# 2. Use the correct Node.js version
nvm use # reads .nvmrc → Node 20
# 3. Install dependencies
npm install
# 4. Set up your environment
cp .env.example .env.local
# 5. Start the dev server
npm run dev
# 6. Open http://localhost:3000The SQLite database is automatically created and seeded with example projects on first run.
src/
├── app/ # Next.js App Router pages & API routes
├── components/ # React components (ui/, editor/, dashboard/, templates/)
├── db/ # Database migrations
├── hooks/ # Custom React hooks
├── lib/ # Core logic (db, reducer, utils, seed data)
└── types/ # Shared TypeScript type definitions
| Command | Description |
|---|---|
npm run dev |
Start development server with hot reload |
npm run build |
Production build |
npm run lint |
Run ESLint |
npm run typecheck |
Run TypeScript type checking |
npm test |
Run tests with Vitest |
npm run format |
Format code with Prettier |
npm run format:check |
Verify code formatting (CI) |
npm start |
Start production server |
- TypeScript: Strict mode is enabled. Avoid
anytypes — useunknownwith type guards instead. - Styling: Use Tailwind CSS utility classes. Avoid custom CSS unless absolutely necessary.
- Components: Keep files under 200 lines. Extract logic into hooks or helper functions.
- State: The editor uses
useReducerwith a centralizededitorReducer. All editor state changes go through dispatch actions. - API routes: All database access happens in API route handlers. Client components fetch via
fetch(). - Naming: PascalCase for components, camelCase for functions/variables, SCREAMING_SNAKE for constants.
Use Conventional Commits:
feat: add layer duplication support
fix: prevent crash when CSV has empty rows
docs: update API route documentation
refactor: extract CardCanvas resize logic into hook
- Create a feature branch from
main:git checkout -b feat/my-feature - Make your changes and ensure:
-
npm run lintpasses with no errors -
npm run buildsucceeds -
npm run typecheckpasses -
npm run format:checkpasses - New code follows existing patterns and conventions
-
- Write a clear PR description explaining what and why
- Link related issues if applicable
Use the Bug Report issue template. Include:
- Steps to reproduce
- Expected vs actual behavior
- Browser and Node.js version
Use the Feature Request issue template. Describe:
- The problem you're trying to solve
- Your proposed solution
- Any alternatives you've considered