UNPKG

@ssit-hub/mvp-generate-template

Version:

A beautiful CLI tool to quickly generate MVP project templates with modern frameworks and best practices

248 lines (189 loc) β€’ 7.59 kB
# πŸš€ MVP Template Generator [![npm version](https://badge.fury.io/js/@ssit-hub%2Fmvp-generate-template.svg)](https://badge.fury.io/js/@ssit-hub/mvp-generate-template) [![downloads](https://img.shields.io/npm/dm/@ssit-hub/mvp-generate-template.svg)](https://npmjs.org/package/@ssit-hub/mvp-generate-template) [![CI](https://github.com/duyvu871/mvp-generate-template/workflows/CI/badge.svg)](https://github.com/duyvu871/mvp-generate-template/actions) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) > A beautiful CLI tool to quickly generate MVP project templates with modern frameworks and best practices. Generate production-ready projects in seconds with interactive prompts, TypeScript support, and beautiful templates. ![CLI Demo](https://raw.githubusercontent.com/duyvu871/mvp-generate-template/main/assets/demo.gif) ## ✨ Features - 🎨 **Beautiful CLI Interface** - Interactive prompts with ASCII art - πŸ“‹ **Multiple Templates** - Express, APIs, CLI tools, and more - ⚑ **Express + Handlebars** - Full web server with real-time features - πŸ”§ **TypeScript Ready** - Optional TypeScript configuration - πŸ“¦ **ESBuild Integration** - Lightning-fast compilation - 🎭 **Modern UI Components** - Responsive designs out of the box - πŸ§ͺ **Testing Setup** - Vitest, ESLint, Prettier included - πŸš€ **Production Ready** - CI/CD pipelines and best practices ## πŸ“¦ Installation ```bash # Install globally (recommended) npm install -g @ssit-hub/mvp-generate-template # Or use with npx (no installation required) npx @ssit-hub/mvp-generate-template init my-project ``` ## πŸš€ Quick Start ```bash # Create a new project in a new directory mvp-gen init my-awesome-project # Or create in current directory mvp-gen init . # Follow the interactive prompts to: # 1. Choose your template # 2. Select TypeScript support # 3. Configure build tools ``` ## πŸ“‹ Available Templates ### 🌐 Express + Handlebars Perfect for full-stack web applications - Real-time server time display - Beautiful responsive UI with gradients - Handlebars templating engine - Auto-refresh functionality - Error pages (404/500) ### ⚑ Express API RESTful API server template - Security middleware (Helmet, CORS) - Request logging with Morgan - Health check endpoints - JSON response handling ### πŸ“¦ Node.js CLI Tool Command-line application template - Commander.js integration - Inquirer prompts - Chalk for colored output - Build scripts included ### πŸ—οΈ Basic Node.js Minimal Node.js project - Simple entry point - Package.json setup - NPM scripts configured ## 🎯 CLI Usage ### Basic Commands ```bash # Create project in new directory mvp-gen init <project-name> # Create project in current directory mvp-gen init . # or mvp-gen init ./ ``` ### With Options ```bash mvp-gen init my-project --template express-hbs --typescript --esbuild mvp-gen init . --template express-api --typescript ``` ### Available Options | Option | Alias | Description | Default | |--------|-------|-------------|---------| | `--template <name>` | `-t` | Template to use | Interactive selection | | `--typescript` | `-ts` | Add TypeScript support | Prompted | | `--esbuild` | `-es` | Add ESBuild config | Prompted | | `--help` | `-h` | Show help | - | | `--version` | `-V` | Show version | - | ### Template Names - `express-hbs` - Express + Handlebars - `express-api` - Express API server - `node-cli` - Node.js CLI tool - `basic-node` - Basic Node.js project ## 🎨 Interactive Experience The CLI provides a beautiful interactive experience: ``` β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β• β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β•šβ•β• β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β•šβ•β• β•šβ•β• β•šβ•β•β•β• β•šβ•β• β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β•β•β• πŸš€ Project Template Generator πŸš€ ? Select a project template: ❯ 🌐 Express + Handlebars (Node.js web server) ⚑ Express API (REST API server) πŸ“¦ Node.js CLI Tool πŸ—οΈ Basic Node.js Project ``` ## πŸ“– Examples ### Create an Express Web App ```bash mvp-gen init my-webapp # Select: Express + Handlebars # TypeScript: Yes # ESBuild: Yes ``` ### Create an API Server ```bash mvp-gen init my-api --template express-api --typescript ``` ### Create in Current Directory ```bash mkdir my-new-project && cd my-new-project mvp-gen init . --template express-hbs --typescript --esbuild ``` ### Create a CLI Tool ```bash npx @ssit-hub/mvp-generate-template init my-cli-tool --template node-cli ``` ## πŸ”§ Generated Project Structure ``` my-project/ β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ index.ts # Main entry point β”‚ β”œβ”€β”€ routes/ # Express routes (if applicable) β”‚ β”œβ”€β”€ views/ # Handlebars templates (if applicable) β”‚ └── public/ # Static assets (if applicable) β”œβ”€β”€ tests/ β”‚ └── index.test.ts # Test files β”œβ”€β”€ package.json # Dependencies and scripts β”œβ”€β”€ tsconfig.json # TypeScript config (if selected) β”œβ”€β”€ esbuild.config.mjs # ESBuild config (if selected) β”œβ”€β”€ .eslintrc.json # ESLint configuration β”œβ”€β”€ .prettierrc.json # Prettier configuration └── README.md # Project documentation ``` ## πŸš€ After Generation Once your project is generated: ```bash cd my-project npm install # Development npm run dev # Start development server npm run build # Build for production npm test # Run tests # Code Quality npm run lint # Lint code npm run format # Format code ``` ## πŸ› οΈ Requirements - **Node.js**: 16.0.0 or higher - **npm**: 7.0.0 or higher ## πŸ”„ Updates Keep your global installation up to date: ```bash npm update -g @ssit-hub/mvp-generate-template # Check current version mvp-gen --version ``` ## 🀝 Contributing Contributions are welcome! Please see our [Contributing Guide](CONTRIBUTING.md). 1. Fork the repository 2. Create your feature branch (`git checkout -b feature/amazing-feature`) 3. Make your changes 4. Run tests (`npm test`) 5. Commit your changes (`git commit -m 'Add amazing feature'`) 6. Push to the branch (`git push origin feature/amazing-feature`) 7. Open a Pull Request ## πŸ“„ License MIT Β© [BΓΉi An Du](https://github.com/duyvu871) ## πŸ”— Links - [npm package](https://www.npmjs.com/package/@ssit-hub/mvp-generate-template) - [GitHub repository](https://github.com/duyvu871/mvp-generate-template) - [Report issues](https://github.com/duyvu871/mvp-generate-template/issues) - [Changelog](CHANGELOG.md) ## ⭐ Support If this tool helps you build amazing projects, please consider: - ⭐ Starring the repository - πŸ› Reporting bugs and issues - πŸ’‘ Suggesting new features - πŸ“– Improving documentation --- **Happy coding!** πŸŽ‰ Build your MVP faster with beautiful, production-ready templates.