@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
Markdown
# π MVP Template Generator
[](https://badge.fury.io/js/@ssit-hub/mvp-generate-template)
[](https://npmjs.org/package/@ssit-hub/mvp-generate-template)
[](https://github.com/duyvu871/mvp-generate-template/actions)
[](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.

## β¨ 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.