init-backend-project
v1.1.7
Published
Create production-ready Node.js, Express, Fastify, and NestJS backend starter projects with one CLI command.
Downloads
2,725
Maintainers
Keywords
Readme
init-backend-project
Create clean, runnable backend starter projects for Node.js, Express, Fastify, and NestJS with one interactive CLI.
init-backend-project generates real starter code with framework-specific app startup, a health endpoint, environment config, consistent response helpers, error handling, and optional setup for Docker Compose, testing, linting, validation, authentication, databases, and ORMs.
Requirements
- Node.js 18.17 or newer
- npm, yarn, or pnpm
Quick Start
Create a backend project:
npx init-backend-project my-apiOpen it and run the server:
cd my-api
npm install
npm run devIf you choose automatic dependency installation during setup, you can skip npm install.
Open the health check:
http://localhost:3000/healthExample response:
{
"success": true,
"message": "API is running",
"timestamp": "2026-04-29T00:00:00.000Z"
}Usage
Run with npx:
npx init-backend-project my-apiRun the interactive prompt without a project name:
npx init-backend-projectUse npm exec:
npm exec init-backend-project my-apiInstall globally if you generate projects often:
npm install -g init-backend-project
init-backend-project my-apiNote: npm install init-backend-project only installs this package into the current project. To create a new backend app, use npx, npm exec, or the global CLI command.
What It Generates
Every generated project includes a practical backend foundation:
- App and server entry points
- Environment configuration
- Health check endpoint
- Centralized error and not-found handling
- Consistent JSON response helpers
- Feature-based module structure
- Generated
.env.example,.gitignore,package.json, andREADME.md
Express, Fastify, and raw Node.js projects use this structure:
project-name/
src/
common/
http/ # Express and Node.js response helpers
plugins/ # Fastify app plugins
middlewares/ # Express and Node.js middleware
utils/
config/
modules/
health/
app.js or app.ts
server.js or server.ts
.env.example
.gitignore
package.json
README.mdTypeScript projects also include:
tsconfig.json
src/types/NestJS projects use a Nest-style structure:
project-name/
src/
common/
decorators/
dto/
filters/
interceptors/
config/
modules/
health/
app.module.ts
main.ts
tsconfig.json
package.json
README.mdSupported Choices
Frameworks:
- Node.js
- Express
- Fastify
- NestJS
Languages:
- JavaScript
- TypeScript
Package managers:
- npm
- yarn
- pnpm
Databases:
- None
- PostgreSQL
- MySQL
- MongoDB
- Redis
ORMs:
- None
- Prisma
- TypeORM
- Mongoose
Authentication:
- None
- JWT Auth
- Session Auth
API documentation:
- None
- Swagger / OpenAPI
Validation:
- None
- Zod
- Joi
- class-validator for NestJS
Testing:
- None
- Jest
- Vitest
Optional tools:
- Docker and Docker Compose
- ESLint and Prettier
- Git initialization
- Dependency installation
Package Manager Commands
Run the generated project with your selected package manager:
npm run devyarn devpnpm devWhen the server starts, the terminal prints the framework and health check URLs:
[my-api] Express API running on http://localhost:3000
[my-api] Health check: http://localhost:3000/healthBuild TypeScript projects:
npm run buildNestJS projects also support the familiar alias:
npm run start:devExample CLI Flow
$ npx init-backend-project
_ _ _ _ _ _ _ _
(_)_ __ (_) |_ | |__ __ _ ___| | _____ _ __ __| | _ __ _ __ ___ (_) ___ ___| |_
| | '_ \| | __| | '_ \ / _` |/ __| |/ / _ \ '_ \ / _` | | '_ \| '__/ _ \| |/ _ \/ __| __|
| | | | | | |_ | |_) | (_| | (__| < __/ | | | (_| | | |_) | | | (_) | | __/ (__| |_
|_|_| |_|_|\__| |_.__/ \__,_|\___|_|\_\___|_| |_|\__,_| | .__/|_| \___// |\___|\___|\__|
|_| |__/
? Project name: my-api
? Backend framework:
1. Node.js
> 2. Express
3. Fastify
4. NestJS
? Language:
> 1. JavaScript
2. TypeScript
? Package manager:
> 1. npm
2. yarn
3. pnpm
? Database:
> 1. None
2. PostgreSQL
3. MySQL
4. MongoDB
5. Redis
? ORM:
> 1. None
? Authentication:
> 1. None
2. JWT Auth
3. Session Auth
? API documentation:
> 1. None
2. Swagger / OpenAPI
? Validation:
> 1. None
2. Zod
3. Joi
? Docker support?
Yes
> No
? Code quality tools:
> ESLint + Prettier
None
? Testing framework:
> 1. None
2. Jest
3. Vitest
? Git repository?
Yes
> No
? Install dependencies?
> Yes
No
✔ Dependencies installed.
✔ Project created successfully: my-api
Next steps
----------
cd my-api
Run locally
-----------
npm run dev
Endpoints
---------
Local API: http://localhost:3000
Health check: http://localhost:3000/health
───────────────────────────────────────────────
init-backend-project — created by Choch KimhourLicense
MIT License.
Copyright (c) 2026 Choch Kimhour.
