Awesome NestJS Boilerplate , Typescript , Postgres , TypeORM
Awesome NestJS Boilerplate , Typescript , Postgres , TypeORM
An enterprise-grade NestJS starter built for teams that care about code structure at scale. Ships with CQRS, strict TypeScript, JWT auth (RS256), and multi-runtime support — all wired with zero configuration drift.
# 1. Clone
npx degit NarHakobyan/awesome-nest-boilerplate my-nest-app
cd my-nest-app
# 2. Configure
cp .env.example .env
# Set DB_HOST, DB_PORT, DB_USERNAME, DB_PASSWORD, DB_DATABASE
# Paste your JWT_PRIVATE_KEY and JWT_PUBLIC_KEY (see .env.example for examples)
# 3. Install & run
pnpm install
pnpm start:dev
Open http://localhost:3000. The API docs are at /documentation.
Prefer a database out of the box?
docker-compose up -d postgresfirst.
any, ESM, verbatim modules
i18n — Multi-language (en_US, ru_RU)
Swagger — Auto-generated API docs
Vite HMR — Instant dev reload
UUID v7 — Time-sortable primary keys
Biome + ESLint — Linting & formatting
Helmet + Rate Limiting — Built-in security
CORS — Configurable origins
Validation — Custom decorators, DTO guards
Node / Bun / Deno — Multi-runtime
OpenAPI MCP — AI assistants call your API
A typical CQRS flow — command, handler, and service wired through NestJS DI:
…
flowchart LR
A[Request] --> B[Guard]
B --> C[Controller]
C --> D[Command / Query Bus]
D --> E[Handler]
E --> F[Service]
F --> G[Repository]
G --> H[(PostgreSQL)]
Every feature module follows this structure:
…
Copy .env.example → .env. Most variables come pre-configured with working defaults. You only need to change these:
DB_HOST, DB_PORT, DB_USERNAME, DB_PASSWORD, DB_DATABASE
PostgreSQL connection (or use docker-compose up -d postgres — defaults match)
JWT_PRIVATE_KEY
RS256 private key — generate your own or use the example PEM in .env.example
JWT_PUBLIC_KEY
RS256 public key — matching public key
Every other variable in .env.example has a working default for local development. Optional features (NATS, S3, Email, AI providers) are off by default — enable them when you need them.
pnpm start:dev
bun start:dev:bun
deno task start
pnpm test
bun test
deno task test
pnpm build:prod
bun build:bun
deno task buildr
Node is the primary runtime. Bun and Deno support is included for teams that prefer them.
name in package.json.env — replace the JWT keys and DB credentials with your ownLICENSE — change the author nameNo open issues yet, or sync has not completed.