Skip to Content
API ReferenceConfiguration

Configuration

NeatNode templates come preconfigured, but you can still adjust the generated project through config files, environment variables, and template-aware project settings.


Project Config

Use a project config file to control the template, feature flags, validation stack, and source layout.

export default { template: "rest-api", features: { resourceGenerator: true, }, language: "typescript", architecture: "modular", database: { provider: "mongodb", client: "mongoose", }, validation: "zod", srcDir: "src", };

Configuration Fields

FieldPurpose
templateSelects the template family to generate.
features.resourceGeneratorEnables resource generation in supported templates.
languageChooses JavaScript or TypeScript output.
architectureSelects the folder architecture when a template supports multiple layouts.
validationChooses the validation library or strategy.
srcDirSets the source directory root.
database.providerDeclares the database backend.
database.clientSelects the database client or ORM.

[!NOTE] Unsupported fields are ignored by templates that do not recognize them.


Environment Variables

Each template includes a .env.example file. Copy and rename it:

cp .env.example .env

Common variables:

VariableDescriptionDefault
PORTServer port5000
NODE_ENVEnvironment modedevelopment
DB_URLDatabase connection string-
JWT_SECRETSecret for JWT tokens-

Config Files

FileLocationPurpose
db.jssrc/config/Database connection logic
logger.jssrc/config/Winston or console logger
socket.jssrc/config/Socket.IO initialization
cors.jssrc/config/CORS options

TypeScript Config

TypeScript templates include a tsconfig.json with:

  • Strict mode enabled
  • ES module output
  • Path aliases configured
  • Source maps for debugging

Customizing Config

All config files are in src/config/. You can:

  • Modify existing files directly
  • Add new config modules (Redis, mail, etc.)
  • Import them in server.js or app.js

See Customization Guide for detailed examples.