JSPM

@ashutoshdash/create-frontend-app

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 222
  • Score
    100M100P100Q7502F
  • License MIT

A secure and modular CLI tool to create frontend projects with modern best practices

Package Exports

  • @ashutoshdash/create-frontend-app
  • @ashutoshdash/create-frontend-app/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ashutoshdash/create-frontend-app) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Create Frontend App

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.

โœจ Features

  • ๐Ÿ”’ 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

๐Ÿš€ Quick Start

Installation

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

Cross-Platform Usage

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

Basic Usage

# 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

๐Ÿ“‹ Interactive Setup

When you run the tool, you'll be guided through a series of prompts to configure your project:

1. Project Name

  • Enter a valid project name (letters, numbers, hyphens, underscores only)
  • The tool will create a directory with this name

2. Tech Stack Selection

  • React: Traditional SPA with Create React App setup
  • Next.js: Full-stack React framework with SSR/SSG capabilities

3. UI Library Choice

  • Mantine: Feature-rich React components library with built-in theming
  • Tailwind CSS + Shadcn/UI: Utility-first CSS with beautiful pre-built components

4. State Management (Optional)

  • Zustand: Lightweight, modern state management
  • None: Use React's built-in state management

5. Package Manager

  • npm: Default Node.js package manager
  • yarn: Fast, reliable, and secure package manager
  • pnpm: Efficient, disk space saving package manager

6. Data Fetching (Optional)

  • React Query: Powerful data synchronization for React
  • Apollo Client: Comprehensive GraphQL client
  • None: Use native fetch or other libraries

๐Ÿ’ก Usage Examples

Example 1: React + Tailwind + TypeScript

create-frontend-app my-react-app
# Choose: React โ†’ Tailwind CSS โ†’ None โ†’ npm โ†’ None

Example 2: Next.js + Mantine + Full Stack

create-frontend-app my-nextjs-app
# Choose: Next.js โ†’ Mantine โ†’ Zustand โ†’ yarn โ†’ React Query

Example 3: Minimal Setup

create-frontend-app simple-app
# Choose: React โ†’ Tailwind CSS โ†’ None โ†’ npm โ†’ None

๐Ÿ“ Generated Project Structure

The tool creates a well-organized project structure tailored to your choices:

React Project Structure

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

Next.js Project Structure

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

๐Ÿ“ฆ Included Dependencies

Core Dependencies

  • TypeScript: Type-safe JavaScript development
  • ESLint: Code linting and quality assurance
  • Prettier: Code formatting
  • Husky: Git hooks for quality gates
  • Zod: Runtime type validation

Framework Dependencies

  • React: UI library
  • React DOM: DOM rendering
  • Next.js: (if selected) Full-stack React framework

UI Dependencies

  • Mantine: (if selected) Complete React components library
  • Tailwind CSS: (if selected) Utility-first CSS framework
  • PostCSS: (if using Tailwind) CSS processing

Optional Dependencies

  • Zustand: (if selected) State management
  • React Query: (if selected) Data fetching and caching
  • Apollo Client: (if selected) GraphQL client

๐Ÿ”’ Security Features

  • โœ… 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

๐Ÿ› ๏ธ Development

Prerequisites

  • Node.js: Version 14.0.0 or higher
  • Package Manager: npm, yarn, or pnpm
  • Git: For version control (recommended)

Local Development Setup

# 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

Available Scripts

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

๐Ÿ—๏ธ Architecture

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

๐Ÿš€ Getting Started After Generation

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

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository and clone it locally
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes and add tests for new functionality
  4. Run the test suite: npm test
  5. Ensure code quality: npm run lint && npm run format
  6. Commit your changes: git commit -m 'Add amazing feature'
  7. Push to your branch: git push origin feature/amazing-feature
  8. Open a Pull Request

Development Guidelines

  • 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

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ“ Changelog

v1.0.0 (Current)

  • ๐ŸŽ‰ 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

๐Ÿ”ง Troubleshooting

Common Issues

"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

Platform-Specific Notes

  • 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).

๐Ÿ“š Documentation

๐Ÿ†˜ Support

๐Ÿ™ Acknowledgments

  • Built with โค๏ธ for the developer community
  • Inspired by modern frontend development best practices
  • Thanks to all contributors and users for feedback and suggestions