KEMBAR78
GitHub - vipinyadav01/js-stack: A powerful command-line interface tool designed to streamline your JavaScript development workflow with modern best practices.
Skip to content

A powerful command-line interface tool designed to streamline your JavaScript development workflow with modern best practices.

Notifications You must be signed in to change notification settings

vipinyadav01/js-stack

Repository files navigation

Create JS Stack CLI

npm version npm downloads GitHub release License

A powerful, modern CLI tool for scaffolding production-ready JavaScript full-stack projects with extensive customization options and best practices built-in.

πŸ“Š Feature Status

  • βœ… Available - Feature is fully implemented and ready to use
  • 🚧 Coming Soon - Feature is planned and in development
  • πŸ†• New - Recently added features

✨ Features

πŸš€ Lightning Fast Setup

  • Get a complete full-stack project running in minutes
  • Interactive prompts with smart defaults
  • Skip prompts with command-line flags
  • Programmatic API for automation

🎨 Frontend Frameworks

  • βœ… React - With Vite, TypeScript, and modern tooling
  • βœ… Vue.js - Vue 3 with Composition API and Vite
  • βœ… Angular - Latest Angular with CLI integration
  • βœ… Svelte - SvelteKit with optimized builds
  • βœ… Next.js - Full-stack React framework
  • βœ… Nuxt - Vue.js full-stack framework
  • βœ… React Native - Mobile app development

βš™οΈ Backend Frameworks

  • βœ… Express.js - Fast, minimalist web framework
  • βœ… Fastify - High-performance, low-overhead framework
  • βœ… Koa.js - Lightweight, expressive middleware framework
  • βœ… Hapi.js - Rich ecosystem with built-in validation
  • βœ… NestJS - Scalable Node.js framework with TypeScript

πŸ—„οΈ Database & Storage

  • βœ… SQLite - Lightweight, serverless database
  • βœ… PostgreSQL - Advanced open-source database
  • βœ… MySQL - Popular relational database
  • βœ… MongoDB - NoSQL document database
  • 🚧 Supabase - Open source Firebase alternative (Coming Soon)
  • 🚧 PlanetScale - Serverless MySQL platform (Coming Soon)

πŸ”§ ORM/ODM Integration

  • βœ… Prisma - Next-generation ORM with type safety
  • βœ… Sequelize - Feature-rich ORM for SQL databases
  • βœ… Mongoose - Elegant MongoDB object modeling
  • βœ… TypeORM - Advanced ORM with decorator support

πŸ” Authentication & Security

  • βœ… JWT - JSON Web Token implementation
  • βœ… Passport - Flexible authentication middleware
  • βœ… Auth0 - Identity platform integration
  • 🚧 Firebase Auth - Google's authentication service (Coming Soon)
  • 🚧 Clerk - Modern authentication platform (Coming Soon)
  • 🚧 Lucia - Lightweight authentication library (Coming Soon)
  • 🚧 Supabase Auth - Open source auth solution (Coming Soon)
  • βœ… Security middleware - Helmet, CORS, Rate limiting

πŸ› οΈ Development & DevOps

  • βœ… TypeScript - Full TypeScript support across all templates
  • βœ… Docker - Complete containerization with Docker Compose
  • βœ… Testing - Jest, Vitest configurations
  • 🚧 Cypress - E2E testing framework (Coming Soon)
  • βœ… Linting - ESLint with framework-specific rules
  • βœ… Formatting - Prettier with consistent configurations
  • βœ… Git Hooks - Husky for pre-commit validation
  • βœ… CI/CD - GitHub Actions workflows

πŸ“¦ Package Managers

  • βœ… npm - Node.js default package manager
  • βœ… yarn - Fast, reliable dependency management
  • βœ… pnpm - Efficient disk space usage
  • βœ… bun - All-in-one JavaScript runtime

🎯 Additional Features

  • βœ… Redis - Caching and session storage
  • βœ… Socket.IO - Real-time communication
  • βœ… Tailwind CSS - Utility-first CSS framework
  • 🚧 Material UI - React component library (Coming Soon)
  • 🚧 Bootstrap - Popular CSS framework (Coming Soon)
  • βœ… Environment Management - Complete .env configuration
  • 🚧 API Documentation - Auto-generated Swagger/OpenAPI docs (Coming Soon)
  • βœ… Hot Reload - Development with instant updates
  • πŸ†• Turborepo - Monorepo support with workspace management

