Please feel free to suggest sections that should be included in this document or certain concepts that should be mentioned. I'm probably not the best person to put this together as I have flawed view of the architecture and likely have missed certain points that should be pointed out (especially in the Bird's-eye view section).
developer: add ARCHITECTURE file #81
architecture into next Preview ready: https://forgejo.codeberg.page/@docs_pull_81/
https://forgejo.codeberg.page/@docs_pull_81/docs/v1.21/developer/architecture/
https://forgejo.codeberg.page/@docs_pull_81/docs/next/developer/architecture/
@ -0,0 +10,4 @@
## Bird's-eye view
Forgejo serves as a git server and frontend; users can pull and push to git repositories and view commits and their diff, Forgejo handles the authentication and executes actions based on the context of the request, such as sending a notification if the pushed commit was part of a pull request or getting a diff and syntax-highlighting that between two commits if the compare page is requested. Forgejo doesn’t touch the git repository itself; it leaves that to the `git` binary.
s/and syntax-highlighting that /(and syntax-highlighting that)/ ? It reads funny otherwise.
@ -0,0 +12,4 @@
Forgejo serves as a git server and frontend; users can pull and push to git repositories and view commits and their diff, Forgejo handles the authentication and executes actions based on the context of the request, such as sending a notification if the pushed commit was part of a pull request or getting a diff and syntax-highlighting that between two commits if the compare page is requested. Forgejo doesn’t touch the git repository itself; it leaves that to the `git` binary.
Forgejo provides a software development environment that is independent of the code associated with operating as a git server. The application handles logic and stores information in databases. The environment includes features such as user profiles, issue reporting, and packages.
Forgejo provides a software development environment that is independent of the code associated with operating as a git server
I'm not sure what you mean by that?
@ -0,0 +41,4 @@
### `routers/`
All code related to handling web and API routes resides in this directory.
s/handling web and API routes/handling network endpoints (Forgejo REST API, undocumented web API, Forgejo Actions internal API etc.)/?
@ -0,0 +55,4 @@
This directory contains integration testing code.
The files prefixed with `api_` contain integration tests for API routes, while those without are integration tests for web routes.
Note: there are integration tests that do not use web routes such as integration/dump_restore_test.go or tests/integration/cmd_keys_test.go but the overwhelming majority are indeed about web routes. Somehow I failed to notice that. Interesting.
Minor non blocking remarks. It is a good and useful overview 👍
6eb25d1e53
a0f8480bca
This is really useful @Gusted. I've suggested a few changes below but overall it's great.
One other thing is that there are several other directories that aren't included here. Most of them are less important things but perhaps a list with a very brief description for each one (just a few words) would be useful?
@ -0,0 +9,4 @@
## Bird's-eye view
Forgejo serves as a git server and frontend; users can pull and push to git repositories and view commits and their diff, Forgejo handles the authentication and executes actions based on the context of the request, such as sending a notification if the pushed commit was part of a pull request or getting a diff (and syntax-highlighting that) between two commits if the compare page is requested. Forgejo doesn’t touch the git repository itself; it leaves that to the `git` binary.
I guess "Git" should have a capital G (except when it's the name of the binary of course)
Use it instead of that when referring to the diff syntax-highlighting
@ -0,0 +35,4 @@
### `web_src/`
All code related to the web frontend resides in this directory.
I think this is a little misleading since the templates are in a different directory, as are the route handlers, both of which could be considered to be "related to the web frontend".
Perhaps clearer phrasing might be as follows?
Frontend code for the web UI resides in this directory.
On the surface it's a small difference in phrasing but I think it's less misleading. Or maybe there's a clearer way to say it; I'm half asleep now and struggling to think of the best phraseology.
Hmm... That might still be too vague. Perhaps something like the following would be clear enough?
The sources used to generate static assets used by the web UI (such as JavaScript, CSS, and SVGs) are stored in this directory
EDIT: The following line does clarify about the JS and CSS stuff, so that can be omitted, I think the rest is still relevant.
Yes, I think that's better.
@ -0,0 +47,4 @@
### `templates/`
The name is self-explanatory; this directory contains the HTML templates for the frontend.
I would personally remove The name is self-explanatory as I feel it adds nothing.
@ -0,0 +11,4 @@
Forgejo serves as a git server and frontend; users can pull and push to git repositories and view commits and their diff, Forgejo handles the authentication and executes actions based on the context of the request, such as sending a notification if the pushed commit was part of a pull request or getting a diff (and syntax-highlighting that) between two commits if the compare page is requested. Forgejo doesn’t touch the git repository itself; it leaves that to the `git` binary.
Forgejo provides a software development environment that does not rely on or interact with Git for the most part, which means that the applications handles the logic and stores information in databases. The environment includes features such as user profiles, issue reporting, and packages.
Add "also" after "Forgejo" to clarify the relation to the previous point
Is "the applications" referring to Forgejo? An s needs to be removed from "applications" or "handles" and "stores"
@ -0,0 +41,4 @@
### `routers/`
All code related to handling network endpoints (Forgejo REST API, web API, Forgejo Actions internal API etc.) resides in this directory.
"web API" is kind of ambiguous
@ -0,0 +63,4 @@
Unit tests are implemented in `<filename>_test.go_` for the corresponding `<filename>.go` code. Not all files will have unit tests.
They tests the expected result and behavior of the function.
Replace tests with test or verify
a0f8480bca
ade3bff6ff
ade3bff6ff
693f849196
Archived
Archived
Archived
Archived
Archived
Archived
Archived
Archived
Archived
Archived
Archived
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?