backend-project-setup
v1.0.3
Published
CLI tool to generate a Node.js backend boilerplate quickly
Maintainers
Readme
🚀 Backend Project Setup
A powerful CLI tool to instantly set up a Node.js + Express + MongoDB backend boilerplate with a clean folder structure and essential starter files.
✨ Features
- 📦 Initializes a fully structured backend project in seconds
- ⚡ Uses Express and Mongoose (MongoDB)
- 🗂️ Generates a standard folder structure (controllers, routes, models, utils, etc.)
- ⚙️ Creates starter configuration files (
.env,.gitignore, Prettier config) - ✅ Adds a built-in health check endpoint
- 💻 Includes
nodemonandprettieras dev tools - 🛠️ Configures scripts and ES module support automatically
🛠️ Installation
Using npx (recommended)
npx backend-project-setup⚡ Usage
After running the CLI command:
1️⃣ A new src/ folder and its subfolders will be created.
2️⃣ Essential starter files (index.js, app.js, conf.js, connect.js, etc.) are auto-generated.
3️⃣ Dependencies (express, mongoose, dotenv, cors) and dev tools (nodemon, prettier) are installed automatically.
4️⃣ Your package.json will be updated with scripts and "type": "module".
🏗️ Folder Structure
src/
├── app.js
├── index.js
├── conf/
│ └── conf.js
├── controllers/
│ └── healthCheck.controller.js
├── db/
│ └── connect.js
├── middlewares/
├── models/
├── routes/
│ └── healthCheck.route.js
├── utils/
│ ├── ApiError.js
│ ├── ApiResponse.js
│ └── asyncHandler.js
.gitignore
.env
.prettierrc
.prettierignore🌱 Environment Variables
A .env file is generated automatically:
MONGO_URI=mongodb://localhost:27017/mydatabase
PORT=4444Update these as needed.
🚀 Running the Server
npm run devServer will start on the port specified in .env (default: 4444).
