create-setup-backend
v1.0.4
Published
⚡ Scaffold a complete Node.js MVC backend structure with a single command!
Maintainers
Readme
create-setup-backend
⚡ Scaffold a complete Node.js MVC backend structure with a single command!
🚀 Quick Start
No installation needed — just run:
npx create-setup-backend my-projectOr install globally and use anywhere:
npm install -g create-setup-backend
create-setup-backend my-project📁 Generated Folder Structure
my-project/
├── src/
│ ├── config/ → DB and app configuration
│ ├── controllers/ → Business logic (MVC Controllers)
│ ├── models/ → Mongoose schemas / DB models
│ ├── routes/ → Express route definitions
│ ├── middlewares/ → Auth, error handling middlewares
│ ├── utils/ → Helper / utility functions
│ └── app.js → Express app setup
├── server.js → Server entry point
├── .env → Environment variables
├── .env.example → Environment variable template
├── .gitignore → Git ignore rules
└── package.json → Project dependencies⚙️ After Scaffolding
cd my-project
npm install
cp .env.example .env
npm run devYour server will be running at http://localhost:5000 🎉
📦 What's Included
| File / Folder | Purpose |
|---|---|
| server.js | Entry point — starts the Express server |
| src/app.js | Express app setup — middleware, routes |
| src/config/ | Database connection and app config |
| src/controllers/ | Handle request logic (MVC pattern) |
| src/models/ | Mongoose data schemas |
| src/routes/ | Route definitions for API endpoints |
| src/middlewares/ | Auth middleware, error handler |
| src/utils/ | Reusable helper functions |
| .env | Environment config (PORT, DB URI, JWT) |
| .gitignore | Ignores node_modules, .env, logs |
🛠️ Tech Stack (Pre-configured)
- Express.js — Fast, minimal web framework
- Mongoose — MongoDB object modeling
- dotenv — Environment variable management
- cors — Cross-Origin Resource Sharing
- express-validator — Request validation
- nodemon (dev) — Auto-restart on file changes
📝 Available Scripts
Inside the generated project:
| Command | Description |
|---|---|
| npm start | Start the server in production |
| npm run dev | Start with nodemon (auto-reload) |
🔧 Environment Variables
PORT=5000
MONGO_URI=mongodb://localhost:27017/your-db-name
JWT_SECRET=your_secret_key_here
NODE_ENV=development📄 License
MIT © create-setup-backend
