Template


πŸ“ Description

Display template information and directory structure. The template command provides comprehensive information about available Gexd templates, their architecture patterns, directory structures, and usage recommendations to help you make informed decisions for your Flutter projects.


βš™οΈ Usage

gexd info template [template_name] [options]

πŸ“– Detailed Usage

Display template information and structure

Usage: gexd info template [template_name] [options]

Arguments:
  <template_name>    Template to display (getx, clean)
                     [Optional: Shows all templates if not specified]

Options:
  --full             Show full directory structure including optional components

Examples:
  gexd info template                  # List all available templates
  gexd info template clean            # Show clean template details
  gexd info template clean --full     # Show full directory structure
  gexd info template getx --full      # Show GetX template with full structure

🎯 Key Features

πŸ“š Template Overview

  • Complete Template List: Display all available architecture templates

  • Detailed Descriptions: Comprehensive explanation of each template's approach

  • Best Use Cases: Recommended scenarios and project types

  • Key Features: Architecture-specific capabilities and benefits

πŸ“ Directory Structure

  • Basic Structure: Essential directories and organization

  • Full Structure: Complete directory tree with optional components

  • Visual Tree: Beautiful ASCII tree representation

  • Component Descriptions: Explanation of each directory's purpose

πŸ—οΈ Architecture Information

  • Design Principles: Underlying architectural patterns

  • Organization Strategy: How code is structured and organized

  • Development Workflow: Recommended development approaches

  • Best Practices: Template-specific conventions and guidelines


πŸš€ Usage Modes

1️⃣ List All Templates

gexd info template

Output:

πŸ—οΈ Available Templates
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

πŸ“ GetX Standard Architecture (getx)
   Description: Feature-based modular architecture with GetX state management.
   Perfect for rapid development with reactive programming patterns.
   Best For: Medium to large applications, rapid prototyping, GetX enthusiasts

πŸ“ Clean Architecture (clean)
   Description: Domain-driven design with clear separation of concerns.
   Follows Uncle Bob's Clean Architecture principles for maximum maintainability.
   Best For: Enterprise applications, complex business logic, long-term projects

πŸ’‘ Use gexd info template <name> --full to see detailed structure

2️⃣ Template Details (Basic)

gexd info template clean

Output:

πŸ—οΈ Clean Architecture Template
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

πŸ“– Description:
   Domain-driven design with clear separation of concerns.
   Follows Uncle Bob's Clean Architecture principles for maximum maintainability.

🎯 Best For:
   Enterprise applications, complex business logic, long-term projects

✨ Key Features:
   Layered architecture, dependency inversion principle,
   high testability, framework independence, clear boundaries

πŸ“ Directory Structure:

πŸ“ Clean Architecture Template Structure
β”œβ”€β”€ πŸ“ lib
β”‚   β”œβ”€β”€ πŸ“ core   # Core application foundation
β”‚   β”œβ”€β”€ πŸ“ domain # Business logic layer
β”‚   β”œβ”€β”€ πŸ“ infrastructure # External dependencies
β”‚   β”œβ”€β”€ πŸ“ presentation # UI layer
β”‚   └── πŸ“ shared # Shared components
└── πŸ“ assets/   # Project assets

πŸ’‘ Use --full flag to see the complete directory structure

3️⃣ Complete Structure (Full)

gexd info template clean --full

Shows the complete directory tree with all optional components and detailed descriptions.


πŸ—οΈ Template Comparison

πŸ“Š GetX Template

🎯 Architecture Overview

  • Pattern: Feature-based modular architecture

  • State Management: GetX reactive programming

  • Organization: Module-centric structure

  • Dependencies: Built-in GetX ecosystem

✨ Key Strengths

  • Rapid Development: Minimal boilerplate, quick setup

  • Reactive Programming: Built-in state management and reactivity

  • Integrated Ecosystem: Routing, dependency injection, internationalization

  • Learning Curve: Gentle for developers familiar with GetX

