1.0.1 • Published 6 months ago

@harsh2004/wizcli v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

WizCLI - Full-Stack Project Generator

Accelerate your development workflow with a single command

WizCLI is a powerful command-line tool that helps developers quickly scaffold full-stack JavaScript/TypeScript applications with various backend and frontend options. Generate production-ready project structures in seconds!

Features

  • ⚔ Instant Project Scaffolding - Create full-stack projects in seconds
  • šŸ”Œ Multiple Backend Options - Express, Fastify, or backend-free projects
  • šŸ–„ļø Modern Frontend Support - React or Vue with Vite
  • šŸ—„ļø Database Integration - MongoDB or PostgreSQL support
  • šŸ” Authentication Ready - JWT authentication out-of-the-box
  • šŸ“¦ Smart Dependency Management - Automatic installation of required packages
  • āš™ļø Production-Ready Configuration - Includes environment setup, TypeScript config, and more

Installation

Install WizCLI globally using npm:

npm install -g @harsh2004/wizcli

Usage

Create a New Project

wizcli init <project-name>

Command Options

OptionDescriptionDefault
--git-initInitialize Git repositoryfalse
--install-depsInstall dependencies automaticallyfalse
--language <lang>Set project language (js/ts)Prompt

Interactive Prompts

When you run wizcli init, you'll be guided through an interactive setup:

  1. Project Language: Choose JavaScript or TypeScript
  2. Backend Framework: Express, Fastify, or None
  3. Database: MongoDB, PostgreSQL, or None
  4. Middleware: Select security and utility middleware
  5. Frontend Framework: React, Vue, or None
  6. Authentication: JWT or None

Project Structures

Full-Stack Project (Express + React)

my-project/
ā”œā”€ā”€ client/          # Frontend (React)
│   ā”œā”€ā”€ src/
│   ā”œā”€ā”€ public/
│   ā”œā”€ā”€ index.html
│   ā”œā”€ā”€ vite.config.js
│   └── package.json
ā”œā”€ā”€ src/             # Backend (Express)
│   ā”œā”€ā”€ config/
│   ā”œā”€ā”€ routes/
│   ā”œā”€ā”€ models/
│   ā”œā”€ā”€ middlewares/
│   └── server.js
ā”œā”€ā”€ .env
ā”œā”€ā”€ .gitignore
└── package.json

Frontend-Only Project (Vue)

my-project/
ā”œā”€ā”€ public/
ā”œā”€ā”€ src/
ā”œā”€ā”€ index.html
ā”œā”€ā”€ vite.config.js
└── package.json

Backend-Only Project (Fastify + PostgreSQL)

my-project/
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ config/
│   ā”œā”€ā”€ routes/
│   ā”œā”€ā”€ models/
│   └── server.js
ā”œā”€ā”€ .env
ā”œā”€ā”€ .gitignore
└── package.json

Commands After Project Creation

For Backend Projects

npm start      # Start JavaScript backend
npm run dev    # Start TypeScript backend in dev mode
npm run build  # Build TypeScript project

For Frontend Projects

npm install    # Install dependencies
npm run dev    # Start development server
npm run build  # Build for production

Configuration

Environment Variables (.env)

PORT=3000
NODE_ENV=development

# MongoDB Configuration
MONGO_URI=mongodb://localhost:27017/yourdbname

# PostgreSQL Configuration
PG_HOST=localhost
PG_PORT=5432
PG_USER=youruser
PG_PASSWORD=yourpassword
PG_DATABASE=yourdb

TypeScript Config (tsconfig.json)

{
  "compilerOptions": {
    "target": "ES2020",
    "module": "ESNext",
    "outDir": "dist",
    "rootDir": "src",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true
  },
  "include": ["src"],
  "exclude": ["node_modules"]
}

Custom Templates

WizCLI uses EJS templates for project generation. You can customize these templates by modifying files in the templates directory:

templates/
ā”œā”€ā”€ auth/
│   └── jwt/
│       └── backend/
ā”œā”€ā”€ express/
│   └── server.js.ejs
ā”œā”€ā”€ fastify/
│   └── server.js.ejs
ā”œā”€ā”€ frontend/
│   ā”œā”€ā”€ react/
│   └── vue/
└── shared/
    ā”œā”€ā”€ db/
    └── models/

Contributing

We welcome contributions! Here's how to set up your development environment:

  1. Clone the repository

    git clone https://github.com/Harsh0369/NPM-Package
    cd wizcli
  2. Install dependencies

    npm install
  3. Link the package globally

    npm link
  4. Run the CLI locally

    wizcli init test-project
  5. Run tests

    npm test

Please follow our contribution guidelines when submitting pull requests.

Roadmap

  • Add support for Next.js
  • Implement SQLite database option
  • Add Docker configuration
  • Create project update mechanism
  • Develop VS Code extension companion

Support

For issues, feature requests, or questions, please:

  1. Check the troubleshooting guide
  2. Search existing issues
  3. Open a new issue

License

WizCLI is MIT licensed.


FAQ

Can I use WizCLI for existing projects?

WizCLI is designed for new project generation. For existing projects, you'll need to manually integrate the components you need.

How do I update dependencies in generated projects?

Currently, you need to update dependencies manually in your project. We're working on an update mechanism for future releases.

Can I create custom templates?

Yes! You can modify the templates in the templates directory to match your preferred project structure.

Is there support for CSS frameworks?

Not currently, but we're planning to add support for Tailwind CSS and Bootstrap in the next release.

How do I uninstall WizCLI?

npm uninstall -g wizcli

Happy Coding! šŸš€