A powerful CLI tool to instantly set up a Node.js + Express + MongoDB backend boilerplate with a clean folder structure and essential starter files.
- 📦 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
nodemon
andprettier
as dev tools - 🛠️ Configures scripts and ES module support automatically
npx backend-project-setup
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"
.
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
A .env
file is generated automatically:
MONGO_URI=mongodb://localhost:27017/mydatabase
PORT=4444
Update these as needed.
npm run dev
Server will start on the port specified in .env
(default: 4444
).