A zero-config CLI tool to scaffold production-ready MERN stack backend applications with best practices.
- ⚡ Instant setup – Spin up a MERN backend project in seconds
- 📁 Modular architecture – Clean and scalable folder structure
- 🔐 Secure by default – Configured with CORS, dotenv, and Helmet
- 🔌 MongoDB ready – Pre-wired database connection
- 📦 Lightweight – Only essential dependencies included
npx create-mern-backend@latestnpm install -g create-mern-backend
create-mern-backendmy-mern-backend/
├── config/
│ └── db.js # MongoDB connection config
├── controllers/ # Route controllers
├── models/ # Mongoose models
├── routes/ # API route definitions
├── middlewares/ # Custom middleware
├── utils/ # Utility functions
├── .env # Environment variables
├── .gitignore # Git ignore rules
└── server.js # Express server entry point
const express = require("express");
require("dotenv").config();
const app = express();
// Middleware
app.use(express.json());
app.use(cors());
// Database connection
require("./config/db")();
// Basic route
app.get("/", (req, res) => res.send("MERN Backend Running"));
const PORT = process.env.PORT || 5000;
app.listen(PORT, () => console.log(`Server running on port ${PORT}`));# Server Configuration
PORT=5000
# MongoDB
MONGO_URI=your_mongodb_connection_string
# Authentication
JWT_SECRET=your_random_secret_key
JWT_EXPIRE=30dAfter scaffolding:
cd your-project-name
npm install
npm start- Saves hours of manual setup
- Implements industry best practices
- Easily extensible architecture
- Perfect for:
- Prototyping
- Hackathons
- Production applications
- Learning MERN stack
Pull requests are welcome! Please open an issue first to discuss changes.
MIT © Vikash Bharal