# Contributing to Docwell Thanks for helping. This page covers how to set up the repository, the checks a change has to pass, and how to send it. By taking part you agree to follow the [Code of Conduct](CODE_OF_CONDUCT.md). ## Before you start - For anything bigger than a small fix, open an issue first so we can agree on the approach. - Feature priorities (MVP, v1, v2) are fixed per phase. Work outside the current phase is unlikely to be merged yet. - Report security problems privately to the maintainers, not in a public issue. ## Setup Follow **Development** in the [README](README.md): Go 1.26+, Node 22+, Rust with the `wasm32-wasip1` target, Flutter 3.44+, the Wails v3 CLI and the PocketBase binary. ```bash npm install ``` ## Checks CI runs all of these. Run the ones for the parts you touched before you push. | Area | Commands | |---|---| | Go (`Server/`, `Web-App/`, `Desktop-App/`) | `gofmt -l .`, `go vet ./...`, `golangci-lint run`, `go test ./...` (from each module) | | Frontend (`Packages/`, `Server/admin/`, `Web-App/frontend/`, `Desktop-App/frontend/`) | `npm run lint`, `npm run format:check`, `npm run typecheck`, `npm test` (from the repo root) | | Mobile (`Phone-App/`) | `dart format --set-exit-if-changed lib test`, `flutter analyze`, `flutter test` | | API contract | `npm run generate` (from the repo root) after editing `api/openapi.yaml`, and commit the regenerated files | | License headers | `node .github/scripts/spdx.mjs . --check` | `npm run format` and `npm run lint:fix` fix most frontend problems for you. ## API changes `api/openapi.yaml` is the source of truth for every client. Change it first, then regenerate: - TypeScript types: `Packages/api-client/src/schema.d.ts` - Go types: `Server/internal/api/api.gen.go` - Dart models: `Phone-App/lib/api/generated/` `npm run generate` regenerates all three. CI fails if the committed files differ from what the contract generates. ## Code style - Match the code around your change: naming, comment density and idiom. - Authorization rules belong in `Server/internal/access` as pure functions with tests. - Every new source file starts with `SPDX-License-Identifier: AGPL-3.0-or-later` in a comment. `node .github/scripts/spdx.mjs .` adds it. - Comments and docs are in plain English: short sentences, and explain why rather than what. ## Commits and pull requests - Keep each pull request to one change. Split refactors from behaviour changes. - Write commit subjects in the imperative ("Add page trash", not "Added page trash"). - Describe what changed, why, and how you tested it. Include screenshots for UI changes. - Add or update tests for behaviour changes. ## License Docwell is licensed under the [GNU AGPL v3.0 or later](LICENSE). By sending a contribution you agree that it is licensed under the same terms.