aboutsummaryrefslogtreecommitdiff
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorDavid Svantesson2019-10-20 20:31:07 +0200
committerzeripath2019-10-20 19:31:07 +0100
commit2657e718b6a74775fd52709fb8b3bed0f9eabe49 (patch)
tree5bc3e84273dc32e1c917365ecb06d105aeb525b3 /CONTRIBUTING.md
parent85e419076117573b84440650ac0959771a618d80 (diff)
Basic Design guidelines (describing different parts of the code) (#8601)
* Design guidelines with description of different parts of code * Better readability with code parts in bold.
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 95799e92b..93083dc49 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -11,6 +11,7 @@
- [Translation](#translation)
- [Code review](#code-review)
- [Styleguide](#styleguide)
+ - [Design guideline](#design-guideline)
- [Developer Certificate of Origin (DCO)](#developer-certificate-of-origin-dco)
- [Release Cycle](#release-cycle)
- [Maintainers](#maintainers)
@@ -118,6 +119,8 @@ An exception are the tools to build the CSS and images.
- To build Images: ImageMagick, inkscape and zopflipng binaries must be
available in your `PATH` to run `make generate-images`.
+For more details on how to generate files, build and test Gitea, see the [hacking instructions](https://docs.gitea.io/en-us/hacking-on-gitea/)
+
## Code review
Changes to Gitea must be reviewed before they are accepted—no matter who
@@ -157,6 +160,22 @@ import (
)
```
+## Design guideline
+
+To maintain understandable code and avoid circular dependencies it is important to have a good structure of the code. The gitea code is divided into the following parts:
+
+- **integration:** Integrations tests
+- **models:** Contains the data structures used by xorm to construct database tables. It also contains supporting functions to query and update the database. Dependecies to other code in Gitea should be avoided although some modules might be needed (for example for logging).
+- **models/fixtures:** Sample model data used in integration tests.
+- **models/migrations:** Handling of database migrations between versions. PRs that changes a database structure shall also have a migration step.
+- **modules:** Different modules to handle specific functionality in Gitea.
+- **public:** Frontend files (javascript, images, css, etc.)
+- **routers:** Handling of server requests. As it uses other Gitea packages to serve the request, other packages (models, modules or services) shall not depend on routers
+- **services:** Support functions for common routing operations. Uses models and modules to handle the request.
+- **templates:** Golang templates for generating the html output.
+- **vendor:** External code that Gitea depends on.
+
+
## Developer Certificate of Origin (DCO)
We consider the act of contributing to the code by submitting a Pull