πŸš€ Quick Start

Create a New Project

# Interactive setup (recommended)
npx create-js-stack init my-awesome-app

# With specific options
npx create-js-stack init my-app \
  --backend nestjs \
  --frontend react \
  --database postgres \
  --orm prisma \
  --auth jwt \
  --addons docker eslint prettier testing \
  --pm pnpm

# Use defaults for rapid prototyping
npx create-js-stack init my-app --yes

Global Installation

npm install -g create-js-stack
create-js-stack init my-app

πŸ’‘ Usage Examples

Full-Stack React + Express App

npx create-js-stack init my-app \
  --backend express \
  --frontend react \
  --database postgres \
  --orm prisma \
  --auth jwt \
  --addons docker tailwind testing

Vue + NestJS Enterprise Setup

npx create-js-stack init enterprise-app \
  --backend nestjs \
  --frontend vue \
  --database postgres \
  --orm typeorm \
  --auth passport \
  --addons docker eslint prettier testing github-actions

Next.js Full-Stack Application

npx create-js-stack init nextjs-app \
  --frontend nextjs \
  --database mongodb \
  --orm mongoose \
  --auth auth0 \
  --addons tailwind testing

Mobile + Backend Setup

npx create-js-stack init mobile-app \
  --backend fastify \
  --frontend react-native \
  --database mongodb \
  --orm mongoose \
  --auth firebase \
  --addons docker testing

Monorepo Setup with Turborepo

npx create-js-stack init monorepo-app \
  --backend express \
  --frontend react vue \
  --database postgres \
  --orm prisma \
  --auth jwt \
  --addons turborepo typescript eslint prettier

πŸ“‹ Commands

init [project-name]

Create a new full-stack project with all configurations.

Options:

  • -y, --yes - Use default configuration (Express + React + SQLite + Prisma)
  • --backend <type> - Backend framework
    • express - Express.js (default)
    • fastify - Fastify
    • koa - Koa.js
    • hapi - Hapi.js
    • nestjs - NestJS
    • none - No backend
  • --frontend <types...> - Frontend framework(s)
    • react - React with Vite (default)
    • vue - Vue.js 3
    • angular - Angular
    • svelte - SvelteKit
    • nextjs - Next.js
    • nuxt - Nuxt.js
    • react-native - React Native
    • none - No frontend
  • --database <type> - Database type
    • sqlite - SQLite (default)
    • postgres - PostgreSQL
    • mysql - MySQL
    • mongodb - MongoDB
    • none - No database
  • --orm <type> - ORM/ODM
    • prisma - Prisma (default)
    • sequelize - Sequelize
    • mongoose - Mongoose
    • typeorm - TypeORM
    • none - No ORM
  • --auth <type> - Authentication
    • jwt - JSON Web Tokens βœ…
    • passport - Passport.js βœ…
    • auth0 - Auth0 integration βœ…
    • firebase - Firebase Auth 🚧 (Coming Soon)
    • clerk - Clerk Auth 🚧 (Coming Soon)
    • lucia - Lucia Auth 🚧 (Coming Soon)
    • none - No authentication (default)
  • --addons <addons...> - Additional tools
    • typescript - TypeScript support βœ…
    • eslint - ESLint linting βœ…
    • prettier - Code formatting βœ…
    • husky - Git hooks βœ…
    • docker - Docker containerization βœ…
    • github-actions - CI/CD workflows βœ…
    • testing - Testing frameworks βœ…
    • tailwind - Tailwind CSS βœ…
    • turborepo - Monorepo with Turborepo πŸ†•
    • material - Material UI (React/Angular) 🚧 (Coming Soon)
    • bootstrap - Bootstrap CSS 🚧 (Coming Soon)
    • redis - Redis caching βœ…
    • socketio - Socket.IO real-time βœ…
    • cypress - E2E testing 🚧 (Coming Soon)
    • swagger - API documentation 🚧 (Coming Soon)
  • --pm <manager> - Package manager
    • npm - npm (default)
    • yarn - Yarn
    • pnpm - pnpm
    • bun - Bun
  • --no-git - Skip git initialization
  • --no-install - Skip dependency installation

