Twenty architecture.
Twenty is an open-source CRM. Nodeway mapped the twentyhq/twenty repository at commit d04d239, from 29 November 2026, and found 31,808 source files, 41,249 functions, classes and components, 193 routes and 89 database tables. This page is drawn from that map.
- Source files
- 31,808
- Functions and classes
- 41,249
- Confirmed calls
- 81,104
- Routes
- 193
- Tables
- 89
How the code is laid out
Most of it is TypeScript: 31,685 files of 31,808, followed by JavaScript (82), Python (20) and Shell (20).
The repository is split into 46 packages: folders with their own manifest, such as a package.json, pyproject.toml or go.mod. The largest are packages/twenty-server (11,200 files), packages/twenty-front (10,695 files), packages/twenty-shared (1,493 files), packages/twenty-ui (1,379 files), packages/twenty-front-component-renderer (1,338 files) and packages/twenty-website (1,111 files).
These are its top-level folders by number of source files, with 2 more files at the root. The biggest ones show their own largest folders underneath.
- packages/31,806 files193 routes · 89 tables
- twenty-server/package11,200 files155 routes · 89 tables
- twenty-front/package10,695 files
- twenty-apps/3,381 files
- twenty-shared/package1,493 files
- twenty-ui/package1,379 files
- twenty-front-component-renderer/package1,338 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 |
|---|---|
| packages/twenty-server/src/main.ts | 10,429 files |
| packages/twenty-companion/src/renderer/main.tsx | 242 files |
| packages/twenty-front/scripts/generate-mock-data.tsdefines main | 59 files |
Routes
Nodeway found 193 routes, 25 of them pages, and linked 193 to the function that handles them. The rest by HTTP method: GET 75, POST 56, PATCH 17, DELETE 15, PUT 5. Most are under packages/twenty-server (155) and packages/twenty-website (38).
Some of them
| Route | Method |
|---|---|
| /handleMcpCore · packages/twenty-server/src/engine/api/mcp/controllers/mcp-core.controller.ts | POST |
| /findAll · packages/twenty-server/src/engine/core-modules/api-key/controllers/api-key.controller.ts | GET |
| /uploadFileById · packages/twenty-server/src/engine/core-modules/file/file-upload/controllers/file-upload.controller.ts | PUT |
| /getget · packages/twenty-server/src/engine/core-modules/application/connection-provider/connections/application-connections.controller.ts | POST |
| /:idfindOne · packages/twenty-server/src/engine/metadata-modules/field-metadata/controllers/field-metadata.controller.ts | GET |
| /:idupdateOnePatch · packages/twenty-server/src/engine/metadata-modules/object-metadata/controllers/object-metadata.controller.ts | PATCH |
| /:iddestroy · packages/twenty-server/src/engine/metadata-modules/page-layout-tab/controllers/page-layout-tab.controller.ts | DELETE |
| /allhandleUnsubscribeAll · packages/twenty-server/src/modules/emailing/controllers/unsubscribe.controller.ts | POST |
Data model
Nodeway found 89 database tables, defined with TypeORM. Code in the repository reads or writes 88 of them. The most used:
| Table | Used by |
|---|---|
| workspace46 columns · links to application and file · packages/twenty-server/src/engine/core-modules/workspace/workspace.entity.ts | 117 read22 write |
| messageChannel29 columns · links to connectedAccount and workspace · packages/twenty-server/src/engine/metadata-modules/message-channel/entities/message-channel.entity.ts | 68 read27 write |
| application39 columns · links to applicationRegistration, file and publicDomain · packages/twenty-server/src/engine/core-modules/application/application.entity.ts | 74 read7 write |
| connectedAccount25 columns · links to application, connectionProvider and workspace · packages/twenty-server/src/engine/metadata-modules/connected-account/entities/connected-account.entity.ts | 60 read18 write |
| userWorkspace11 columns · links to file, user and workspace · packages/twenty-server/src/engine/core-modules/user-workspace/user-workspace.entity.ts | 70 read4 write |
| calendarChannel22 columns · links to connectedAccount and workspace · packages/twenty-server/src/engine/metadata-modules/calendar-channel/entities/calendar-channel.entity.ts | 46 read27 write |
| file15 columns · links to application, applicationRegistration and workspace · packages/twenty-server/src/engine/core-modules/file/entities/file.entity.ts | 55 read14 write |
| applicationRegistration33 columns · links to file, user and workspace · packages/twenty-server/src/engine/core-modules/application/application-registration/application-registration.entity.ts | 37 read13 write |
One request, traced
Nodeway followed GET /redirect from its route to the code that handles it, then along confirmed calls until it reached the workspace table.
- GET /redirectroute · packages/twenty-server/src/engine/core-modules/auth/controllers/google-auth.controller.ts
- googleAuthRedirectmethod · packages/twenty-server/src/engine/core-modules/auth/controllers/google-auth.controller.ts:39
- signInUpWithSocialSsomethod · packages/twenty-server/src/engine/core-modules/auth/services/auth.service.ts:1041
- signInUpmethod · packages/twenty-server/src/engine/core-modules/auth/services/auth.service.ts:373
- signInUpmethod · packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts:140
- signUpOnNewWorkspacemethod · packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts:691
- workspacetable · written 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 |
|---|---|
| isDefinedfunction · packages/twenty-shared/src/utils/validation/isDefined.ts | 8,304 |
| useAtomStateValuehook · packages/twenty-front/src/modules/ui/utilities/state/jotai/hooks/useAtomStateValue.ts | 729 |
| AuthWorkspacefunction · packages/twenty-server/src/engine/decorators/auth/auth-workspace.decorator.ts | 634 |
| isNonEmptyArrayfunction · packages/twenty-shared/src/utils/array/isNonEmptyArray.ts | 587 |
| doNotTranslatefunction · packages/twenty-shared/src/i18n/do-not-translate.ts | 584 |
| getOrRecomputemethod · packages/twenty-server/src/engine/workspace-cache/services/workspace-cache.service.ts | 567 |
| AccessPolicyGuardfunction · packages/twenty-server/src/engine/guards/access-policy.guard.ts | 508 |
| useAtomComponentStateValuehook · packages/twenty-front/src/modules/ui/utilities/state/jotai/hooks/useAtomComponentStateValue.ts | 453 |
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/twentyhq/twenty.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
isDefinedand 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 Twenty written in?
Mostly TypeScript: 31,685 of its 31,808 source files at commit d04d239, then JavaScript with 82.
Where does the Twenty code start?
The entry point that reaches the most code is packages/twenty-server/src/main.ts, which leads to 10,429 files through its imports.
How many routes does Twenty have?
Nodeway found 193 routes, 193 of them linked to a handler. The most are under packages/twenty-server.
What database tables does Twenty use?
89 tables, defined with TypeORM. The most used are workspace, messageChannel and application.
How this page was made
Generated from a map Nodeway's analyzer (version 18) made of twentyhq/twenty at commit d04d239, 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.