|
| 1 | +--- |
| 2 | +title: Contributing |
| 3 | +description: How to contribute to GamePulse — setup, conventions, PR process. |
| 4 | +--- |
| 5 | + |
| 6 | +# Contributing |
| 7 | + |
| 8 | +Thanks for your interest in contributing to GamePulse! This guide gets you from zero to your first PR in **about 15 minutes**. |
| 9 | + |
| 10 | +## Code of Conduct |
| 11 | + |
| 12 | +GamePulse follows the [Contributor Covenant](https://www.contributor-covenant.org/version/2/1/code_of_conduct/). Be welcoming, be patient, assume good intent. Harassment of any kind is not tolerated. |
| 13 | + |
| 14 | +## Setup |
| 15 | + |
| 16 | +```bash |
| 17 | +# 1. Fork on GitHub, then clone your fork |
| 18 | +git clone https://github.com/<your-username>/gamepulse.git |
| 19 | +cd gamepulse |
| 20 | + |
| 21 | +# 2. Install |
| 22 | +nvm use # if you have nvm |
| 23 | +npm install |
| 24 | + |
| 25 | +# 3. Run |
| 26 | +npm run dev |
| 27 | +``` |
| 28 | + |
| 29 | +You're ready. See [Quick Start](./getting-started/quick-start.md) if anything blows up. |
| 30 | + |
| 31 | +## Before you start coding |
| 32 | + |
| 33 | +1. **Search [open issues](https://github.com/TabletopFoundry/gamepulse/issues)** — your idea may already be tracked. |
| 34 | +2. For non-trivial changes, **open an issue or discussion first** describing the proposal. This avoids wasted work. |
| 35 | +3. **Branch from `main`**: `git checkout -b feat/your-feature`. |
| 36 | + |
| 37 | +## Coding conventions |
| 38 | + |
| 39 | +These are enforced by ESLint + TypeScript, but worth reading once: |
| 40 | + |
| 41 | +### TypeScript |
| 42 | + |
| 43 | +- **Strict mode is on.** No `any`, no unchecked indexed access. |
| 44 | +- **Explicit return types** on exported functions. |
| 45 | +- **`type` over `interface`** for object shapes (project convention). |
| 46 | +- **Path aliases**: `@/lib/...`, `@/components/...` — never relative paths across layers. |
| 47 | + |
| 48 | +### Styling |
| 49 | + |
| 50 | +- **Tailwind only.** No additional CSS files except `app/globals.css`. |
| 51 | +- **Stick to the design system**: `rounded-[2rem]` cards, `rose-500` accents, `slate-950` text. |
| 52 | +- **Use shared UI** from `components/gamepulse-ui.tsx` (`PageShell`, `SectionHeading`, `ScoreCard`, `ConsensusBadge`, `GameCard`). |
| 53 | + |
| 54 | +### Components |
| 55 | + |
| 56 | +- **Server components by default.** Add `"use client"` only when you need hooks, event handlers, or browser APIs. |
| 57 | +- **Forms use server actions** via `useActionState` + the shared `SubmitButton`. |
| 58 | +- **Toast notifications** via `useToast()` from `@/components/toast`. |
| 59 | + |
| 60 | +### Data access |
| 61 | + |
| 62 | +- **Pages never call `getDb()` directly.** All reads go through `lib/queries/`, all writes through `lib/actions.ts`. |
| 63 | +- **Seed data** lives in `lib/db/seeds/`. Bump `SEED_VERSION` in `lib/db/seed.ts` when you change it. |
| 64 | +- **Parameter binding always** — never string-interpolate SQL. |
| 65 | + |
| 66 | +### Naming |
| 67 | + |
| 68 | +| Kind | Style | Example | |
| 69 | +| --- | --- | --- | |
| 70 | +| Files | kebab-case | `game-card.tsx` | |
| 71 | +| Components | PascalCase | `GameCard` | |
| 72 | +| Functions | camelCase | `getGameBySlug` | |
| 73 | +| Types | PascalCase | `GameCardData` | |
| 74 | +| DB columns | snake_case | `community_score` | |
| 75 | + |
| 76 | +## The PR process |
| 77 | + |
| 78 | +### 1. Make the change |
| 79 | + |
| 80 | +Keep PRs **focused**. One concern per PR. If your change touches three unrelated areas, split it. |
| 81 | + |
| 82 | +### 2. Run the CI gate |
| 83 | + |
| 84 | +```bash |
| 85 | +npm run check |
| 86 | +``` |
| 87 | + |
| 88 | +This runs `type-check → lint → build`. All three must pass before you push. |
| 89 | + |
| 90 | +### 3. Write a clear PR description |
| 91 | + |
| 92 | +Use the PR template. Cover: |
| 93 | + |
| 94 | +- **What** changed (one or two sentences) |
| 95 | +- **Why** it changed (link to issue or explain the motivation) |
| 96 | +- **How** to test it (the steps a reviewer should take) |
| 97 | +- Screenshots for any visual change |
| 98 | + |
| 99 | +### 4. Conventional commit prefixes |
| 100 | + |
| 101 | +| Prefix | Use for | |
| 102 | +| --- | --- | |
| 103 | +| `feat:` | New user-facing feature | |
| 104 | +| `fix:` | Bug fix | |
| 105 | +| `docs:` | Documentation only | |
| 106 | +| `refactor:` | Internal change, no behavior difference | |
| 107 | +| `perf:` | Performance improvement | |
| 108 | +| `chore:` | Tooling, deps, build config | |
| 109 | + |
| 110 | +### 5. Self-review |
| 111 | + |
| 112 | +Read your own diff before you request review. Catch: |
| 113 | + |
| 114 | +- Dead code, console.logs, commented-out blocks |
| 115 | +- Unused imports |
| 116 | +- Inconsistent naming |
| 117 | +- Missing types on exported functions |
| 118 | + |
| 119 | +## What we're looking for |
| 120 | + |
| 121 | +| Welcome | Less welcome | |
| 122 | +| --- | --- | |
| 123 | +| Bug fixes with reproduction steps | Drive-by formatting changes | |
| 124 | +| New games / critics with realistic data | Sweeping refactors without discussion | |
| 125 | +| Documentation improvements | Adding heavy dependencies (`zod`, `prisma`, …) for marginal gains | |
| 126 | +| Accessibility fixes | Style nitpicks not tied to a real readability issue | |
| 127 | +| Test improvements for `lib/` algorithms | Tests for trivial components | |
| 128 | + |
| 129 | +## Areas that need help |
| 130 | + |
| 131 | +- **Real authentication** integration (NextAuth.js or Clerk) — see [Data Model → Mock authentication](./concepts/data-model.md#mock-authentication). |
| 132 | +- **BoardGameGeek importer** as an optional seed pipeline. |
| 133 | +- **Price-tracker webhooks** for `game_prices` updates. |
| 134 | +- **Accessibility audit** of forms and modals. |
| 135 | +- **More critic personalities** in seed data — bring your community's voice. |
| 136 | + |
| 137 | +## Need help? |
| 138 | + |
| 139 | +- Read [docs/](https://github.com/TabletopFoundry/gamepulse/tree/main/docs) in the repo (PRD, code review, UX review). |
| 140 | +- Open a [Discussion](https://github.com/TabletopFoundry/gamepulse/discussions) for questions. |
| 141 | +- Open an [Issue](https://github.com/TabletopFoundry/gamepulse/issues) for bugs. |
| 142 | + |
| 143 | +Thank you for helping make GamePulse better. 🎲 |
0 commit comments