add

Add features to an existing project.

Options:

  • --addons <addons...> - Additional tools to add
  • --auth <type> - Add authentication system
  • --database <type> - Add database support
  • --install - Install dependencies after adding features

Examples:

# Add Docker and testing to existing project
create-js-stack add --addons docker testing

# Add authentication
create-js-stack add --auth jwt

# Add database with ORM
create-js-stack add --database postgres --orm prisma

# Add Turborepo monorepo structure
create-js-stack add --addons turborepo

list

List all available options and their descriptions.

Options:

  • --backends - List backend frameworks
  • --frontends - List frontend frameworks
  • --databases - List database options
  • --orms - List ORM/ODM options
  • --auth - List authentication options
  • --addons - List available addons

docs

Open comprehensive documentation in your default browser.

version

Display the current version of create-js-stack CLI.

πŸ”§ Programmatic API

Use create-js-stack programmatically in your Node.js applications:

import { init, add, list } from "create-js-stack";

// Create a new project
const result = await init("my-app", {
  backend: "nestjs",
  frontend: ["react"],
  database: "postgres",
  orm: "prisma",
  auth: "jwt",
  addons: ["typescript", "docker", "testing"],
  packageManager: "pnpm",
  git: true,
  install: true,
});

if (result.success) {
  console.log(`βœ… Project created at: ${result.projectDir}`);
  console.log(`πŸ“Š Generated files: ${result.filesGenerated}`);
  console.log(`⏱️  Setup time: ${result.setupTime}ms`);
} else {
  console.error(`❌ Error: ${result.error}`);
}

// Add features to existing project
const addResult = await add({
  addons: ["redis", "socketio"],
  auth: "passport",
  install: true,
});

// List available options
const options = await list();
console.log("Available backends:", options.backends);
console.log("Available frontends:", options.frontends);

API Reference

init(projectName, options)

Creates a new full-stack project.

Parameters:

  • projectName (string) - Name of the project directory
  • options (object) - Configuration options
    • backend (string) - Backend framework
    • frontend (string[]) - Frontend framework(s)
    • database (string) - Database type
    • orm (string) - ORM/ODM type
    • auth (string) - Authentication type
    • addons (string[]) - Additional tools
    • packageManager (string) - Package manager
    • git (boolean) - Initialize git repository
    • install (boolean) - Install dependencies

Returns: Promise<{ success: boolean, projectDir?: string, error?: string }>

add(options)

Adds features to an existing project.

Parameters:

  • options (object) - Features to add
    • addons (string[]) - Additional tools
    • auth (string) - Authentication system
    • database (string) - Database support
    • install (boolean) - Install dependencies

Returns: Promise<{ success: boolean, error?: string }>

list()

Returns all available options.

Returns: Promise<{ backends: string[], frontends: string[], databases: string[], orms: string[], auth: string[], addons: string[] }>

πŸ“ Project Structure

The generated project follows industry best practices with a well-organized structure:

Full-Stack Project Structure

