ultimate-node-generator
v1.1.0
Published
A CLI tool to generate production-ready Node.js project boilerplates with interactive configuration
Maintainers
Readme
Ultimate Node Generator 🚀
A powerful CLI tool to generate production-ready Node.js project boilerplates with interactive configuration.
Features
- ✨ Interactive CLI - Easy-to-use prompts for project configuration
- 🗄️ Multiple Databases - MongoDB, PostgreSQL, MySQL support
- 🔧 ORM/ODM Options - Mongoose, Prisma, Sequelize, TypeORM
- 🔐 Authentication - JWT and Passport.js (Local, Google)
- 📦 Additional Features - Email, file upload, logging, rate limiting, validation
- 🎯 TypeScript Support - Optional TypeScript configuration
- 📁 Best Practices - Well-organized folder structure
- ⚡ Quick Setup - Get started in seconds
Installation
You can use this package directly with npx (no installation required):
npx ultimate-node-generator my-projectOr install globally:
npm install -g ultimate-node-generator
ultimate-node-generator my-projectUsage
- Run the command:
npx ultimate-node-generator my-awesome-projectAnswer the interactive prompts:
- Project name
- Database selection (MongoDB, PostgreSQL, MySQL, None)
- ORM/ODM choice (based on database)
- Authentication method (JWT, Passport.js, None)
- TypeScript preference
- Additional features (email, file upload, logging, etc.)
- Git initialization
Navigate to your project and start coding:
cd my-awesome-project
npm run devWhat Gets Generated?
Project Structure
my-project/
├── src/
│ ├── config/ # Database and other configurations
│ ├── controllers/ # Route controllers
│ ├── middleware/ # Custom middleware (auth, error handling)
│ ├── models/ # Database models
│ ├── routes/ # API routes
│ ├── services/ # Business logic
│ ├── utils/ # Utility functions
│ └── server.js # Application entry point
├── .env.example # Environment variables template
├── .gitignore
├── package.json
└── README.mdFeatures Based on Configuration
MongoDB + Mongoose + JWT
- Mongoose connection setup
- User model with authentication fields
- JWT-based authentication (register, login, profile)
- Auth middleware for protected routes
PostgreSQL + Prisma
- Prisma schema configuration
- Database connection setup
- Prisma Client integration
Additional Features
- Email Service: Nodemailer configuration
- File Upload: Multer middleware
- Logging: Winston logger setup
- Rate Limiting: Express rate limit middleware
- Validation: Joi validation utilities
- CORS: Cross-origin resource sharing enabled
Example
$ npx ultimate-node-generator my-api
🚀 Welcome to Ultimate Node Generator!
? Project name: my-api
? Select database: MongoDB
? Select ORM/ODM: Mongoose
? Select authentication method: JWT
? Use TypeScript? No
? Select additional features: Logging, Rate Limiting, CORS
? Initialize Git repository? Yes
📁 Creating project at /path/to/my-api...
✓ Project structure created
✓ Files generated
✓ package.json created
✓ Dependencies installed
✓ Git repository initialized
✨ Success! Your project is ready.
To get started:
cd my-api
npm run dev
📝 Don't forget to:
1. Copy .env.example to .env
2. Update your database connection string in .env
3. Read the README.md for more informationEnvironment Variables
After project generation, copy .env.example to .env and configure:
# Server
PORT=5000
NODE_ENV=development
# Database (example for MongoDB)
MONGODB_URI=mongodb://localhost:27017/my-api
# JWT (if selected)
JWT_SECRET=your-super-secret-jwt-key
JWT_EXPIRE=7d
# Email (if selected)
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
[email protected]
EMAIL_PASSWORD=your-passwordSupported Options
Databases
- MongoDB
- PostgreSQL
- MySQL
- None
ORMs/ODMs
- For MongoDB: Mongoose, Prisma
- For PostgreSQL/MySQL: Prisma, Sequelize, TypeORM
- None
Authentication
- JWT (JSON Web Tokens)
- Passport.js (Local Strategy)
- Passport.js (Google OAuth)
- None
Additional Features
- Email Service (Nodemailer)
- File Upload (Multer)
- Logging (Winston)
- Rate Limiting
- CORS
- Validation (Joi)
Requirements
- Node.js 14.0.0 or higher
- npm or yarn
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT
Author
Created with ❤️ for the Node.js community
Happy Coding! 🎉
