npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

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

Readme

init-backend-project

npm version downloads source CI passing license

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-api

Open it and run the server:

cd my-api
npm install
npm run dev

If you choose automatic dependency installation during setup, you can skip npm install.

Open the health check:

http://localhost:3000/health

Example response:

{
  "success": true,
  "message": "API is running",
  "timestamp": "2026-04-29T00:00:00.000Z"
}

Usage

Run with npx:

npx init-backend-project my-api

Run the interactive prompt without a project name:

npx init-backend-project

Use npm exec:

npm exec init-backend-project my-api

Install globally if you generate projects often:

npm install -g init-backend-project
init-backend-project my-api

Note: 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, and README.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.md

TypeScript 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.md

Supported 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 dev
yarn dev
pnpm dev

When 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/health

Build TypeScript projects:

npm run build

NestJS projects also support the familiar alias:

npm run start:dev

Example 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 Kimhour

License

MIT License.

Copyright (c) 2026 Choch Kimhour.