Documentation

make-backend

An interactive CLI to scaffold production-ready backend projects in seconds.


Introduction

make-backend is a production-ready CLI that generates fully configured backend applications with your choice of framework, language, database, and utility packages. It handles dependency installation, Git initialization, and produces a clean project structure following industry best practices.

No more copy-pasting boilerplate. Run one command and start building features immediately.

Quick Start

Run directly without installing anything:

terminal
npx make-backend

Or install globally with your preferred package manager:

# npm
npm install -g make-backend

# pnpm
pnpm add -g make-backend

# yarn
yarn global add make-backend

# bun
bun add -g make-backend

Then run from anywhere:

make-backend

Usage

The CLI walks you through an interactive setup with these prompts:

1. Enter project name        →  my-api
2. Select framework           →  Express / Hono
3. Select language            →  JavaScript / TypeScript
4. Select database            →  MongoDB / PostgreSQL / None
5. Select additional packages →  bcrypt, jwt, zod, nodemailer
6. Select package manager     →  npm / pnpm / yarn / bun

After you confirm, the CLI will:

  • 1Scaffold the project directory from your selected template
  • 2Merge database configuration and models (if a database was selected)
  • 3Install all dependencies with your chosen package manager
  • 4Initialize a Git repository and generate .gitignore
  • 5Print the next steps to get your server running

Start your dev server:

cd my-api
npm run dev   # or: pnpm dev / yarn dev / bun dev
Your server starts at http://localhost:3000 by default with a working GET /api/health endpoint.

Project Structure

Every scaffolded project follows this opinionated folder structure:

my-api/
├── src/
│   ├── config/         # Database connection setup
│   ├── constants/      # HTTP status codes and shared constants
│   ├── controllers/    # Route handler logic
│   ├── middlewares/    # Error handlers, auth guards, etc.
│   ├── models/         # Database models (Mongoose / PG)
│   ├── routes/         # Route definitions
│   ├── utils/          # ApiResponse, ApiError, asyncHandler
│   ├── types/          # TypeScript declarations (TS only)
│   ├── app.ts          # Middleware stack, routes, error handling
│   └── index.ts        # Entry point — env vars, server listen
├── .env                # Environment variables (auto-generated)
├── .env.example        # Environment template
├── .gitignore
├── package.json
└── tsconfig.json       # TypeScript config (TS only)

Frameworks

Choose between two production-tested Node.js frameworks:

FrameworkDescriptionDocs
ExpressFast, minimalist web framework — the industry standard for Node.js APIs.expressjs.com
HonoUltrafast, lightweight framework built for any runtime including the edge.hono.dev

Languages

LanguageNotes
JavaScriptES Modules ("type": "module"), runs directly with Node.js. No build step.
TypeScriptDev via tsx, production builds via tsc. Typed env vars via Zod (if selected).

Databases

DatabaseDriverWhat's scaffolded
MongoDBMongoose ^8.0.0Connection manager, graceful shutdown, User model
PostgreSQLnode-postgres ^8.11.3Connection pool, lifecycle events, User table with typed CRUD
NoneSkips database setup entirely — clean slate

What's Included

Every generated project ships with these out of the box:

ApiResponse & ApiError

Standardized API response classes

Global Error Handling

Middleware with dev-only stack traces

Helmet + Compression

Security headers and response compression

Morgan Logger

HTTP request logging

Vitest + Supertest

Pre-configured test suite with health check

ESLint + Prettier

Modern flat config linting and formatting

dotenv

.env and .env.example auto-generated

GET /api/health

Health check endpoint ready to use

tsx / --watch

Fast dev server with hot reload

git init

Git initialized, .gitignore generated

Optional Packages

During setup, pick any combination of these packages. They are installed and pre-wired for you:

PackagePurpose
bcryptPassword hashing for user authentication flows
jsonwebtokenJWT creation and verification
zodSchema validation + automatic typed env var validation
nodemailerEmail sending with Gmail / SMTP support

Package Managers

make-backend supports all major Node.js package managers. Your preference is cached locally and pre-selected on future runs.

ManagerInstall commandDev command
npmnpm installnpm run dev
pnpmpnpm installpnpm dev
yarnyarn installyarn dev
bunbun installbun dev

Local Installation

If you want to run from source, clone and link:

terminal
git clone https://github.com/onimusha-dev/make-backend.git
cd make-backend
npm install
npm link

# Run from anywhere:
make-backend

Or run directly from GitHub without cloning:

npx github:onimusha-dev/make-backend

To unlink when done:

npm unlink -g make-backend

Contributing

Contributions are welcome. To get started:

# 1. Fork and clone
git clone https://github.com/YOUR_USERNAME/make-backend.git
cd make-backend

# 2. Install dependencies
npm install

# 3. Link locally for testing
npm link

# 4. Run the CLI
make-backend

When opening a pull request:

  • Follow the existing code style and directory conventions
  • Test your changes by scaffolding with each framework/language/database combo
  • Keep commits atomic and descriptive
Distributed under the ISC License.