A powerful, secure, and modular CLI tool that generates modern frontend projects with industry best practices. Skip the tedious setup and focus on building your application from day one.
- π Security First: Comprehensive input sanitization and command injection prevention
- ποΈ Modular Architecture: Clean, maintainable code structure with separation of concerns
- β‘ Modern Tech Stack: Full support for React, Next.js, TypeScript, and cutting-edge tools
- π¨ UI Libraries: Choose between Mantine or Tailwind CSS with Shadcn/UI components
- π¦ Package Managers: Flexible support for npm, yarn, and pnpm
- π§ Development Tools: Pre-configured ESLint, Prettier, and Husky pre-commit hooks
- π§ͺ Testing Ready: Built-in testing infrastructure with Jest
- π Production Ready: Optimized builds and deployment configurations
Global Installation (Recommended)
# Install globally
npm install -g @ashutoshdash/create-frontend-app
# Verify installation
create-frontend-app --version
One-time Usage (without global installation)
# Using npx (downloads and runs without installing)
npx @ashutoshdash/create-frontend-app my-awesome-app
# Using npm create (alternative)
npm create frontend-app my-awesome-app
Windows (PowerShell/CMD)
# After global installation
create-frontend-app my-project
# Or with npx
npx @ashutoshdash/create-frontend-app my-project
macOS/Linux (Terminal)
# After global installation
create-frontend-app my-project
# Or with npx
npx @ashutoshdash/create-frontend-app my-project
# Create a new project
create-frontend-app my-project
# Or specify a directory
create-frontend-app ./my-new-app
# Get help and see all options
create-frontend-app --help
# Quick Next.js + Mantine setup
create-frontend-app --next-mantine --name my-nextjs-app
# Specify package manager
create-frontend-app --next-mantine --name my-app --package-manager yarn
When you run the tool, you'll be guided through a series of prompts to configure your project:
- Enter a valid project name (letters, numbers, hyphens, underscores only)
- The tool will create a directory with this name
- React: Traditional SPA with Create React App setup
- Next.js: Full-stack React framework with SSR/SSG capabilities
- Mantine: Feature-rich React components library with built-in theming
- Tailwind CSS + Shadcn/UI: Utility-first CSS with beautiful pre-built components
- Zustand: Lightweight, modern state management
- None: Use React's built-in state management
- npm: Default Node.js package manager
- yarn: Fast, reliable, and secure package manager
- pnpm: Efficient, disk space saving package manager
- React Query: Powerful data synchronization for React
- Apollo Client: Comprehensive GraphQL client
- None: Use native fetch or other libraries
create-frontend-app my-react-app
# Choose: React β Tailwind CSS β None β npm β None
create-frontend-app my-nextjs-app
# Choose: Next.js β Mantine β Zustand β yarn β React Query
create-frontend-app simple-app
# Choose: React β Tailwind CSS β None β npm β None
The tool creates a well-organized project structure tailored to your choices:
my-project/
βββ public/
β βββ index.html
β βββ favicon.ico
βββ src/
β βββ components/ # Reusable UI components
β β βββ ui/ # Basic UI components
β β βββ layout/ # Layout components
β βββ hooks/ # Custom React hooks
β βββ utils/ # Utility functions
β βββ types/ # TypeScript type definitions
β βββ styles/ # Global styles and themes
β βββ App.tsx # Main application component
β βββ index.tsx # Application entry point
β βββ setupTests.ts # Test configuration
βββ .gitignore
βββ .eslintrc.json
βββ .prettierrc
βββ tsconfig.json
βββ tailwind.config.js # (if using Tailwind)
βββ package.json
βββ README.md
my-project/
βββ public/
β βββ favicon.ico
βββ src/
β βββ components/ # Reusable components
β βββ pages/ # Next.js pages (App Router)
β βββ hooks/ # Custom React hooks
β βββ utils/ # Utility functions
β βββ types/ # TypeScript definitions
β βββ styles/ # Global styles
β βββ lib/ # Library configurations
βββ .next/ # Next.js build output
βββ .gitignore
βββ .eslintrc.json
βββ .prettierrc
βββ next.config.js
βββ tsconfig.json
βββ tailwind.config.js # (if using Tailwind)
βββ package.json
βββ README.md
- TypeScript: Type-safe JavaScript development
- ESLint: Code linting and quality assurance
- Prettier: Code formatting
- Husky: Git hooks for quality gates
- Zod: Runtime type validation
- React: UI library
- React DOM: DOM rendering
- Next.js: (if selected) Full-stack React framework
- Mantine: (if selected) Complete React components library
- Tailwind CSS: (if selected) Utility-first CSS framework
- PostCSS: (if using Tailwind) CSS processing
- Zustand: (if selected) State management
- React Query: (if selected) Data fetching and caching
- Apollo Client: (if selected) GraphQL client
- β Input Validation: Comprehensive sanitization of all user inputs
- β Command Injection Prevention: Safe execution of system commands
- β Path Traversal Protection: Secure file system operations
- β Safe File Operations: Atomic file writes with rollback capability
- β Error Handling: Graceful error recovery and cleanup
- β Dependency Security: Regular security audits of dependencies
- Node.js: Version 14.0.0 or higher
- Package Manager: npm, yarn, or pnpm
- Git: For version control (recommended)
# Clone the repository
git clone https://github.com/your-username/create-frontend-app.git
cd create-frontend-app
# Install dependencies
npm install
# Run the tool locally
npm start
# Run tests
npm test
# Run linting
npm run lint
# Format code
npm run format
Script | Description |
---|---|
npm start |
Run the CLI tool interactively |
npm test |
Run the test suite |
npm run test:watch |
Run tests in watch mode |
npm run lint |
Check code with ESLint |
npm run lint:fix |
Fix ESLint issues automatically |
npm run format |
Format code with Prettier |
npm run format:check |
Check code formatting |
The tool follows a clean, modular architecture:
src/
βββ constants.js # Configuration constants and templates
βββ validators.js # Input validation and sanitization
βββ cleanup.js # Cleanup utilities and error recovery
βββ generators/ # Project generation modules
β βββ configGenerator.js # Configuration file generation
β βββ dependencyInstaller.js # Package installation
β βββ projectGenerator.js # Main project structure creation
β βββ projectStructure.js # File and directory templates
βββ prompts/ # Interactive CLI questions
β βββ questions.js # Question definitions and validation
βββ utils/ # Utility functions
βββ commandRunner.js # Safe command execution
βββ fileOperations.js # File system operations
Once your project is created, here's how to get started:
# Navigate to your new project
cd my-awesome-project
# Install dependencies
npm install
# Start development server
npm start
# Build for production
npm run build
# Run tests
npm test
We welcome contributions! Here's how you can help:
- Fork the repository and clone it locally
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes and add tests for new functionality
- Run the test suite:
npm test
- Ensure code quality:
npm run lint && npm run format
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to your branch:
git push origin feature/amazing-feature
- Open a Pull Request
- Follow the existing code style and patterns
- Add tests for new features and bug fixes
- Update documentation for any API changes
- Ensure all tests pass before submitting PRs
This project is licensed under the MIT License - see the LICENSE file for details.
- π Initial Release: First stable version of create-frontend-app
- π Security First: Comprehensive input validation and sanitization
- ποΈ Modular Architecture: Clean, maintainable code structure
- β‘ Modern Tech Stack: Full support for React, Next.js, TypeScript
- π¨ UI Libraries: Mantine and Tailwind CSS with Shadcn/UI
- π¦ Package Managers: npm, yarn, and pnpm support
- π§ Development Tools: ESLint, Prettier, Husky pre-commit hooks
- π§ͺ Testing Ready: Built-in testing infrastructure with Jest
- π Production Ready: Optimized builds and deployment configurations
"Command not found" on Windows
# Make sure npm global bin is in your PATH
npm config get prefix
# Add the output to your PATH environment variable
# Or use npx instead
npx @ashutoshdash/create-frontend-app my-project
Permission denied on macOS/Linux
# Fix npm permissions
sudo chown -R $(whoami) ~/.npm
# Or use npx
npx @ashutoshdash/create-frontend-app my-project
Node.js version issues
# Check your Node.js version
node --version
# Should be 14.0.0 or higher
# Update if needed: https://nodejs.org/
Package manager not found
# Make sure your chosen package manager is installed
npm --version
yarn --version # if using yarn
pnpm --version # if using pnpm
- Windows: Use PowerShell or Command Prompt. Git Bash may have path issues.
- macOS: May require
sudo
for global installation depending on Node.js setup. - Linux: Ensure you have build tools installed (
build-essential
on Ubuntu/Debian).
- NPM Publishing Guide: docs/NPM_PUBLISHING_GUIDE.md - Complete step-by-step publishing workflow
- Quick Publish Cheatsheet: docs/QUICK_PUBLISH_CHEATSHEET.md - Essential commands reference
- Changelog Guide: docs/CHANGELOG_GUIDE.md - Changelog management best practices
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Full Documentation
- Built with β€οΈ for the developer community
- Inspired by modern frontend development best practices
- Thanks to all contributors and users for feedback and suggestions