Skip to content

Convex project layout

The directory layout of a Convex-style Nimbus project: what nimbus init convex scaffolds, what the toolchain recognizes, and what codegen writes.

A project after its first nimbus dev run:

my-app/
├── convex/
│ ├── _generated/ # written by codegen — do not edit
│ │ ├── api.ts
│ │ ├── server.ts
│ │ ├── scheduled_functions.ts
│ │ └── dataModel.d.ts
│ ├── schema.ts # scaffolded; optional
│ └── messages.ts # scaffolded example functions
├── .nimbus/ # local state — gitignored
│ ├── convex/ # codegen build artifacts
│ ├── dev/ # dev-server data
│ └── packages/ # provisioned npm packages
├── .env.local # written by nimbus dev — gitignored
├── .gitignore
├── package.json
└── tsconfig.json
FileContents
convex/schema.tsA messages table with author and body string fields and a by_author index.
convex/messages.tsExample list query and send mutation.
package.jsonDeclares "convex": "file:./.nimbus/packages/convex". No codegen dependency — codegen is embedded in the Nimbus binary.
tsconfig.jsontarget/module esnext, moduleResolution bundler, strict, noEmit, include: ["convex"].
.gitignoreIgnores .nimbus/, .env.local, and node_modules/.
FileRole
convex/schema.tsTable definitions. Optional: with no schema file the project compiles with zero tables, and tables accept documents of any shape. Must export default defineSchema(...).
convex/*.tsFunction modules. Exports registered with query, mutation, action, httpAction, or their internal variants become callable functions.
convex/http.tsThe only file HTTP routes are read from. Must export default a router initialized with httpRouter().
convex/auth.config.ts or .jsAuth provider list. Exactly one of the two extensions may exist. process.env reads resolve at codegen time.
convex.jsonProject configuration (see below).
KeyValues
node.nodeVersion"20", "22", "24", or "26". Default "24". Applies to "use node" modules.
node.externalPackagesArray of package names left external to the bundle, or ["*"] (which must appear alone) for all packages.

convex/_generated/ is rewritten by codegen on every run:

FileContents
api.tsThe api and internal function-reference trees.
server.tsRe-exports the function registrars (query, mutation, action, httpAction, internalQuery, internalMutation, internalAction, paginatedQuery, internalPaginatedQuery, plus defineSchema, defineTable, httpRouter) and the QueryCtx, MutationCtx, and ActionCtx types.
scheduled_functions.tsReferences for schedulable (mutation) functions.
dataModel.d.tsDoc, Id, TableNames, and DataModel types derived from the schema, including the _id, _creationTime, and _updateTime system fields.

.nimbus/convex/ holds the build artifacts the server executes:

FileContents
functions.jsonFunction manifest.
schema.jsonCompiled schema.
http_routes.jsonRoutes parsed from convex/http.ts.
auth.config.jsonCompiled auth providers.
node_external_packages.jsonResolved external-package list.
bundle.mjsThe executable function bundle.
bundle.sha256Bundle digest, verified before every invocation.
PathContents
.nimbus/dev/Dev-server data directory (override with nimbus dev --data-dir).
.nimbus/packages/The Nimbus-provisioned convex npm package targeted by the file: dependency.
.env.localWritten by nimbus dev: NIMBUS_DEPLOYMENT=local:<slug> identifying the local deployment.
VariableMeaning
NIMBUS_DEPLOYMENTLocal deployment marker written to .env.local by nimbus dev.
NIMBUS_CODEGEN_RUNNERSet to external-node to run codegen through an external Node.js toolchain instead of the in-binary default (diagnostic use).