Thank you for your interest in contributing to gnubok. This guide covers the development workflow, coding standards, and submission process.
- Fork the repository and clone your fork
- Install dependencies:
npm install - Start the dev server:
npm run dev - Run tests:
npm test
You need a Supabase project for local development:
- Create a free project at supabase.com
- Run all migrations from
supabase/migrations/against your project - Copy
.env.exampleto.envand fill in your Supabase credentials:NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEY
- Create a branch from
mainwith a descriptive name - Make your changes following the code style below
- Run the full check suite before submitting:
npm run lint
npm test
npm run build- Commit using Conventional Commits:
feat:new featurefix:bug fixrefactor:code restructuringtest:adding or updating testsdocs:documentation changes
All commits must include a Signed-off-by line certifying that you have the right to submit the contribution under the project's license. This is the Developer Certificate of Origin (DCO).
Add the sign-off automatically with git commit -s:
feat: add VAT report export
Signed-off-by: Your Name <your.email@example.com>
If you forget, you can amend: git commit --amend -s.
- Keep PRs focused on a single change
- Include a clear description of what and why
- Ensure CI passes (the core build resets extensions to empty, so core code must compile standalone)
- Link related issues if applicable
See CLAUDE.md for the full extension architecture. Quick start:
npx tsx scripts/create-extension.ts --name my-ext --sector general --category operations --description "..."Then add "my-ext" to extensions.config.json and run npm run setup:extensions.
Constraints:
- Extensions cannot use dynamic imports (Next.js bundling requirement)
- Core must build and run with zero extensions enabled
- Never import from
@/extensions/in core code
- Don't modify enforcement triggers in migration 017 (legally required for Swedish accounting law)
- Don't insert directly into journal tables -- use the engine functions in
lib/bookkeeping/engine.ts - Don't break the core/extension boundary -- core must compile standalone without extensions
- Don't delete posted journal entries -- use storno reversal via
reverseEntry()
- TypeScript strict mode, no
anyunless unavoidable - English for all code, comments, and commit messages
Math.round(x * 100) / 100for monetary calculations, nevertoFixed()- Account numbers are strings (
'1930', not1930) - All shared types go in
types/index.ts
Open a discussion or issue on GitHub. For security vulnerabilities, see SECURITY.md.