my-awesome-app/
β”œβ”€β”€ πŸ“ backend/                 # Backend application
β”‚   β”œβ”€β”€ πŸ“ src/                 # Source code
β”‚   β”‚   β”œβ”€β”€ πŸ“„ server.js        # Main server file
β”‚   β”‚   β”œβ”€β”€ πŸ“ routes/          # API routes
β”‚   β”‚   β”œβ”€β”€ πŸ“ middleware/      # Custom middleware
β”‚   β”‚   β”œβ”€β”€ πŸ“ controllers/     # Route controllers
β”‚   β”‚   β”œβ”€β”€ πŸ“ services/        # Business logic
β”‚   β”‚   β”œβ”€β”€ πŸ“ models/          # Data models
β”‚   β”‚   └── πŸ“ utils/           # Utility functions
β”‚   β”œβ”€β”€ πŸ“ tests/               # Backend tests
β”‚   β”œβ”€β”€ πŸ“„ package.json         # Backend dependencies
β”‚   β”œβ”€β”€ 🐳 Dockerfile           # Docker configuration
β”‚   └── πŸ“„ .env.example         # Environment variables template
β”œβ”€β”€ πŸ“ frontend/                # Frontend application
β”‚   β”œβ”€β”€ πŸ“ src/                 # Source code
β”‚   β”‚   β”œβ”€β”€ πŸ“„ main.js          # Application entry point
β”‚   β”‚   β”œβ”€β”€ πŸ“ components/      # Reusable components
β”‚   β”‚   β”œβ”€β”€ πŸ“ pages/           # Page components
β”‚   β”‚   β”œβ”€β”€ πŸ“ hooks/           # Custom hooks (React)
β”‚   β”‚   β”œβ”€β”€ πŸ“ store/           # State management
β”‚   β”‚   β”œβ”€β”€ πŸ“ services/        # API services
β”‚   β”‚   β”œβ”€β”€ πŸ“ utils/           # Utility functions
β”‚   β”‚   └── πŸ“ assets/          # Static assets
β”‚   β”œβ”€β”€ πŸ“ public/              # Public static files
β”‚   β”œβ”€β”€ πŸ“ tests/               # Frontend tests
β”‚   β”œβ”€β”€ πŸ“„ package.json         # Frontend dependencies
β”‚   β”œβ”€β”€ 🐳 Dockerfile           # Docker configuration
β”‚   └── βš™οΈ vite.config.js       # Build configuration
β”œβ”€β”€ πŸ“ database/                # Database related files
β”‚   β”œβ”€β”€ πŸ“ migrations/          # Database migrations
β”‚   β”œβ”€β”€ πŸ“ seeds/               # Database seeds
β”‚   β”œβ”€β”€ πŸ“„ schema.prisma        # Prisma schema (if using Prisma)
β”‚   └── πŸ“„ config.js            # Database configuration
β”œβ”€β”€ πŸ“ shared/                  # Shared utilities and types
β”‚   β”œβ”€β”€ πŸ“ types/               # TypeScript type definitions
β”‚   β”œβ”€β”€ πŸ“ constants/           # Shared constants
β”‚   └── πŸ“ utils/               # Shared utility functions
β”œβ”€β”€ πŸ“ docker/                  # Docker configurations
β”‚   β”œβ”€β”€ 🐳 docker-compose.yml   # Development setup
β”‚   β”œβ”€β”€ 🐳 docker-compose.prod.yml # Production setup
β”‚   └── πŸ“ nginx/               # Nginx configuration (if applicable)
β”œβ”€β”€ πŸ“ .github/                 # GitHub configurations
β”‚   └── πŸ“ workflows/           # CI/CD workflows
β”œβ”€β”€ πŸ“ docs/                    # Project documentation
β”œβ”€β”€ πŸ“„ package.json             # Root package.json (monorepo)
β”œβ”€β”€ πŸ“„ README.md                # Project documentation
β”œβ”€β”€ πŸ“„ .env.example             # Environment variables template
β”œβ”€β”€ πŸ“„ .gitignore               # Git ignore rules
β”œβ”€β”€ πŸ“„ .eslintrc.js             # ESLint configuration
β”œβ”€β”€ πŸ“„ .prettierrc              # Prettier configuration
β”œβ”€β”€ πŸ“„ turbo.json               # Turbo configuration (if monorepo)
└── πŸ“„ LICENSE                  # License file

Monorepo Structure (with Turborepo)

