Payload architecture.
Payload is a full-stack Next.js framework and headless CMS. Nodeway mapped the payloadcms/payload repository at commit 9402c41, from 28 November 2026, and found 5,456 source files, 7,640 functions, classes and components, 315 routes and 1 database table. This page is drawn from that map.
- Source files
- 5,456
- Functions and classes
- 7,640
- Confirmed calls
- 12,114
- Routes
- 315
- Tables
- 1
How the code is laid out
Most of it is TypeScript: 5,257 files of 5,456, followed by JavaScript (185), Shell (11) and Astro (3).
The repository is split into 81 packages: folders with their own manifest, such as a package.json, pyproject.toml or go.mod. The largest are packages/ui (1,019 files), packages/payload (881 files), packages/richtext-lexical (482 files), packages/codemod (275 files), templates/ecommerce (230 files) and packages/drizzle (174 files).
These are its top-level folders by number of source files, with 10 more files at the root. The biggest ones show their own largest folders underneath.
- packages/3,947 files1 table
- ui/package1,019 files
- payload/package881 files
- richtext-lexical/package482 files
- codemod/package275 files
- drizzle/package174 files
- plugin-import-export/package115 files
- templates/743 files152 routes
- ecommerce/package230 files28 routes
- with-vercel-website/package171 files21 routes
- website/package167 files21 routes
- examples/581 files153 routes
- localization/package161 files16 routes
- custom-components/package94 files9 routes
- form-builder/package64 files11 routes
- .github/65 files
- actions/35 files
- scripts/25 files
- workflows/5 files
- tools/57 files
- releaser/package35 files
- scripts/package18 files
- upgrade/3 files
- .agents/skills/record-pr-demo/scripts/14 files
- WindowChrome/2 files
- preview/1 file
- scripts/13 files
- app/9 files10 routes
- (payload)/6 files9 routes
- (app)/1 file
- my-route/1 file1 route
- app-tanstack/8 files
- app/7 files
- .stylelint/6 files
- .claude/hooks/1 file
- .devcontainer/1 file
- docs/1 file
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/tanstack-start/src/exports/server.ts | 1,388 files |
| packages/tanstack-start/src/adapters/layout/server.ts | 785 files |
| packages/payload/src/exports/cli.ts | 677 files |
| tools/releaser/src/release-bump.tsdefines main | 19 files |
| tools/releaser/src/release-ci.tsdefines main | 16 files |
| .github/scripts/audit-deps/cli.mjsdefines main | 15 files |
Routes
Nodeway found 315 routes, 84 of them pages, and linked 281 to the function that handles them. The rest by HTTP method: GET 72, POST 51, OPTIONS 46, DELETE 24, PATCH 24, PUT 13. Most are under templates/ecommerce (28), templates/website (21) and templates/with-vercel-website (21).
Some of them
| Route | Method |
|---|---|
| /previewGET · examples/draft-preview/src/app/(app)/preview/route.ts | GET |
| /my-routeGET · app/my-route/route.ts | GET |
| /next/seedPOST · templates/ecommerce/src/app/(app)/next/seed/route.ts | POST |
| /api/graphqlOPTIONS · app/(payload)/api/graphql/route.ts | OPTIONS |
| /api/graphqlPOST · examples/astro/payload/src/app/(payload)/api/graphql/route.ts | POST |
| /exit-previewGET · examples/draft-preview/src/app/(app)/exit-preview/route.ts | GET |
| /next/previewGET · examples/localization/src/app/(frontend)/next/preview/route.ts | GET |
| /api/[...slug]DELETE · app/(payload)/api/[...slug]/route.ts | DELETE |
Data model
Nodeway found 1 database table, defined with Mongoose. Code in the repository reads or writes 0 of them. The most used:
| Table | Used by |
|---|---|
| globals3 columns · packages/db-mongodb/src/models/buildGlobalModel.ts | 0 read0 write |
One request, traced
Nodeway followed DELETE /api/[...slug] from its route to the code that handles it, then along confirmed calls.
- DELETE /api/[...slug]route · app/(payload)/api/[...slug]/route.ts
- DELETEfunction · app/(payload)/api/[...slug]/route.ts:7
- handlerBuilderfunction · packages/next/src/routes/rest/index.ts:8
- handleEndpointsfunction · packages/payload/src/utilities/handleEndpoints.ts:66
- authenticateRequestfunction · packages/payload/src/utilities/createPayloadRequestFromWebRequest.ts:137
- executeAuthStrategiesfunction · packages/payload/src/auth/executeAuthStrategies.ts:5
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 |
|---|---|
| useTranslationhook · packages/ui/src/providers/Translation/context.ts | 354 |
| useConfighook · packages/ui/src/providers/Config/index.tsx | 167 |
| getTranslationfunction · packages/translations/src/utilities/getTranslation.ts | 166 |
| handlerBuilderfunction · packages/next/src/routes/rest/index.ts | 155 |
| findmethod · packages/payload/src/index.ts | 124 |
| formatAdminURLfunction · packages/payload/src/utilities/formatAdminURL.ts | 123 |
| getPayloadfunction · packages/payload/src/index.ts | 112 |
| fieldAffectsDatafunction · packages/payload/src/fields/config/types.ts | 87 |
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/payloadcms/payload.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
useTranslationand 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 Payload written in?
Mostly TypeScript: 5,257 of its 5,456 source files at commit 9402c41, then JavaScript with 185.
Where does the Payload code start?
The entry point that reaches the most code is packages/tanstack-start/src/exports/server.ts, which leads to 1,388 files through its imports.
How many routes does Payload have?
Nodeway found 315 routes, 281 of them linked to a handler. The most are under templates/ecommerce.
What database tables does Payload use?
1 table, defined with Mongoose. The most used are globals.
How this page was made
Generated from a map Nodeway's analyzer (version 18) made of payloadcms/payload at commit 9402c41, committed on 28 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.