|
1 | | -# Contributing to GitMesh |
| 1 | +# Contributing to GitMesh (Community Edition) |
2 | 2 |
|
3 | | -Thank you for your interest in contributing to GitMesh! This document provides guidelines for contributing to the project. |
| 3 | +This document describes the minimal rules and workflow for contributing to GitMesh Community Edition. |
4 | 4 |
|
5 | | -## Developer Certificate of Origin (DCO) |
| 5 | +--- |
6 | 6 |
|
7 | | -All commits must include a "Signed-off-by" line to certify that you have the right to submit the code under the project's license. This is done using the Developer Certificate of Origin (DCO). |
| 7 | +## Commit sign-off (DCO) |
8 | 8 |
|
9 | | -To sign your commits, use the `-s` flag with git commit: |
| 9 | +All commits **must** be signed off using the Developer Certificate of Origin (DCO). |
10 | 10 |
|
11 | | -```shell |
12 | | -git commit -s -m "Your commit message" |
13 | | -``` |
| 11 | +Create a signed commit: |
| 12 | +```bash |
| 13 | +git commit -s -m "your commit message" |
| 14 | +```` |
14 | 15 |
|
15 | | -This will add a line like: |
16 | | -``` |
17 | | -Signed-off-by: Your Name <your.email@example.com> |
18 | | -``` |
| 16 | +Fix a missing sign-off on the last commit: |
19 | 17 |
|
20 | | -**Important:** All commits in your PR must have DCO sign-off. PRs without proper sign-off will not pass the required DCO check. |
21 | | - |
22 | | -If you forget to sign your commits, you can amend your last commit with: |
23 | | -```shell |
| 18 | +```bash |
24 | 19 | git commit --amend -s |
25 | 20 | ``` |
26 | 21 |
|
27 | | -To sign multiple commits in your branch, you have two common options: |
| 22 | +Sign multiple commits: |
28 | 23 |
|
29 | | -- Rebase onto your base branch (replace `main` with your actual base branch, e.g., `main`, `master`, `develop`): |
30 | | - ```shell |
31 | | - git rebase --signoff main |
32 | | - ``` |
33 | | -- Or rebase only the last N commits (replace `N` with the number of commits you want to sign): |
34 | | - ```shell |
35 | | - git rebase --signoff HEAD~N |
36 | | - ``` |
| 24 | +```bash |
| 25 | +git rebase --signoff main |
| 26 | +# or |
| 27 | +git rebase --signoff HEAD~N |
| 28 | +``` |
37 | 29 |
|
38 | | -**Note:** Rebasing can cause conflicts. Resolve any conflicts as they appear and continue the rebase with `git rebase --continue`. |
| 30 | +Pull requests without valid sign-off will be rejected. |
39 | 31 |
|
40 | | -## Getting Started |
| 32 | +--- |
41 | 33 |
|
42 | | -1. Get the mono repo from GitHub |
| 34 | +## Local development |
43 | 35 |
|
44 | | -```shell |
45 | | -git clone [YOUR_REPOSITORY_URL] |
46 | | -``` |
| 36 | +### Prerequisites |
47 | 37 |
|
48 | | -2. Run the start script: |
| 38 | +* Node.js (LTS) |
| 39 | +* Docker + Docker Compose |
| 40 | +* Git |
49 | 41 |
|
50 | | -```shell |
51 | | -cd scripts |
52 | | -./cli prod |
53 | | -``` |
| 42 | +### Setup |
54 | 43 |
|
55 | | -For hot reloading, you can run: |
56 | | -```shell |
| 44 | +```bash |
| 45 | +git clone <your-fork-url> |
| 46 | +cd gitmesh |
57 | 47 | cd scripts |
58 | 48 | ./cli clean-dev |
59 | 49 | ``` |
60 | 50 |
|
61 | | -The app will be available at http://localhost:8081 |
| 51 | +### Environment files |
62 | 52 |
|
63 | | -### Running services individually |
| 53 | +Both frontend and backend require the following environment configuration files: |
64 | 54 |
|
65 | | -To optimize resource usage during development, we would suggest starting only the necessary services and leveraging hot reloading where applicable. |
| 55 | +**Backend & Frontend `.env` files:** |
| 56 | +* `.env.dist.local` - Distribution template for local development |
| 57 | +* `.env.dist.composed` - Distribution template for Docker Compose |
| 58 | +* `.env.override.local` - Local overrides (for local development) |
| 59 | +* `.env.override.composed` - Overrides for Docker Compose |
66 | 60 |
|
67 | | -1. Start the scaffold service, including the necessary components like the database, etc: |
| 61 | +The application runs at: |
68 | 62 |
|
69 | | -```shell |
70 | | -./cli scaffold up |
| 63 | +``` |
| 64 | +http://localhost:8081 |
71 | 65 | ``` |
72 | 66 |
|
73 | | -This will set up the foundational services required for the project. |
74 | | - |
75 | | -2. If you are primarily working on the frontend but also need the API without hot reloading: |
| 67 | +### Running fewer services |
76 | 68 |
|
| 69 | +To reduce resource usage: |
77 | 70 |
|
78 | | -```shell |
| 71 | +```bash |
| 72 | +./cli scaffold up |
79 | 73 | DEV=1 ./cli service frontend up |
80 | 74 | ./cli service api up |
81 | 75 | ``` |
82 | 76 |
|
83 | | -By selectively starting the frontend and API services without enabling hot reloading, helps reduce resource usage. |
| 77 | +--- |
| 78 | + |
| 79 | +## Vibe coding (optional) |
| 80 | + |
| 81 | +If you use agent-based or IDE-assisted “vibe coding”, GitMesh provides helper scripts that create local symlinks. |
| 82 | + |
| 83 | +Enable: |
| 84 | + |
| 85 | +```bash |
| 86 | +./gitmesh/setup-vibe.sh |
| 87 | +``` |
| 88 | + |
| 89 | +Disable / clean up: |
| 90 | + |
| 91 | +```bash |
| 92 | +./gitmesh/remove-vibe.sh |
| 93 | +``` |
| 94 | + |
| 95 | +These scripts modify your local workspace only. |
| 96 | +Do **not** commit generated symlinks or agent artifacts. |
| 97 | +Always review generated code carefully before committing. |
| 98 | + |
| 99 | +--- |
| 100 | + |
| 101 | +## Contributing workflow |
| 102 | + |
| 103 | +1. Fork the repository |
| 104 | +2. Create a branch: |
| 105 | + |
| 106 | + ```bash |
| 107 | + git checkout -b type/short-description |
| 108 | + ``` |
| 109 | +3. Make changes and commit with sign-off: |
| 110 | + |
| 111 | + ```bash |
| 112 | + git commit -s -m "clear commit message" |
| 113 | + ``` |
| 114 | +4. Push to your fork: |
| 115 | + |
| 116 | + ```bash |
| 117 | + git push origin type/short-description |
| 118 | + ``` |
| 119 | +5. Open a pull request to the upstream repository |
| 120 | + |
| 121 | +--- |
| 122 | + |
| 123 | +## Pull request expectations |
| 124 | + |
| 125 | +* Keep PRs small and focused |
| 126 | +* Explain what changed and why |
| 127 | +* Include testing or reproduction steps when relevant |
| 128 | +* Avoid committing local configs, symlinks, or temp files |
| 129 | + |
| 130 | +--- |
| 131 | + |
| 132 | +## Staying up to date |
| 133 | + |
| 134 | +```bash |
| 135 | +git stash |
| 136 | +git pull origin main |
| 137 | +git stash pop |
| 138 | +``` |
| 139 | + |
| 140 | +--- |
| 141 | + |
| 142 | +## Getting help |
| 143 | + |
| 144 | +* GitHub Issues: bugs, features, technical discussion |
| 145 | +* Discord: real-time help and coordination |
| 146 | + |
| 147 | +--- |
| 148 | + |
| 149 | +By contributing, you agree that your work is licensed under the project’s Apache 2.0 license and complies with the DCO. |
0 commit comments