🎯 Best For

  • Medium to Large Apps: Suitable for complex applications

  • Rapid Prototyping: Quick MVP development

  • GetX Enthusiasts: Teams comfortable with GetX patterns

  • Feature-Rich Apps: Applications requiring extensive functionality

πŸ“ Directory Highlights

lib/app/
β”œβ”€β”€ modules/           # Feature modules
β”‚   β”œβ”€β”€ auth/         # Authentication feature
β”‚   β”œβ”€β”€ home/         # Home feature  
β”‚   └── profile/      # User profile feature
β”œβ”€β”€ core/             # Core utilities
└── data/             # Data layer

πŸ›οΈ Clean Architecture Template

🎯 Architecture Overview

  • Pattern: Layered architecture with dependency inversion

  • State Management: Framework-agnostic (can use any)

  • Organization: Layer-centric structure

  • Dependencies: Minimal, focused on business logic

✨ Key Strengths

  • High Testability: Clear separation enables comprehensive testing

  • Framework Independence: Business logic isolated from UI framework

  • Scalability: Designed for large, complex applications

  • Maintainability: Clear boundaries and dependencies

🎯 Best For

  • Enterprise Applications: Large-scale business applications

  • Complex Business Logic: Applications with intricate rules

  • Long-term Projects: Applications requiring long-term maintenance

  • Team Development: Large development teams with clear responsibilities

πŸ“ Directory Highlights

lib/
β”œβ”€β”€ domain/           # Business logic
β”‚   β”œβ”€β”€ entities/     # Core business objects
β”‚   └── usecases/     # Business rules
β”œβ”€β”€ infrastructure/   # External dependencies
β”‚   β”œβ”€β”€ datasources/ # Data access
β”‚   └── repositories/ # Data abstraction
└── presentation/     # UI layer
    β”œβ”€β”€ pages/       # Application screens
    └── controllers/ # UI controllers

πŸ” Directory Structure Analysis

πŸ“‚ Component Categories

πŸ›οΈ Core Components (Both Templates)

  • core/: Fundamental application infrastructure

  • shared/: Reusable components across features

  • assets/: Static resources and files

πŸ“Š Data Management

  • GetX: lib/app/data/ with models, services, providers

  • Clean: lib/infrastructure/ with repositories, datasources

🎨 Presentation Layer

  • GetX: lib/app/modules/ with feature-based organization

  • Clean: lib/presentation/ with layered organization

🧠 Business Logic

  • GetX: Embedded within modules and services

  • Clean: Isolated in lib/domain/ layer

πŸ”§ Optional Components (Shown with --full)

  • Middleware: Request/response processing

  • Extensions: Dart type extensions

  • Exceptions: Custom error handling

  • Interfaces: Contract definitions

  • Utils: Helper functions and utilities


πŸ’‘ Making Template Decisions

πŸ€” Decision Framework

Choose GetX Template When:

  • βœ… Rapid development is prioritized

  • βœ… Team is familiar with GetX ecosystem

  • βœ… Building medium to large applications

  • βœ… Want integrated state management solution

  • βœ… Prefer feature-based organization

Choose Clean Architecture When:

  • βœ… Building enterprise-grade applications

  • βœ… Complex business logic requirements

  • βœ… High testability is critical

  • βœ… Framework independence is important

  • βœ… Large development team with specialized roles

πŸ“Š Comparison Matrix

Aspect
GetX Template
Clean Architecture

Learning Curve

Moderate

Steep

Development Speed

Fast

Moderate

Testability

Good

Excellent

Scalability

Good

Excellent

Framework Coupling

High (GetX)

Low

Boilerplate

Low

Moderate

Team Size

Small-Medium

Medium-Large

Business Complexity

Moderate

High


πŸš€ Real-World Usage Examples

πŸ” Template Research

# Explore all options before starting new project
gexd info template

# Deep dive into specific template
gexd info template clean --full
gexd info template getx --full

# Make informed decision based on project requirements

πŸ“š Team Education

