create-express-mvc-generator
v1.0.1
Published
A CLI tool to generate Express.js MVC projects
Downloads
18
Maintainers
Readme
create-express-mvc-generator
A modern CLI tool to generate Express.js MVC projects with a clean architecture.
Features
- 🚀 Quickly scaffold an Express.js project with MVC architecture
- 🧩 Choose between CommonJS or ESM syntax
- 📁 Organized folder structure (controllers, models, routes, etc.)
- 🛠️ Sample routes and controllers included
- ⚙️ Configurable port and project settings
- 🎨 Beautiful CLI with interactive prompts
- ✅ Health check endpoint included
- 🔄 Git initialization (optional)
Usage
npx create-express-mvc-generator my-express-appThis will create a new Express.js MVC project in the my-express-app directory.
Interactive Options
The CLI will prompt you for:
- Project name (if not provided as an argument)
- Syntax style (CommonJS or ESM)
- Port number
- Whether to install dependencies
- Whether to initialize a git repository
Command Line Options
npx create-express-mvc-generator [project-name] [options]Options:
--no-install- Skip installing dependencies--no-git- Skip git initialization
Project Structure
my-express-app/
├── controllers/ # Route controllers
├── models/ # Data models
├── routes/ # API routes
├── config/ # Configuration files
├── middlewares/ # Custom middleware functions
├── utils/ # Utility functions
├── .env # Environment variables
├── server.js # Entry point
└── package.json # Project dependenciesIncluded Endpoints
GET /health- Health check endpointGET /api/users- Get all usersGET /api/users/:id- Get user by IDPOST /api/users- Create a new userPUT /api/users/:id- Update a userDELETE /api/users/:id- Delete a user
Development
Install Dependencies
npm installRun Locally
npm start -- my-app
# or
node src/index.js my-appRunning Tests
npm testLicense
MIT
Author
Piyush Kumar
Built with ❤️ using Node.js and OOP principles.
