von
DE

Diese Seite bleibt auf Englisch, der Arbeitssprache des Projekts.

Contributing to kleaf

Thank you for helping. kleaf is an offline desktop ERP: everything below runs on your own computer, with no account, service or API key.

Before you change code, read AGENTS.md. It holds the rules for humans and coding agents alike. The domain words are in GLOSSARY.md, and the decisions so far in docs/adr/. Everyone taking part follows the code of conduct; how decisions are made is in GOVERNANCE.md.

Quickstart

You need:

  • Git;
  • Bun 1.4.5 or later;
  • Node.js 22.14 or later, which runs the local service tests (the app itself runs on the Node inside Electron);
  • on macOS and Linux, a C compiler (cc: the Xcode Command Line Tools, or gcc or clang), which builds the agent bridge and its peer-check addon;
  • about 3 GB of free disk space, and on Linux a desktop session to show the app.

Then, from a terminal:

git clone https://github.com/michailkoutsouris/kleaf.git
cd kleaf
bun install                       # the app and the desktop shell
bun install --cwd worker          # the local service
bun run sample                    # a made-up sample business file; passphrase: sample business only
bun run desktop                   # builds and starts the app; quit it to go on
bun run test:frontend             # frontend tests
bun run --cwd worker test:local   # local service tests on encrypted business files

On first start the app asks for your business country, then for a folder and a passphrase for the new business file. Use made-up records.

bun run sample writes the sample business file, worker/sample-business.korvin: a Greek garage, shop, rental fleet and guest flat with made-up records in every module (names, addresses, example.com emails, +30 690000… phone numbers and checksum-valid tax IDs that are invented, not looked up). Open it in the app with File > Open Business File… and these sample-only secrets, which open every sample file and must never protect real records:

  • passphrase: sample business only
  • recovery key: O6BA-MULP-KIAE-NU2E-7DY4-KYBP-FLAD-7V2P-OG4O-63FR-SFJY-CSV5-STN6-ZXBM

It is encrypted like any other business file, and every record goes through the local service's dispatch, so it shows in History. bun run sample <folder> --seed 2 --date 2026-11-02 writes another one: the same seed and date always give the same records, public ids included: the records sit around 2 November 2026 unless --date places them around another day (--date "$(date +%F)" for today). To serve it to the web dev server: KORVIN_BUSINESS_FILE=sample-business.korvin bun run dev:local (the dev server opens only business files with the development or the sample passphrase, never one with real records). The app makes no outbound requests (run from source, it does not even check for updates), so it works with the network off.

CI follows this quickstart as written on a clean runner with no secrets (tools/quickstart.sh), so if it stops working for you, that is a bug: please open an issue.

Other commands

bun run dev:local            # local service on a development business file, 127.0.0.1:8787
bun run sample [folder]      # the sample business file (--seed <n>, --date <YYYY-MM-DD>)
bun run dev                  # web dev server with hot reload, using dev:local
bun run test:desktop         # Playwright drives the desktop app
bun run lint
bunx tsc -p tsconfig.app.json --noEmit   # frontend typecheck (the build does not typecheck)
bun run --cwd worker typecheck
bun run typecheck:desktop                # the desktop shell (its esbuild bundle does not typecheck)
bun run --cwd worker test    # worker unit tests
node tools/third-party-notices.mjs --check                      # the notices are current
pipx run --spec "reuse[charset-normalizer]==6.3.0" reuse lint   # every file has a licence

Building without network access, once the dependencies are fetched, is described in docs/offline-build.md.

Making a change

  • For anything larger than a small fix, open an issue first so we can agree on the approach.
  • Keep pull requests small and focused, with tests for every behaviour change. The definition of done is in AGENTS.md.
  • Every user-facing text goes through t() and is added to all six language files in src/lib/translations/ in the same change.
  • Never commit credentials, .env files or real customer records. Test and sample data is made up.
  • A new bundled asset or dataset (font, image, icon, data file) needs a source and a licence that allows redistribution. Add a row to docs/redistribution-review.md and an entry in REUSE.toml in the same pull request. Third-party logos are not accepted.
  • After adding, removing or upgrading a dependency, run node tools/third-party-notices.mjs and commit the updated THIRD-PARTY-NOTICES.md. CI fails while it is out of date, or when a bundled package has a licence the project cannot redistribute.

Sign off your commits (DCO)

kleaf uses the Developer Certificate of Origin (DCO) instead of a contributor licence agreement. By signing off a commit you certify that you wrote it, or otherwise have the right to submit it under the project's licence. Sign off with:

git commit -s

That adds a line with your name and email to the commit message:

Signed-off-by: Your Name <you@example.org>

Use your real name, or the name you are known by in the community. CI rejects a pull request with an unsigned commit. To sign off commits you already made:

git commit --amend -s --no-edit        # the last commit
git rebase --signoff origin/main       # every commit of your branch

Your contribution is licensed under the project's licence, AGPL-3.0-or-later. You keep your copyright.

Reporting bugs and vulnerabilities

Report bugs as issues, without attaching a real business file or backup. Report vulnerabilities privately as described in SECURITY.md.

Diese Datei auf GitHub ansehen