@adarshguptadev/exbackend
v1.0.5
Published
CLI tool to quickly generate a production-ready Express.js backend structure with MVC architecture
Downloads
224
Maintainers
Readme
Create Express Backend CLI
CLI tool to quickly create a clean and scalable Express.js backend structure.
Usage
Run the CLI using npx (no installation required):
npx @adarshguptadev/exbackend myApp📂 What it creates
myApp/
│
├── src/
│ ├── config/
│ │ └── DBconnect.js
│ ├── controllers/
│ ├── middlewares/
│ │ └── globalError.js
│ ├── models/
│ ├── routes/
│ │ └── home.router.js
│ ├── services/
│ ├── utils/
│ ├── app.js
│ └── server.js
│
├── .env
├── .gitignore
├── package.json
└── README.mdPackages Used
Express
- Server setup and routing
Mongoose
- MongoDB object modeling tool
CORS
- Allows frontend-backend communication from different origins
Dotenv
- Environment variable management
Features
- Clean and scalable folder structure
- Express server setup
- MongoDB connection ready
- Global error handling middleware
- Environment configuration support
- Development & production scripts
After project creation
cd myApp
npm run devEnvironment Variables
Update your .env file:
PORT=__
MONGO_URI=__
FRONTEND_URL=__
NODE_ENV=__Requirements
- Node.js >= 14
- MongoDB (local or cloud)
Why use this?
Setting up backend structure manually is repetitive and error-prone. This CLI automates the setup so you can focus on building features instead of boilerplate.
Author
Adarsh Gupta
GitHub: github.com/adarshguptadev/exbackend
exbackend: exbackend.adarshguptadev.in
npm: npmjs.com/package/@adarshguptadev/exbackend
License
MIT
