structurea
v1.3.3
Published
Project structure management CLI for modern web development with TypeScript & JavaScript support
Maintainers
Readme
Structurea CLI
A powerful CLI tool to scaffold and manage project structures for modern web development. Choose from 6 professional architecture patterns and scaffold your project in seconds!
🚀 Quick Start
Install Globally
npm install -g structureaOr Use with npx (No Installation)
npx structurea create my-appUsage
# Create a new app with framework setup (React, Next.js, Vue)
structurea create my-app
# Interactive prompts will guide you through:
# 1. Framework: React, Next.js, or Vue
# 2. Build Tool: Vite or default (if applicable)
# 3. Language: TypeScript or JavaScript
# Then add a structure template
cd my-app
structurea init
# You'll be asked to choose:
# 1. Language: TypeScript (Recommended) or JavaScript
# 2. Template: Feature-Based, Atomic Design, MVC, etc.
# Or specify options directly
structurea create my-app --framework react --vite --typescript
structurea init --template feature-based
# List all available templates
structurea list
# Add a new feature to existing structure
structurea add dashboard✨ Features
- 🚀 Full App Creation - Create React, Next.js, or Vue apps with one command
- 🎨 Development Tools Setup - Tailwind CSS, Prettier, ESLint automatically configured
- 🏗️ 6 Professional Templates - Feature-Based, Atomic Design, MVC, Clean Architecture, DDD, Micro-Frontend
- ⚡ Vite Support - Choose Vite for faster development builds
- ✨ Prettier with Plugins - Auto-organize imports, sort Tailwind classes
- 🔍 Smart Detection - Auto-detects existing frameworks and configurations
- 🎨 TypeScript & JavaScript Support - Choose your language, get proper syntax
- 📁 Smart Scaffolding - Creates complete folder structures with boilerplate
- 🛠️ Developer-Friendly - Interactive prompts, dry-run mode, colored output
- 🔧 Framework Agnostic - Works with React, Next.js, Vue, and Node.js
📚 Available Templates
1. Feature-Based Architecture
Organize your code by features, not by file types. Each feature contains its own components, hooks, API calls, and utilities.
structurea init --template feature-basedStructure:
src/
├── features/
│ ├── auth/
│ │ ├── components/
│ │ ├── hooks/
│ │ ├── api/
│ │ └── types/
│ ├── dashboard/
│ └── profile/
└── shared/
├── components/
├── hooks/
└── utils/2. Atomic Design Pattern
Build UI components following atomic design principles: atoms → molecules → organisms → templates → pages.
structurea init --template atomic-designStructure:
src/
└── components/
├── atoms/ # Basic building blocks (Button, Input)
├── molecules/ # Simple combinations (SearchBar)
├── organisms/ # Complex components (Header, Sidebar)
├── templates/ # Page layouts
└── pages/ # Complete pages3. MVC Pattern
Classic Model-View-Controller architecture for clear separation of concerns.
structurea init --template mvc-patternStructure:
src/
├── models/ # Data models
├── views/ # UI components
├── controllers/ # Business logic
├── services/ # External services
└── routes/ # Route definitions4. Clean Architecture
Layered architecture following Uncle Bob's Clean Architecture principles.
structurea init --template clean-architectureStructure:
src/
├── domain/ # Business logic (entities, use cases)
├── application/ # Application logic
├── infrastructure/ # External concerns (API, database)
└── presentation/ # UI layer5. Domain-Driven Design (DDD)
Organize code around business domains with bounded contexts.
structurea init --template domain-drivenStructure:
src/
├── domains/
│ ├── user/
│ │ ├── entities/
│ │ ├── repositories/
│ │ ├── services/
│ │ └── value-objects/
│ ├── product/
│ └── order/
└── shared/
└── kernel/6. Micro-Frontend Pattern
Modular frontend architecture for large-scale applications.
structurea init --template micro-frontendStructure:
src/
├── apps/
│ ├── shell/ # Main application shell
│ ├── auth/ # Auth micro-frontend
│ ├── dashboard/ # Dashboard micro-frontend
│ └── settings/ # Settings micro-frontend
└── shared/
├── components/
└── utils/🎯 Commands
init
Initialize a project structure with a template.
# Interactive mode
structurea init
# Specify template
structurea init --template feature-based
# Skip confirmation
structurea init --template atomic-design --force
# Preview changes without creating files
structurea init --template mvc-pattern --dry-runlist
Show all available templates.
# Simple list
structurea list
# Detailed information
structurea list --verboseadd
Add a new feature to an existing structure.
# Add with interactive prompt
structurea add authentication
# Specify template for the feature
structurea add dashboard --template feature-based⚙️ Options
| Option | Description |
| ------------------- | -------------------------------------- |
| --template <name> | Specify which template to use |
| --force | Skip confirmation prompts |
| --dry-run | Preview changes without creating files |
| --verbose | Show detailed information |
| --help | Display help information |
| --version | Show version number |
📖 Examples
Start a New Next.js Project
npx create-next-app my-app
cd my-app
structurea init --template feature-basedAdd to Existing React Project
cd my-react-app
structurea init --template atomic-designPreview Before Creating
structurea init --template clean-architecture --dry-runUse Multiple Templates
# Initialize with feature-based
structurea init --template feature-based
# Add specific features with different patterns
structurea add design-system --template atomic-design🛠️ Development
Requirements
- Node.js >= 18.0.0
- npm or pnpm or yarn
Project Structure
packages/cli/
├── src/
│ ├── cli.ts # CLI entry point
│ ├── commands/ # Command implementations
│ ├── core/ # Core logic
│ ├── templates/ # Template definitions
│ ├── utils/ # Utilities
│ └── libs/types/ # TypeScript types
├── dist/ # Built files
├── package.json # Package configuration
└── tsconfig.json # TypeScript configScripts
npm run dev # Run in development mode
npm run build # Build for production
npm run format # Format code with Prettier
npm run lint # Lint code with ESLint
npm run test # Run tests🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📄 License
MIT © Structurea Team
🌟 Show Your Support
Give a ⭐️ if this project helped you!
📞 Support
- Report bugs: GitHub Issues
- Questions: GitHub Discussions
Happy Coding! 🎉