monorepo-app/
β”œβ”€β”€ πŸ“ apps/                    # Applications
β”‚   β”œβ”€β”€ πŸ“ web/                 # Web application
β”‚   β”‚   β”œβ”€β”€ πŸ“ src/             # Source code
β”‚   β”‚   β”œβ”€β”€ πŸ“„ package.json     # App dependencies
β”‚   β”‚   └── πŸ“„ next.config.js   # Next.js config
β”‚   └── πŸ“ server/              # Server application
β”‚       β”œβ”€β”€ πŸ“ src/             # Source code
β”‚       β”œβ”€β”€ πŸ“„ package.json     # App dependencies
β”‚       └── πŸ“„ server.js        # Main server file
β”œβ”€β”€ πŸ“ packages/                # Shared packages
β”‚   β”œβ”€β”€ πŸ“ ui/                  # UI components
β”‚   β”‚   β”œβ”€β”€ πŸ“ src/             # Component source
β”‚   β”‚   └── πŸ“„ package.json     # Package dependencies
β”‚   β”œβ”€β”€ πŸ“ database/            # Database package
β”‚   β”‚   β”œβ”€β”€ πŸ“ src/             # Database logic
β”‚   β”‚   └── πŸ“„ package.json     # Package dependencies
β”‚   └── πŸ“ shared/              # Shared utilities
β”‚       β”œβ”€β”€ πŸ“ src/             # Shared code
β”‚       └── πŸ“„ package.json     # Package dependencies
β”œβ”€β”€ πŸ“ configs/                 # Shared configurations
β”‚   β”œβ”€β”€ πŸ“ eslint/              # ESLint config
β”‚   β”œβ”€β”€ πŸ“ typescript/          # TypeScript config
β”‚   └── πŸ“ prettier/            # Prettier config
β”œβ”€β”€ πŸ“„ package.json             # Root package.json
β”œβ”€β”€ πŸ“„ turbo.json               # Turborepo configuration
└── πŸ“„ README.md                # Project documentation

Framework-Specific Structures

Next.js Project

nextjs-app/
β”œβ”€β”€ πŸ“ app/                     # App Router (Next.js 13+)
β”‚   β”œβ”€β”€ πŸ“„ layout.tsx           # Root layout
β”‚   β”œβ”€β”€ πŸ“„ page.tsx             # Home page
β”‚   β”œβ”€β”€ πŸ“ api/                 # API routes
β”‚   └── πŸ“ (auth)/              # Route groups
β”œβ”€β”€ πŸ“ components/              # React components
β”œβ”€β”€ πŸ“ lib/                     # Utilities and configurations
β”œβ”€β”€ πŸ“„ next.config.js           # Next.js configuration
└── πŸ“„ middleware.ts            # Next.js middleware

NestJS Project

nestjs-app/
β”œβ”€β”€ πŸ“ src/
β”‚   β”œβ”€β”€ πŸ“„ main.ts              # Application entry point
β”‚   β”œβ”€β”€ πŸ“„ app.module.ts        # Root module
β”‚   β”œβ”€β”€ πŸ“ auth/                # Authentication module
β”‚   β”œβ”€β”€ πŸ“ users/               # Users module
β”‚   β”œβ”€β”€ πŸ“ common/              # Shared code
β”‚   β”‚   β”œβ”€β”€ πŸ“ decorators/      # Custom decorators
β”‚   β”‚   β”œβ”€β”€ πŸ“ filters/         # Exception filters
β”‚   β”‚   β”œβ”€β”€ πŸ“ guards/          # Route guards
β”‚   β”‚   └── πŸ“ interceptors/    # Interceptors
β”‚   └── πŸ“ database/            # Database configuration
β”œβ”€β”€ πŸ“„ nest-cli.json            # Nest CLI configuration
└── πŸ“„ tsconfig.json            # TypeScript configuration

Generated Files Include:

βœ… Complete Configuration Files

  • Package.json with all necessary dependencies
  • TypeScript configuration (if selected)
  • ESLint and Prettier configurations
  • Environment variable templates
  • Docker and Docker Compose files
  • CI/CD workflow files

βœ… Production-Ready Code

  • Fully functional server with middleware
  • Authentication system (if selected)
  • Database models and connections
  • API routes with proper error handling
  • Frontend components with routing
  • Testing setup and example tests

βœ… Development Tools

  • Hot reload for development
  • Debugging configurations
  • Git hooks for code quality
  • Comprehensive README documentation

πŸ› οΈ Development & Contributing

Setting Up the Development Environment

# Clone the repository
git clone https://github.com/vipinyadav01/js-stack-cli.git
cd js-stack

# Install dependencies
npm install

# Build the CLI
npm run build

# Link for local development
npm link

# Test locally
create-js-stack init test-project

Project Scripts

# Development
npm run dev              # Watch mode with hot reload
npm run build            # Build the CLI
npm run build:watch      # Build in watch mode

# Testing
npm test                 # Run all tests
npm run test:watch       # Run tests in watch mode
npm run test:coverage    # Generate coverage report
npm run test:e2e         # Run end-to-end tests

# Code Quality
npm run lint             # Run ESLint
npm run lint:fix         # Fix ESLint issues
npm run format           # Format code with Prettier
npm run type-check       # TypeScript type checking

