Directus architecture.
Directus is a backend that turns a SQL database into an API and admin app. Nodeway mapped the directus/directus repository at commit 4856582, from 23 November 2026, and found 2,800 source files, 7,461 functions, classes and components and 372 routes. This page is drawn from that map.
- Source files
- 2,800
- Functions and classes
- 7,461
- Confirmed calls
- 9,943
- Routes
- 372
- Tables
- 0
How the code is laid out
Most of it is TypeScript: 2,163 files of 2,800, followed by Vue (609) and JavaScript (28).
The repository is split into 37 packages: folders with their own manifest, such as a package.json, pyproject.toml or go.mod. The largest are app (1,169 files), api (856 files), sdk (215 files), packages/utils (75 files), packages/extensions-sdk (65 files) and packages/types (57 files).
These are its top-level folders by number of source files, with 4 more files at the root. The biggest ones show their own largest folders underneath.
- app/package1,169 files107 routes
- src/1,168 files107 routes
- api/package856 files263 routes
- src/854 files263 routes
- packages/551 files2 routes
- utils/package75 files
- extensions-sdk/package65 files2 routes
- types/package57 files
- sdk/package215 files
- src/213 files
- .claude/hooks/3 files
- directus/package2 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 |
|---|---|
| api/src/cli/run.ts | 809 files |
| api/src/start.ts | 787 files |
| api/src/controllers/server.ts | 786 files |
| app/src/main.ts | 545 files |
| packages/extensions-sdk/src/cli/run.ts | 35 files |
| app/src/modules/settings/index.ts | 668 files |
Routes
Nodeway found 372 routes and linked 253 to the function that handles them. They by HTTP method: POST 129, GET 125, PATCH 59, DELETE 58, OPTIONS 1. Most are under api/src (263), app/src (107) and packages/extensions-sdk (2).
Some of them
| Route | Method |
|---|---|
| /respond · api/src/auth/drivers/ldap.ts | POST |
| /respond · api/src/auth/drivers/oauth2.ts | GET |
| /respond · api/src/controllers/access.ts | PATCH |
| /respond · api/src/controllers/comments.ts | DELETE |
| /merespond · api/src/controllers/permissions.ts | GET |
| /merespond · api/src/controllers/users.ts | PATCH |
| /acsrespond · api/src/auth/drivers/saml.ts | POST |
| /:pkrespond · api/src/controllers/activity.ts | GET |
One request, traced
Nodeway followed GET /admin from its route to the code that handles it, then along confirmed calls.
- GET /adminroute · api/src/app.ts
- createAppfunction · api/src/app.ts:93
- registerAuthProvidersfunction · api/src/auth.ts:31
- getDatabasefunction · api/src/database/index.ts:34
- createMetricsfunction · api/src/metrics/lib/create-metrics.ts:21
- hasDatabaseConnectionfunction · api/src/database/index.ts:177
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 |
|---|---|
| useEnvhook · packages/env/src/lib/use-env.ts | 191 |
| useLoggerhook · api/src/logger/index.ts | 179 |
| throwIfEmptyfunction · sdk/src/rest/utils/throw-if-empty.ts | 140 |
| unexpectedErrorfunction · app/src/utils/unexpected-error.ts | 133 |
| getDatabasefunction · api/src/database/index.ts | 117 |
| useFieldsStorehook · app/src/stores/fields.ts | 98 |
| getSchemafunction · api/src/utils/get-schema.ts | 94 |
| asyncHandlerfunction · api/src/utils/async-handler.ts | 89 |
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/directus/directus.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
useEnvand 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 Directus written in?
Mostly TypeScript: 2,163 of its 2,800 source files at commit 4856582, then Vue with 609.
Where does the Directus code start?
The entry point that reaches the most code is api/src/cli/run.ts, which leads to 809 files through its imports.
How many routes does Directus have?
Nodeway found 372 routes, 253 of them linked to a handler. The most are under api/src.
How this page was made
Generated from a map Nodeway's analyzer (version 18) made of directus/directus at commit 4856582, committed on 23 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.