Explorar el Código

Add contributing guide and contributor license agreement (#481)

Bernt Christian Egeland hace 2 días
padre
commit
7167933d5c
Se han modificado 6 ficheros con 239 adiciones y 2 borrados
  1. 71 0
      .github/CLA-CORPORATE.md
  2. 51 0
      .github/CLA.md
  3. 12 2
      .github/PULL_REQUEST_TEMPLATE.md
  4. 39 0
      .github/workflows/cla.yml
  5. 62 0
      CONTRIBUTING.md
  6. 4 0
      README.md

+ 71 - 0
.github/CLA-CORPORATE.md

@@ -0,0 +1,71 @@
+# Torqvoice Corporate Contributor License Agreement
+
+Version 1.0, 30 October 2026
+
+This Agreement documents the rights a company or other legal entity grants to Torqvoice, represented by Bernt Christian Egeland ("Torqvoice"), for Contributions made by the persons it designates in Schedule A. Use it when the Corporation, not the individual author, owns the Contribution (an employee contributing at work, a consultancy building for a client). Each designated person also accepts the [Individual CLA](CLA.md) on their first pull request. Adapted from the Apache Software Foundation Corporate Contributor License Agreement, version r190612.
+
+## 1. Definitions
+
+**"You"** (or **"Your"**) means the copyright owner or legal entity authorized by the copyright owner that is entering into this Agreement with Torqvoice (the "Corporation"). For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+**"Contribution"** means the code, documentation or other original works of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to Torqvoice for inclusion in, or documentation of, any of the products owned or managed by Torqvoice (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to Torqvoice or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Torqvoice for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution."
+
+## 2. Grant of Copyright License
+
+Subject to the terms and conditions of this Agreement, You hereby grant to Torqvoice and to recipients of software distributed by Torqvoice a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works.
+
+Without limiting the above, this license includes the right for Torqvoice to distribute Your Contributions and derivative works under the license terms of its choosing, including the Elastic License 2.0 under which the Work is distributed today, any open source license, and any commercial or proprietary license, and to change those terms over time.
+
+## 3. Grant of Patent License
+
+Subject to the terms and conditions of this Agreement, You hereby grant to Torqvoice and to recipients of software distributed by Torqvoice a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that Your Contribution, or the Work to which You have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed.
+
+## 4. Your Right to Grant These Licenses
+
+You represent that You are legally entitled to grant the above licenses. You represent further that each employee or other person designated by You in Schedule A is authorized to submit Contributions on behalf of the Corporation.
+
+## 5. Original Work
+
+You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which You are aware and which are associated with any part of Your Contributions.
+
+## 6. No Obligation of Support, No Warranty
+
+You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
+
+## 7. Work That Is Not Your Own
+
+Should You wish to submit work that is not Your original creation, You may submit it to Torqvoice separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which You are aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [named here]".
+
+## 8. Keeping Us Informed
+
+It is Your responsibility to notify Torqvoice when any change is required to the list of designated persons authorized to submit Contributions on behalf of the Corporation, or to the contact person named below. Such notice is given by email to post@torqvoice.com from the contact person, naming this Agreement.
+
+## 9. Acceptance
+
+Fill in the details below, have a person authorized to bind the Corporation sign, and send the signed copy (a scanned or electronically signed PDF, or this file completed and sent from an address at the Corporation's domain) to post@torqvoice.com. Torqvoice confirms receipt by email, and the Agreement takes effect on the date of that confirmation.
+
+---
+
+**Corporation name:** ______________________________________________
+
+**Corporation address:** ___________________________________________
+
+**Country of incorporation:** ______________________________________
+
+**Contact person (name, title, email):** ____________________________
+
+**Signed by (name and title):** _____________________________________
+
+**Signature:** _____________________________________________________
+
+**Date:** _________________________________________________________
+
+## Schedule A: Designated persons
+
+The following persons are authorized to submit Contributions on behalf of the Corporation. List each person's name, email address and GitHub username. The list may be updated under section 8.
+
+| Name | Email | GitHub username |
+| ---- | ----- | --------------- |
+|      |       |                 |
+|      |       |                 |
+|      |       |                 |

+ 51 - 0
.github/CLA.md

@@ -0,0 +1,51 @@
+# Torqvoice Individual Contributor License Agreement
+
+Version 1.0, 30 October 2026
+
+This Agreement documents the rights You grant to Torqvoice, represented by Bernt Christian Egeland ("Torqvoice"), for Your present and future Contributions to the Torqvoice project. Except for the licenses granted herein, You reserve all right, title, and interest in and to Your Contributions. Adapted from the Apache Software Foundation Individual Contributor License Agreement, version 2.2.
+
+## 1. Definitions
+
+**"You"** (or **"Your"**) means the copyright owner or legal entity authorized by the copyright owner that is entering into this Agreement with Torqvoice. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+**"Contribution"** means any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to Torqvoice for inclusion in, or documentation of, any of the products owned or managed by Torqvoice (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to Torqvoice or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Torqvoice for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution."
+
+## 2. Grant of Copyright License
+
+Subject to the terms and conditions of this Agreement, You hereby grant to Torqvoice and to recipients of software distributed by Torqvoice a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works.
+
+Without limiting the above, this license includes the right for Torqvoice to distribute Your Contributions and derivative works under the license terms of its choosing, including the Elastic License 2.0 under which the Work is distributed today, any open source license, and any commercial or proprietary license, and to change those terms over time.
+
+## 3. Grant of Patent License
+
+Subject to the terms and conditions of this Agreement, You hereby grant to Torqvoice and to recipients of software distributed by Torqvoice a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that Your Contribution, or the Work to which You have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed.
+
+## 4. Your Right to Grant These Licenses
+
+You represent that You are legally entitled to grant the above licenses. If Your employer(s) has rights to intellectual property that You create that includes Your Contributions, You represent that You have received permission to make Contributions on behalf of that employer, that Your employer has waived such rights for Your Contributions to Torqvoice, or that Your employer has executed a separate Corporate Contributor License Agreement with Torqvoice.
+
+The same applies if You contribute on behalf of a client or any other third party that may hold rights to the Contribution.
+
+## 5. Original Work
+
+You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which You are personally aware and which are associated with any part of Your Contributions.
+
+## 6. No Obligation of Support, No Warranty
+
+You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
+
+## 7. Work That Is Not Your Own
+
+Should You wish to submit work that is not Your original creation, You may submit it to Torqvoice separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which You are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [named here]".
+
+## 8. Keeping Us Informed
+
+You agree to notify Torqvoice of any facts or circumstances of which You become aware that would make these representations inaccurate in any respect.
+
+## 9. Acceptance
+
+You accept this Agreement by posting the following comment on your pull request in the Torqvoice repository on GitHub, when asked to by the CLA Assistant bot:
+
+> I have read the CLA Document and I hereby sign the CLA
+
+Your GitHub username, the date and the pull request are recorded as your signature. The acceptance applies to all Your Contributions, past and future, to the Project.

+ 12 - 2
.github/PULL_REQUEST_TEMPLATE.md

@@ -1,4 +1,14 @@
 ## Summary
-<!-- What changed, in a short short descriptoin-->
+<!-- What changed, in a sentence or two -->
+
 ## Why
-<!--  in a short short why -->
+<!-- The problem this solves, or a link to the issue -->
+
+## Testing
+<!-- How you verified it. Screenshots or a short recording for UI changes -->
+
+<!--
+By opening this pull request you agree to the Contributor License Agreement in
+.github/CLA.md. First-time contributors are asked to accept it by the CLA bot.
+See CONTRIBUTING.md.
+-->

+ 39 - 0
.github/workflows/cla.yml

@@ -0,0 +1,39 @@
+name: CLA Assistant
+
+# Asks each new contributor to accept .github/CLA.md on their first pull
+# request, and records the acceptance in a JSON file on the cla-signatures
+# branch so main stays clean. Contributors accept by posting the exact
+# sentence below as a comment; "recheck" re-runs the check after a signature.
+on:
+  issue_comment:
+    types: [created]
+  pull_request_target:
+    types: [opened, closed, synchronize]
+
+permissions:
+  actions: write
+  contents: write
+  pull-requests: write
+  statuses: write
+
+jobs:
+  cla:
+    name: Check CLA
+    runs-on: ubuntu-latest
+    steps:
+      - name: CLA Assistant
+        if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
+        uses: contributor-assistant/github-action@v2.6.1
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        with:
+          path-to-document: 'https://github.com/Torqvoice/torqvoice/blob/main/.github/CLA.md'
+          path-to-signatures: 'signatures/cla-v1.json'
+          # Must exist and must not be branch-protected; the bot commits to it.
+          branch: 'cla-signatures'
+          allowlist: sinamics,dependabot[bot],github-actions[bot],bot*
+          create-file-commit-message: 'Create the CLA signature file'
+          signed-commit-message: '$contributorName signed the CLA in $owner/$repo#$pullRequestNo'
+          custom-notsigned-prcomment: 'Thanks for the pull request. Please read the [Contributor License Agreement]($pathToCLADocument) and accept it by posting the comment below. Once is enough. Contributing for a company? See [CONTRIBUTING.md](https://github.com/Torqvoice/torqvoice/blob/main/CONTRIBUTING.md#contributor-license-agreement).'
+          custom-allsigned-prcomment: 'All contributors have signed the CLA. Thank you.'
+          lock-pullrequest-aftermerge: true

+ 62 - 0
CONTRIBUTING.md

@@ -0,0 +1,62 @@
+# Contributing
+
+Guides: [Development Setup](https://torqvoice.com/docs/contributing/development) · [Building an Integration](https://torqvoice.com/docs/contributing/building-an-integration) · [Translations](https://torqvoice.com/docs/contributing/translations)
+
+## Issues
+
+- Bugs: [bug report](https://github.com/Torqvoice/torqvoice/issues/new?labels=bug&template=bug_template.yml&title=%5BBug%5D%3A+). Include version, how you run it (cloud, Docker, source) and steps to reproduce.
+- Features: [feature request](https://github.com/Torqvoice/torqvoice/issues/new?labels=enhancement&template=feature_request.yml&title=%5BFeature+Request%5D%3A+). Open one before writing anything larger than a small fix, so scope is agreed first.
+- Security: never a public issue. Use [private vulnerability reporting](https://github.com/Torqvoice/torqvoice/security/advisories/new) or email post@torqvoice.com.
+
+## Contributor License Agreement
+
+Torqvoice is source-available under the [Elastic License 2.0](LICENSE). Every contributor accepts the [CLA](.github/CLA.md) once, on their first pull request: a bot posts the agreement and you accept by replying with the sentence it asks for. You keep copyright; the CLA lets Torqvoice license your code on the same terms as the rest of the project.
+
+Contributing for an employer or a client who owns the work? They sign the [Corporate CLA](.github/CLA-CORPORATE.md) as well and send it to post@torqvoice.com before the pull request.
+
+## Setup
+
+Dev Container in `.devcontainer/` (recommended), or Node.js 22 and PostgreSQL:
+
+```bash
+docker-compose up -d db
+cp .env.example .env      # DATABASE_URL, BETTER_AUTH_SECRET, NEXT_PUBLIC_APP_URL
+npm install
+npx prisma migrate dev
+npm run dev               # http://localhost:3000
+```
+
+## Layout
+
+| Path | What |
+| ---- | ---- |
+| `src/app` | Next.js App Router; API under `src/app/api` |
+| `src/features/<domain>` | Domain code (quotes, inspections, sms, ...) |
+| `src/components`, `src/lib` | Shared UI, utilities |
+| `src/integrations/<id>` | One connector per folder: `manifest.ts` + `server.ts`, listed in `registry.ts` |
+| `src/__tests__`, `e2e/` | Vitest, Playwright |
+| `prisma/` | Schema and migrations |
+| `messages/<locale>/` | Translations; English is the source |
+
+## Rules
+
+- Biome formats and lints. `npm run format && npm run lint && npm test` must pass; CI runs the same.
+- Files kebab-case, components PascalCase, imports via `@/`.
+- All user-facing text through `next-intl`. Add English under `messages/en/`; other locales welcome, not required.
+- Store dates in UTC, render in the workshop's timezone via `src/lib/timezone.ts` and `src/lib/workshop-datetime.ts`. No `setHours`/`getDay` on raw `Date` server-side.
+- Money carries a currency code; countries ISO 3166-1, languages ISO 639-1.
+- Schema changes: `npx prisma migrate dev --name <change>`, migration folder in the PR. Wrap data migrations in `BEGIN`/`COMMIT`.
+- Tests assert visible behaviour, under `src/__tests__/**`, `*.test.ts(x)`.
+- No secrets. New env vars go in `.env.example` with a comment.
+- Country-specific features (registries, tax rules, parts marketplaces) ship as connectors or settings, never as defaults everyone sees.
+
+## Connectors
+
+A connector is `src/integrations/<id>/{manifest.ts,server.ts}`, registered in `src/integrations/registry.ts`, with a logo in `public/images/integrations/` and a docs page in the [website repo](https://github.com/Torqvoice/torqvoice.com). A test fails if a folder is not registered. Copy the closest existing one: `quickbooks` (accounting), `vegvesen` or `rdw` (registry), `stripe` (payments), `twilio-sms` (messaging). Agree the category and any new capability in an issue first.
+
+## Pull requests
+
+1. Branch from `main`. One change per PR.
+2. Imperative title, it becomes the release note: `Add PartsTech parts ordering connector`.
+3. Fill the template: what, why, how tested. Screenshots for UI.
+4. CI green, CLA signed, review addressed. The maintainer merges.

+ 4 - 0
README.md

@@ -34,6 +34,10 @@ Torqvoice is a self-hosted workshop management platform for automotive service b
 
 Docker Compose, in minutes. See the [Quick Start](https://torqvoice.com/docs/installation#quick-start).
 
+## Contributing
+
+See [CONTRIBUTING.md](CONTRIBUTING.md): setup, conventions, and the CLA accepted once on your first pull request.
+
 ## License
 
 [Elastic License 2.0 (ELv2)](LICENSE)