1.0.3 • Published 4 months ago

project-structure-creator v1.0.3

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

Project Structure Creator

A powerful CLI tool to generate well-structured React and Next.js applications with best practices and modern tooling.

Features

  • šŸš€ Generate React or Next.js projects with optimal folder structure
  • šŸ“¦ TypeScript/JavaScript support
  • šŸ›  ESLint and Prettier configuration
  • šŸ“± Includes Old and Latest versions of React/Next.js
  • āš”ļø Fast and interactive setup

Installation

You can use this package in several ways:

Using npx (Recommended)

npx project-structure-creator@latest

Global Installation

npm install -g project-structure-creator
  • Now run following command in terminal
create-project-structure

Local Installation

npm install project-structure-creator
  • Then add to your package.json scripts:
{
  "scripts": {
    "create": "create-project-structure"
  }
}
  • Run using npm
npm run create

Usage

Interactive Mode

Simply run:

npx project-structure-creator@latest

Follow the interactive prompts to:

  1. Choose framework (React/Next.js)
  2. Select TypeScript/JavaScript
  3. Configure ESLint
  4. Set up Prettier
  5. Choose framework version
  6. Name your project

Direct Mode

Specify the framework directly:

npx project-structure-creator@latest react
# or
npx project-structure-creator@latest next

Project Structure

The generated project includes:

src/
ā”œā”€ā”€ components/          # Reusable UI components
│   ā”œā”€ā”€ ui/              # Basic UI components (buttons, inputs)
│   ā”œā”€ā”€ layout/          # Layout components (header, footer)
│   ā”œā”€ā”€ shared/          # Shared/common components
│   └── providers/       # Context providers or other providers
│
ā”œā”€ā”€ hooks/               # Custom React hooks
ā”œā”€ā”€ context/             # React Context definitions
ā”œā”€ā”€ store/               # State management
│   └── slices/          # Redux/state slices
│
ā”œā”€ā”€ services/            # API and external services
ā”œā”€ā”€ layouts/             # Page layout templates
ā”œā”€ā”€ views/               # Page views
ā”œā”€ā”€ locales/             # Localization files
│
ā”œā”€ā”€ utils/               # Utility functions
ā”œā”€ā”€ lib/                 # Third-party library configs
ā”œā”€ā”€ config/              # App configuration files
ā”œā”€ā”€ constants/           # App constants and enums
ā”œā”€ā”€ types/               # TypeScript types
ā”œā”€ā”€ schemas/             # Schemas for validation/data
│
ā”œā”€ā”€ assets/              # Static assets
│   ā”œā”€ā”€ images/          # Image files
│   └── icons/           # Icon files
└── styles/              # Global styles and themes

# React-specific
└── routes/              # Route definitions

# Additional for Next.js with App Router
ā”œā”€ā”€ app/                 # App router pages
│   ā”œā”€ā”€ (auth)/          # Auth group routes
│   ā”œā”€ā”€ (dashboard)/     # Dashboard group routes
│   └── api/             # API routes
└── actions/             # Server actions

# Next.js with Pages Router
ā”œā”€ā”€ pages/               # Pages router
│   └── api/             # API routes
└── middleware.ts        # Next.js middleware

Examples

Creating a React Project

npx project-structure-creator@latest react

Creating a Next.js Project

npx project-structure-creator@latest next

Support

If you encounter any issues or have questions:

  1. Check the GitHub Issues
  2. Create a new issue if your problem isn't already reported
  3. Join our Discord Community for real-time help

Contributing

We welcome contributions! Please see Contributing Guide for details.

Changelog

See CHANGELOG.md for release history.

License

MIT Ā© Meet5555

Contact

  • GitHub: @Meet5555
  • Email: bhimanimeet55555@gmail.com