Fair Supply LogoFair Supply - Docs

Definition of Done

A checklist for completing work in the platform app.

Philosophy

Ship small, ship fast. Optimise for speed and iteration.

  • PRs should be small and focused - one feature, one fix, one refactor
  • Prefer multiple small PRs over one large PR
  • If a PR takes more than a day, break it down
  • Done is better than perfect - ship, learn, iterate
  • Use feature flags to merge incomplete features safely

Code Quality

  • Follows Clean Architecture layer boundaries
  • Uses kebab-case file naming
  • No Tailwind CSS written directly in web app components
  • Uses @repo/luz components for UI
  • Linting passes (npm run lint)
  • TypeScript compiles without errors (npm run build)

Architecture

  • Server Components used by default
  • Client Components only where interactivity is required
  • Server Actions are thin (auth → validate → call use case/repository → revalidate)
  • Business logic lives in use cases, not server actions
  • No prop drilling - uses composition or state management

Data & State

  • React Query used for mutations and optimistic updates
  • Zustand used only where useState is insufficient
  • use() and <Suspense> used for data fetching
  • Promise.all() used for parallel data fetching

Testing

  • Unit tests written for critical business logic only
  • Tests colocated with source files (*.test.ts)
  • Tests focus on behavior, not implementation
  • Don't block shipping for test coverage on non-critical paths

GraphQL & Types

  • Codegen run after schema changes (npm run codegen)
  • GraphQL-generated types used (no manual type mapping)
  • Repositories return null for missing entities
  • Use cases throw domain errors (NotFoundError, ValidationError)

Before Merging

  • PR is small and focused (single responsibility)
  • PR description explains what and why
  • No console.logs or debugging code
  • Works in development (pnpm run dev)
  • Build succeeds (pnpm run build)