Medusa architecture.
Medusa is a commerce platform. Nodeway mapped the medusajs/medusa repository at commit 01f39c4, from 27 November 2026, and found 10,051 source files, 14,081 functions, classes and components, 50 routes and 36 database tables. This page is drawn from that map.
- Source files
- 10,051
- Functions and classes
- 14,081
- Confirmed calls
- 23,345
- Routes
- 50
- Tables
- 36
How the code is laid out
Most of it is TypeScript: 8,824 files of 10,051, followed by JavaScript (689), Shell (535) and Python (3).
The repository is split into 115 packages: folders with their own manifest, such as a package.json, pyproject.toml or go.mod. The largest are www (2,303 files), packages/admin/dashboard (1,983 files), www/apps/api-reference (1,054 files), packages/core/core-flows (869 files), packages/medusa (796 files) and packages/core/types (742 files).
These are its top-level folders by number of source files, with 5 more files at the root. The biggest ones show their own largest folders underneath.
- packages/7,635 files4 routes · 36 tables
- core/2,288 files36 tables
- admin/2,076 files2 routes
- modules/1,087 files
- medusa/package796 files1 route
- design-system/651 files
- plugins/455 files
- www/package2,303 files43 routes
- apps/1,499 files43 routes
- packages/480 files
- utils/package316 files
- integration-tests/package62 files3 routes
- http/package31 files
- modules/package14 files3 routes
- helpers/6 files
- scripts/45 files
- deps-update/8 files
- deps-analyze/2 files
- .claude/skills/generating-icons/scripts/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/medusa/src/commands/db/setup.tsdefines main | 1,206 files |
| packages/medusa/src/commands/db/migrate.tsdefines main | 1,204 files |
| packages/admin/dashboard/src/main.tsx | 625 files |
| www/utils/packages/docs-generator/src/commands/run.ts | 41 files |
| www/apps/resources/scripts/prepare.mjsdefines main | 39 files |
| www/utils/packages/release-banner/src/cli.ts | 15 files |
Routes
Nodeway found 50 routes, 5 of them pages, and linked 35 to the function that handles them. The rest by HTTP method: GET 26, POST 10, HEAD 5, OPTIONS 4. Most are under www/apps (43), integration-tests/modules (3) and packages/admin (2).
Some of them
| Route | Method |
|---|---|
| /serve · packages/admin/admin-bundler/src/commands/serve.ts | GET |
| /tagGET · www/apps/api-reference/app/tag/route.ts | GET |
| /schemaGET · www/apps/api-reference/app/schema/route.ts | GET |
| /versionsGET · www/apps/api-reference/app/versions/route.ts | GET |
| /base-specsGET · www/apps/api-reference/app/base-specs/route.ts | GET |
| /robots.txtGET · www/apps/book/app/robots.txt/route.ts | GET |
| /api/changelogGET · www/apps/cloud/app/api/changelog/route.ts | GET |
| /download/[area]GET · www/apps/api-reference/app/download/[area]/route.ts | GET |
Data model
Nodeway found 36 database tables. Code in the repository reads or writes 4 of them. The most used:
| Table | Used by |
|---|---|
| product_option_value2 columns · links to product_option · packages/core/utils/src/dal/mikro-orm/__fixtures__/utils.ts | 2 read0 write |
| product_variant2 columns · links to product · packages/core/utils/src/dal/mikro-orm/__fixtures__/utils.ts | 2 read0 write |
| product_option1 column · links to product · packages/core/utils/src/dal/mikro-orm/__fixtures__/utils.ts | 1 read0 write |
| productpackages/core/utils/src/dal/mikro-orm/__fixtures__/utils.ts | 1 read0 write |
| deep_recursive_entity22 columns · links to deep_recursive_entity1 and deep_recursive_entity3 · packages/core/utils/src/dal/mikro-orm/__fixtures__/utils.ts | 0 read0 write |
| entity22 columns · links to entity1 · packages/core/utils/src/dal/mikro-orm/__fixtures__/utils.ts | 0 read0 write |
| entity2_with_un_decorated_prop2 columns · links to entity1_with_un_decorated_prop · packages/core/utils/src/dal/mikro-orm/__fixtures__/utils.ts | 0 read0 write |
| searchable_entity22 columns · links to searchable_entity1 · packages/core/utils/src/dal/mikro-orm/__fixtures__/utils.ts | 0 read0 write |
One request, traced
Nodeway followed GET /md-content/[[...slug]] from its route to the code that handles it, then along confirmed calls.
- GET /md-content/[[...slug]]route · www/apps/api-reference/app/md-content/[[...slug]]/route.ts
- GETfunction · www/apps/api-reference/app/md-content/[[...slug]]/route.ts:177
- resolveMarkdownfunction · www/apps/api-reference/app/md-content/[[...slug]]/route.ts:144
- resolveMarkdown_function · www/apps/api-reference/app/md-content/[[...slug]]/route.ts:73
- fetchAssociatedSchemafunction · www/apps/api-reference/app/md-content/[[...slug]]/route.ts:37
- getPathForEnvfunction · www/apps/api-reference/utils/get-path-for-env.ts:3
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 |
|---|---|
| createStepfunction · packages/core/workflows-sdk/src/utils/composer/create-step.ts | 591 |
| MedusaContextfunction · packages/core/utils/src/modules-sdk/decorators/context-parameter.ts | 570 |
| fetchmethod · packages/core/js-sdk/src/client.ts | 439 |
| createWorkflowfunction · packages/core/workflows-sdk/src/utils/composer/create-workflow.ts | 415 |
| queryKeysFactoryfunction · packages/admin/dashboard/src/lib/query-key-factory.ts | 410 |
| InjectManagerfunction · packages/core/utils/src/modules-sdk/decorators/inject-manager.ts | 331 |
| transformfunction · packages/core/workflows-sdk/src/utils/composer/transform.ts | 282 |
| InjectTransactionManagerfunction · packages/core/utils/src/modules-sdk/decorators/inject-transaction-manager.ts | 250 |
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/medusajs/medusa.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
createStepand 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 Medusa written in?
Mostly TypeScript: 8,824 of its 10,051 source files at commit 01f39c4, then JavaScript with 689.
Where does the Medusa code start?
The entry point that reaches the most code is packages/medusa/src/commands/db/setup.ts, which leads to 1,206 files through its imports.
How many routes does Medusa have?
Nodeway found 50 routes, 35 of them linked to a handler. The most are under www/apps.
What database tables does Medusa use?
36 tables. The most used are product_option_value, product_variant and product_option.
How this page was made
Generated from a map Nodeway's analyzer (version 18) made of medusajs/medusa at commit 01f39c4, committed on 27 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.