A CLI tool to quickly scaffold Node.js Express applications with a clean, organized structure.
- 🚀 Quick project scaffolding
- 📁 Clean folder structure with MVC pattern
- 🛠️ Pre-configured Express setup
- 🔧 Built-in error handling
- 📦 Automatic dependency installation
- 🎯 ES6 modules support
You can use create-nodecic without installing it globally by using npm's create command:
npm create nodecic my-appOr install it globally:
npm install -g create-nodecic
create-nodecic my-appnpm create nodecic <project-name>Replace <project-name> with your desired project name.
npm create nodecic my-express-app
cd my-express-app
node index.jsmy-express-app/
├── index.js # Main application entry point
├── routes.js # Route definitions
├── controllers/
│ └── home.controller.js # Home page controller
├── handlers/
│ ├── error.handler.js # Global error handler
│ └── notfound.handler.js # 404 handler
├── package.json # Project dependencies and scripts
└── public/ # Static files (created automatically)
The generated project includes:
- Express.js web framework
- ES6 modules support (
"type": "module"in package.json) - MVC architecture with controllers and routes
- Error handling middleware
- 404 handler for unmatched routes
- Static file serving from
publicdirectory - JSON body parsing enabled
- Express app setup
- Middleware configuration
- Route registration
- Error handling setup
- Server startup on port 3000 (or PORT env variable)
- Router setup using Express Router
- Home route configuration
- Modular route organization
home.controller.js- Handles home page requests
error.handler.js- Global error handling middlewarenotfound.handler.js- 404 error handling
After creating your project:
-
Navigate to the project directory:
cd your-project-name -
Start the development server:
node index.js
-
Open your browser and visit
http://localhost:3000
The generated project provides a solid foundation that you can extend:
- Add more routes in
routes.js - Create additional controllers in the
controllers/directory - Add middleware for authentication, logging, etc.
- Configure a database connection
- Add environment variable configuration
- Set up testing frameworks
- Node.js 14 or higher
- npm 6 or higher
To contribute to create-nodecic:
- Clone the repository
- Install dependencies:
npm install - Make your changes
- Test locally:
node index.js test-project
Wajed Isleem
Happy coding! 🎉