# Publishing
npm run prepublish       # Prepare for publishing
npm run publish          # Publish to npm

Template Development

Create new templates in the templates/ directory:

templates/
β”œβ”€β”€ backend/
β”‚   └── your-framework/
β”‚       β”œβ”€β”€ package.json.hbs
β”‚       β”œβ”€β”€ server.js.hbs
β”‚       └── routes/
β”œβ”€β”€ frontend/
β”‚   └── your-framework/
β”‚       β”œβ”€β”€ package.json.hbs
β”‚       └── src/
└── database/
    └── your-orm/
        └── models.js.hbs

Adding New Framework Support

  1. Add framework option in src/types.js
  2. Create templates in appropriate directory
  3. Update generator in src/generators/
  4. Add tests for the new framework
  5. Update documentation

Template Syntax

Templates use Handlebars with conditional logic:

{ "name": "{{projectName}}", "version": "1.0.0",
{{#if useTypeScript}}
  "scripts": { "build": "tsc" }, "devDependencies": { "typescript": "^5.0.0" }
{{/if}}
}

Testing Your Changes

# Test CLI generation
npm run test:cli

# Test specific templates
npm run test:templates -- --framework=react

# Test integration
npm run test:integration

# Manual testing
npm run build && npm link
create-js-stack init test-app --backend express --frontend react

Contributing Guidelines

  1. Fork and Clone

    git clone https://github.com/vipinyadav01/js-stack-cli.git
  2. Create Feature Branch

    git checkout -b feature/amazing-feature
  3. Make Changes

    • Follow existing code style
    • Add tests for new features
    • Update documentation
  4. Test Thoroughly

    npm test
    npm run test:e2e
  5. Commit with Conventional Commits

    git commit -m "feat: add support for new framework"
  6. Submit Pull Request

    • Clear description of changes
    • Link related issues
    • Include screenshots if applicable

Code Style Guidelines

  • ES6+ Features - Use modern JavaScript
  • TypeScript - Prefer TypeScript for new code
  • Functional Programming - Prefer pure functions
  • Error Handling - Comprehensive error handling
  • Documentation - JSDoc comments for functions
  • Testing - Unit tests for all new features

Reporting Issues

When reporting issues, please include:

  • Environment Details (OS, Node.js version, npm version)
  • Command Used (exact command that failed)
  • Expected Behavior vs Actual Behavior
  • Error Messages (full stack trace)
  • Reproduction Steps (minimal example)

Security

Report security vulnerabilities to: vipinxdev@gmail.com

Do not open public issues for security vulnerabilities.

πŸ“„ License

MIT License - see the LICENSE file for details.

πŸ‘₯ Authors & Acknowledgments

Main Author

  • Vipin Yadav - Initial work and ongoing development

Contributors

Acknowledgments

  • Create React App - Inspiration for CLI design patterns
  • Next.js - Modern full-stack framework inspiration
  • NestJS - Enterprise-grade architecture patterns
  • Vite - Lightning-fast build tool integration
  • Prisma - Next-generation ORM inspiration
  • T3 Stack - Full-stack TypeScript best practices
  • Better-T-Stack - Original inspiration for this project

Special thanks to the open-source community and all the maintainers of the frameworks and tools integrated into this CLI.

🌟 Show Your Support

If this project helped you, please consider:

  • ⭐ Starring the repository
  • πŸ› Reporting issues and bugs
  • πŸ’‘ Suggesting new features
  • 🀝 Contributing code improvements
  • πŸ“’ Sharing with the community

πŸ“Š Project Stats

  • Templates: 50+ production-ready templates
  • Frameworks: 12+ supported frameworks
  • Databases: 4 database types with 4 ORMs
  • Languages: JavaScript & TypeScript
  • Package Managers: 4 supported managers
  • Authentication: 4 auth strategies
  • Development Tools: 10+ integrated tools
  • Monorepo Support: Turborepo integration
  • Author: Vipin Yadav

πŸ”— Useful Links


Built with ❀️ by Vipin Yadav

Website β€’ Documentation β€’ Examples β€’ Community

About

A powerful command-line interface tool designed to streamline your JavaScript development workflow with modern best practices.

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published