# Onboard new team members
gexd info template clean --full

# Show architecture during code reviews
gexd info template getx

# Reference during architectural discussions

πŸ—οΈ Project Planning

# Planning phase: Understand structure implications
gexd info template clean --full

# Pre-development: Align team on organization
gexd info template getx

# Architecture review: Validate chosen approach

πŸ“– Documentation Generation

# Generate structure documentation for wikis
gexd info template clean --full > docs/architecture.md

# Create template comparison documents
gexd info template > docs/template-options.md

🎨 Advanced Usage Patterns

πŸ”¬ Architecture Analysis

# Compare structures side by side
gexd info template getx --full > getx_structure.txt
gexd info template clean --full > clean_structure.txt
diff getx_structure.txt clean_structure.txt

πŸ“‹ Project Setup Workflow

# 1. Research templates
gexd info template

# 2. Analyze specific template
gexd info template clean --full

# 3. Create project with informed choice
gexd create my_project --template clean

# 4. Verify structure matches expectations
cd my_project && ls -la lib/

πŸ”§ Development Integration

# During development: Reference structure for component placement
gexd info template clean --full | grep -A5 "presentation"

# Architecture validation: Ensure compliance with template
gexd info template clean

πŸ“Š Structure Output Formats

🌳 Tree Structure Format

πŸ“ Clean Architecture Template Structure
β”œβ”€β”€ πŸ“ lib
β”‚   β”œβ”€β”€ πŸ“ core   # Core application foundation
β”‚   β”‚   β”œβ”€β”€ πŸ“ bindings   # Initial dependency bindings
β”‚   β”‚   └── πŸ“ themes   # App theme definitions
β”‚   β”œβ”€β”€ πŸ“ domain   # Business logic layer
β”‚   β”‚   β”œβ”€β”€ πŸ“ entities   # Core business objects
β”‚   β”‚   └── πŸ“ usecases   # Business rules
β”‚   └── πŸ“ presentation   # UI layer
β”‚       β”œβ”€β”€ πŸ“ pages   # Application screens
β”‚       └── πŸ“ controllers   # UI controllers
└── πŸ“ assets/   # Project assets

πŸ“‹ Component Descriptions

Each directory includes:

  • πŸ“ Icon: Visual identification

  • Name: Directory/file name

  • # Comment: Purpose and usage description

🎯 Organizational Logic

  • Hierarchical: Shows parent-child relationships

  • Categorized: Groups related components

  • Descriptive: Explains purpose of each component

  • Visual: Easy to scan and understand


❓ Troubleshooting

Common Issues

❌ "Unknown template: template_name"

# Problem: Invalid template name provided
gexd info template invalid_name
# Error: Unknown template: invalid_name

# βœ… Solution: Check available templates
gexd info template  # Shows all available templates

❌ Command not displaying properly

# Problem: Terminal encoding issues
gexd info template clean --full
# Output appears garbled

# βœ… Solution: Ensure UTF-8 terminal support
export LANG=en_US.UTF-8
gexd info template clean --full

❌ Structure seems incomplete

# Problem: Basic structure missing details
gexd info template clean
# Shows minimal structure

# βœ… Solution: Use --full flag for complete structure
gexd info template clean --full

πŸ”§ Advanced Troubleshooting

Template Updates

# If template structure seems outdated
gexd self-update  # Update to latest version
gexd info template clean --full  # Get latest structure

Comparison Issues

# For detailed template comparison
gexd info template getx --full > /tmp/getx.txt
gexd info template clean --full > /tmp/clean.txt
code --diff /tmp/getx.txt /tmp/clean.txt  # Visual comparison

πŸ“‹ Project Creation

  • gexd create - Create new project with chosen template

  • gexd init - Initialize existing project with template

πŸ”§ Project Management

πŸ› οΈ Development


πŸ“š Further Reading

πŸ—οΈ Architecture Guides

πŸ“– Best Practices


Generated automatically by gexd_doc

Last updated