Thanks for considering a contribution. Kivvi is open source under MIT — the goal is for any secondhand business or refurbisher to be able to run, fork, or extend it.
- Read
PRODUCT.mdto understand what Kivvi is for. Generic "would be nice in any ERP" features are not in scope; secondhand-specific workflows are. - Read
CLAUDE.mdfor the engineering principles. They're not negotiable — they're why the code stays simple.
git clone https://github.com/bitbaum/kivvi.git && cd kivvi
pnpm install
docker compose up -d postgres
cp .env.example .env.local # edit DATABASE_URL + NEXTAUTH_SECRET
pnpm --filter @kivvi/database db:push
pnpm dev- Branch.
git checkout -b feat/short-descriptionorfix/...ordocs/.... - Code. Domain logic in
packages/core/src/domain/*. UI inapps/web/. Types derived from the Drizzle schema — never declared separately. - Validate.
pnpm lint # ESLint pnpm type-check # tsc --noEmit across all packages pnpm test # Vitest, 1,300+ tests
- Commit. Conventional Commits:
feat(scope): …,fix(scope): …,refactor(scope): …,docs(scope): …. - PR. Open against
main. CI re-runs lint + type-check + tests + production build. A maintainer reviews.
- Every multi-table operation is in
db.transaction() - Every query filters by
companyId(exceptauth/users) - Types derived from
$inferSelect/$inferInsert, not redeclared - Money uses
decimal.js, never floats - Business logic lives in
packages/core/src/domain/*, not in Server Actions or components - Mutations use Server Actions, not API routes (API routes are only for streaming + webhooks + the public REST API)
- No raw hex colors — use semantic Tailwind classes that map to CSS vars in
globals.css - No
gray-*,slate-*,zinc-*— usemuted,border-input,text-muted-foreground - Touch targets ≥ 36×36 px (44×44 for primary actions)
- New AI capability? Register the tool, gate it by role, and verify it lands in
aiActionAudit
Tests live in packages/core/src/__tests__. Add one test per non-trivial domain function. Financial calculations need exact expected values, not approximations.
pnpm --filter @kivvi/core test
pnpm --filter @kivvi/core test -- documents # filter by file- Bug fixes with a failing test
- Swiss compliance corrections (VAT, QR-bill format, KMU Kontenrahmen)
- Accessibility improvements with a clear before/after
- Documentation that fixes "I tried to do X and got stuck"
- New tables in the schema
- New top-level routes
- New top-level dependencies
- Anything that changes how money is calculated, stored, or rounded
Open an issue first for these. Save the code for after we agree on the shape.
Don't open public issues for vulnerabilities. See SECURITY.md.
Questions? Open a discussion or drop us a line at revampit.ch.