Gitea architecture.
Gitea is a self-hosted Git service. Nodeway mapped the go-gitea/gitea repository at commit 943eb10, from 29 November 2026, and found 2,360 source files, 16,235 functions, classes and components, 882 routes and 120 database tables. This page is drawn from that map.
- Source files
- 2,360
- Functions and classes
- 16,235
- Confirmed calls
- 55,435
- Routes
- 882
- Tables
- 120
How the code is laid out
Most of it is Go: 2,124 files of 2,360, followed by TypeScript (180), Shell (29) and Vue (26).
The repository is split into 5 packages: folders with their own manifest, such as a package.json, pyproject.toml or go.mod. The largest are routers (420 files), modelmigration (311 files), models (249 files), cmd (40 files) and tools (17 files).
These are its top-level folders by number of source files, with 9 more files at the root. The biggest ones show their own largest folders underneath.
- modules/702 files1 table
- git/92 files
- structs/61 files
- setting/60 files
- markup/47 files
- packages/42 files
- indexer/41 files
- routers/package420 files875 routes
- web/201 files523 routes
- api/180 files314 routes
- common/19 files10 routes
- services/398 files1 table
- auth/46 files1 table
- repository/38 files
- actions/28 files
- modelmigration/package311 files
- v1_12/23 files
- v1_14/23 files
- v1_16/22 files
- models/package249 files1 route · 118 tables
- issues/30 files17 tables
- repo/30 files18 tables
- actions/27 files15 tables
- web_src/js/192 files
- features/86 files
- modules/32 files
- components/31 files
- cmd/package40 files6 routes
- tools/package17 files
- eslint-rules/1 file
- docker/14 files
- root/10 files
- rootless/usr/local/bin/4 files
- contrib/6 files
- service/4 files
- fhs-compliant-script/1 file
- snap/2 files
Where the code starts
Nodeway looked for files that define a main function, and for files named like a starting point (main, server, app, cli and similar) that at most one other file imports, then for index files that nothing imports. Ranked that way, then by how many files each one reaches through its imports:
| File | Reaches |
|---|---|
| services/lfs/server.go | 17 files |
| models/actions/run.go | 12 files |
| routers/api/v1/user/app.go | 11 files |
| main.godefines main | 9 files |
| services/actions/run.go | 5 files |
| services/gitproxy/server.go | 5 files |
Routes
Nodeway found 882 routes and linked 878 to the function that handles them. They by HTTP method: GET 464, POST 362, DELETE 20, ANY 15, PUT 14, PATCH 5. Most are under routers/web (523), routers/api (314) and routers/private (21).
Some of them
| Route | Method |
|---|---|
| /Install · routers/install/routes.go | GET |
| /SetDefaultBranchPost · routers/web/web.go | POST |
| /jwksoidcKeys · routers/api/actions/actions.go | GET |
| /runsListWorkflowRuns · routers/api/v1/api.go | GET |
| /v2/_catalogGetRepositoryList · routers/api/packages/api.go | GET |
| /debug/fgprofservePprof · cmd/web.go | ANY |
| /api/internalGetListLockHandler · routers/common/lfs.go | GET |
| /-/fetch-redirectFetchRedirectDelegate · routers/init.go | POST |
Data model
Nodeway found 120 database tables, defined with xorm. Code in the repository reads or writes 119 of them. The most used:
| Table | Used by |
|---|---|
| repository46 columns · models/repo/repo.go | 32 read44 write |
| user46 columns · models/user/user.go | 44 read25 write |
| comment37 columns · links to issue, label and milestone · models/issues/comment.go | 19 read17 write |
| issue21 columns · links to milestone · models/issues/issue.go | 20 read7 write |
| attachment12 columns · links to comment, issue and release · models/repo/attachment.go | 17 read10 write |
| release17 columns · models/repo/release.go | 20 read5 write |
| label13 columns · models/issues/label.go | 18 read7 write |
| branch12 columns · models/git/branch.go | 18 read6 write |
One request, traced
Nodeway followed GET /token from its route to the code that handles it, then along confirmed calls until it reached the action_run table.
- GET /tokenroute · routers/api/actions/actions.go
- oidcTokenfunction · routers/api/actions/oidc.go:48
- CreateOIDCTokenfunction · services/actions/oidc.go:115
- LoadAttributesmethod · models/actions/run_job.go:187
- LoadRunmethod · models/actions/run_job.go:164
- GetRunByRepoAndIDfunction · models/actions/run.go:288
- action_runtable · read here
The most-called code
Ranked by how many different functions call each one, counting only calls the analyzer could confirm from the code. These are often the helpers worth reading first.
| Function | Callers |
|---|---|
| GetEnginefunction · models/db/context.go | 961 |
| Errorfunction · modules/log/logger_global.go | 905 |
| ServerErrorAutomethod · services/context/context_response.go | 559 |
| APIErrorInternalmethod · services/context/api.go | 385 |
| HTMLmethod · services/context/context_response.go | 230 |
| APIErrormethod · services/context/api.go | 221 |
| Tracefunction · modules/log/logger_global.go | 216 |
| Warnfunction · modules/log/logger_global.go | 193 |
Open this repo in Nodeway
Nodeway is a desktop app that draws this map on your own computer, so you can click into any folder, read the code beside the map and trace a request yourself. Clone the repository:
git clone https://github.com/go-gitea/gitea.git- Install Nodeway for macOS, Windows or Linux: the getting started guide has every installer.
- Open the cloned folder. The first map is drawn on your machine and nothing is uploaded.
- Search for
GetEngineand trace what it calls, or pick a route and follow it to the database.
New to reading a codebase this size? See how to understand a large codebase and how to read a call graph.
Questions
What language is Gitea written in?
Mostly Go: 2,124 of its 2,360 source files at commit 943eb10, then TypeScript with 180.
Where does the Gitea code start?
The entry point that reaches the most code is services/lfs/server.go, which leads to 17 files through its imports.
How many routes does Gitea have?
Nodeway found 882 routes, 878 of them linked to a handler. The most are under routers/web.
What database tables does Gitea use?
120 tables, defined with xorm. The most used are repository, user and comment.
How this page was made
Generated from a map Nodeway's analyzer (version 18) made of go-gitea/gitea at commit 943eb10, committed on 29 November 2026. Tests, dependencies and build output are mostly left out. A call counts only when the analyzer could confirm its target from the code, so real totals are higher. The project will have changed since.