{"id":30330161,"url":"https://github.com/sazardev/goca","last_synced_at":"2026-02-01T18:05:39.517Z","repository":{"id":305366753,"uuid":"1022666888","full_name":"sazardev/goca","owner":"sazardev","description":"Goca is a powerful CLI code generator for Go that helps you create Clean Architecture projects following best practices.","archived":false,"fork":false,"pushed_at":"2026-01-12T05:52:01.000Z","size":46770,"stargazers_count":190,"open_issues_count":24,"forks_count":4,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-12T15:44:43.397Z","etag":null,"topics":["clean-architecture","cli","cli-app","code-generation","go","golang"],"latest_commit_sha":null,"homepage":"https://sazardev.github.io/goca/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sazardev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":"GOVERNANCE.md","roadmap":"ROADMAP.md","authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["sazardev"]}},"created_at":"2025-07-19T15:09:26.000Z","updated_at":"2026-01-12T05:51:58.000Z","dependencies_parsed_at":"2025-07-19T20:21:41.574Z","dependency_job_id":"e55c18ba-15e0-4f86-8a84-d401411608eb","html_url":"https://github.com/sazardev/goca","commit_stats":null,"previous_names":["sazardev/goca"],"tags_count":67,"template":false,"template_full_name":null,"purl":"pkg:github/sazardev/goca","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sazardev%2Fgoca","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sazardev%2Fgoca/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sazardev%2Fgoca/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sazardev%2Fgoca/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sazardev","download_url":"https://codeload.github.com/sazardev/goca/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sazardev%2Fgoca/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28984896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T17:52:09.146Z","status":"ssl_error","status_checked_at":"2026-02-01T17:49:53.529Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clean-architecture","cli","cli-app","code-generation","go","golang"],"created_at":"2025-08-18T02:42:00.777Z","updated_at":"2026-02-01T18:05:39.511Z","avatar_url":"https://github.com/sazardev.png","language":"Go","funding_links":["https://github.com/sponsors/sazardev"],"categories":["Go"],"sub_categories":[],"readme":"# Goca - Go Clean Architecture Code Generator\n\n[![Go Version](https://img.shields.io/badge/Go-1.24.5+-00ADD8?style=flat\u0026logo=go)](https://golang.org/)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Build Status](https://img.shields.io/badge/Build-Passing-brightgreen.svg)](https://github.com/sazardev/goca)\n[![Production Ready](https://img.shields.io/badge/Status-Production%20Ready-brightgreen.svg)](docs/BUG_FIXES_REPORT.md)\n[![GitHub Release](https://img.shields.io/github/v/release/sazardev/goca?style=flat\u0026logo=github)](https://github.com/sazardev/goca/releases)\n[![Docs](https://img.shields.io/badge/Docs-VitePress-blueviolet.svg)](https://sazardev.github.io/goca)\n\nGoca is a powerful CLI code generator for Go that helps you create Clean Architecture projects following best practices. It generates clean, well-structured layered code, allowing you to focus on business logic instead of repetitive configuration tasks.\n\n## Documentation\n\n- **[Complete Documentation Website](https://sazardev.github.io/goca)** - Beautiful, searchable VitePress docs\n- **[Quick Start Guide](https://sazardev.github.io/goca/getting-started)** - Get started in 5 minutes\n- **[Complete Tutorial](https://sazardev.github.io/goca/tutorials/complete-tutorial)** - Build a real application\n- **[Clean Architecture Guide](https://sazardev.github.io/goca/guide/clean-architecture)** - Learn the principles\n- **[Commands Reference](https://sazardev.github.io/goca/commands/)** - All commands documented\n\n## Clean Architecture Philosophy\n\nEvery feature generated by Goca strictly follows Clean Architecture principles:\n\n- **🟡 Domain Layer**: Pure entities without external dependencies\n- **🔴 Use Case Layer**: Application logic with DTOs and business validations\n- **🟢 Adapter Layer**: HTTP, gRPC, CLI interfaces that adapt input/output\n- **🔵 Infrastructure Layer**: Repositories that implement data persistence\n\n### ✅ Best Practices Guaranteed\n\n- Dependencies oriented towards the system core\n- Clear interfaces and contracts between layers\n- Business logic encapsulated in internal layers\n- Clearly segregated responsibilities\n- Dependency injection for maximum testability\n\n### 🚫 Bad Practices Prevention\n\n- Prevents mixing technical logic with business logic\n- Prevents direct dependencies from entities to infrastructure\n- Generates well-structured and cohesive packages\n\n## 🧠 Implemented Principles and Anti-Patterns\n\n### ✅ Applied Patterns\n- **Repository Pattern**: Data persistence abstraction\n- **Dependency Injection**: Inversion of control between layers\n- **CQRS**: Separation of commands and queries in use cases\n- **Interface Segregation**: Specific contracts per responsibility\n\n### 🚫 Prevented Anti-Patterns\n- **Fat Controller**: Business logic in handlers\n- **God Object**: Entities with too many responsibilities\n- **Anemic Domain Model**: Entities without behavior\n- **Direct Database Access**: Direct dependencies to infrastructure\n\n## 🔍 Clean Architecture Validation\n\nGoca guarantees that every generated file complies with:\n\n- **Dependency Rule**: Internal code never depends on external code\n- **Separation of Concerns**: Each layer has a single reason to change\n- **Inversion Principle**: Details depend on abstractions\n- **Clean Interfaces**: Clear contracts between layers\n\n## 🚀 Main Features\n\n- **Layer-based Generation**: Each command generates code specific to a Clean Architecture layer\n- **Complete Feature**: One command generates all necessary structure for a feature\n- **Domain Entities**: Generates pure entities with business validations\n- **Use Cases**: Creates application services with well-defined DTOs\n- **Repositories**: Generates interfaces and implementations following Repository Pattern\n- **Multi-Protocol Handlers**: Supports HTTP, gRPC, CLI maintaining layer separation\n- **Dependency Injection**: Structure prepared for DI from the start\n- **Integration Testing**: Auto-generate comprehensive integration tests with fixtures and helpers (v1.14.0+)\n\n## 📦 Installation\n\n### Recommended: Binary from GitHub Releases\nDownload the latest stable version with proper version info from [GitHub Releases](https://github.com/sazardev/goca/releases):\n\n**Linux:**\n```bash\n# Download latest release\nwget https://github.com/sazardev/goca/releases/latest/download/goca-linux-amd64\nchmod +x goca-linux-amd64\nsudo mv goca-linux-amd64 /usr/local/bin/goca\n\n# Verify installation\ngoca version\n```\n\n**macOS:**\n```bash\n# Intel Macs\nwget https://github.com/sazardev/goca/releases/latest/download/goca-darwin-amd64\nchmod +x goca-darwin-amd64\nsudo mv goca-darwin-amd64 /usr/local/bin/goca\n\n# Apple Silicon Macs  \nwget https://github.com/sazardev/goca/releases/latest/download/goca-darwin-arm64\nchmod +x goca-darwin-arm64\nsudo mv goca-darwin-arm64 /usr/local/bin/goca\n\n# Verify installation\ngoca version\n```\n\n**Windows:**\n```powershell\n# Download goca-windows-amd64.exe from GitHub Releases\n# Rename to goca.exe and add to PATH\n\n# Verify installation\ngoca version\n```\n\n### Alternative: Using Go Install\n```bash\n# Install from source (version info will show \"dev\")\ngo install github.com/sazardev/goca@latest\n\n# Note: go install builds from source without version injection\n# For proper version info, use binary releases above\n```\n\n### For Development\n```bash\n# Clone and build with proper version injection\ngit clone https://github.com/sazardev/goca.git\ncd goca\nmake build\n\n# The binary will be created in current directory\n# Move to PATH if needed:\nsudo mv goca /usr/local/bin/goca\n```\n\n## 🛠️ Quick Start\n\n### Initialize Clean Architecture Project\n```bash\n# Create new project with Clean Architecture structure\ngoca init myproject --module github.com/sazardev/myproject\n\n# Navigate to project\ncd myproject\n\n# Install dependencies\ngo mod tidy\n```\n\n### Generate Complete Feature (NEW - Auto-Integrated)\n```bash\n# Generate complete feature with all layers + automatic integration\ngoca feature Employee --fields \"name:string,email:string,role:string\"\n\n# Ready to go! The feature is completely functional\ngo run main.go\n```\n\n### Integrate Existing Features (NEW)\n```bash\n# For projects with features not integrated\ngoca integrate --all\n\n# Automatically detects all features and connects them\n```\n\n## ⚡ NEW in v1.11.0: Safety \u0026 Dependency Features\n\nGoca now includes production-ready safety features to prevent common mistakes:\n\n### 🛡️ Safety Features\n\n- **🔍 Dry-Run Mode** (`--dry-run`): Preview all changes before creating files\n- **⚠️ File Conflict Detection**: Automatically detects existing files to prevent accidental overwrites\n- **👤 Name Conflict Detection**: Scans project for duplicate entity/feature names\n- **📦 Automatic Backup** (`--backup`): Backup files before overwriting\n- **💪 Force Overwrite** (`--force`): Override protection when needed\n- **📚 Version Compatibility**: Verifies Go version compatibility (1.21+)\n\n### 📦 Dependency Management\n\n- **🤖 Automatic go.mod Updates**: Auto-updates dependencies when generating features\n- **� Smart Suggestions**: Recommends optional dependencies based on feature type\n- **✅ Version Verification**: Validates dependency versions and integrity\n\n### Example Usage\n\n```bash\n# Preview changes before generating\ngoca feature User --fields \"name:string,email:string\" --dry-run\n\n# Safe generation with conflict detection\ngoca feature User --fields \"name:string,email:string\"\n\n# Update existing feature with backup\ngoca feature User --fields \"name:string,email:string,role:string\" --force --backup\n```\n\n**[📖 Complete Safety Features Documentation](docs/features/safety-and-dependencies.md)**\n\n## �📋 Main Commands\n\n| Command              | Purpose                                 | Automatic Integration       |\n| -------------------- | --------------------------------------- | --------------------------- |\n| **`goca init`**      | Initialize Clean Architecture project   | ✅ Complete structure + Git  |\n| **`goca feature`**   | Generate complete feature (all layers)  | ✅ Auto-DI + Routes + Safety |\n| **`goca integrate`** | **NEW**: Integrate existing features    | ✅ Repair/update integration |\n| `goca entity`        | Generate domain entities only           | ❌ Manual                    |\n| `goca usecase`       | Generate use cases only                 | ❌ Manual                    |\n| `goca repository`    | Generate repositories only              | ❌ Manual                    |\n| `goca handler`       | Generate handlers only                  | ❌ Manual                    |\n| `goca di`            | Generate dependency injection container | ❌ Manual                    |\n\n## 🔄 Recommended Workflow\n\n1. **Generate Domain**: `goca entity Employee --fields \"name:string,email:string\"`\n2. **Generate Use Cases**: `goca usecase EmployeeService --entity Employee`\n3. **Generate Repository**: `goca repository Employee --database postgres`\n4. **Generate Handlers**: `goca handler Employee --type http`\n5. **Generate DI**: `goca di --features Employee`\n\n## 📚 Commands by Layer\n\n### 🟡 Domain Layer\n\n#### `goca entity`\nGenerates pure domain entities following DDD.\n```bash\ngoca entity \u003cname\u003e [flags]\n\n# Flags:\n--fields string     Entity fields \"name:type,email:string\"\n--validation       Add domain validations\n--business-rules   Include business rule methods\n```\n\n**Example:**\n```bash\ngoca entity Product --fields \"name:string,price:float64,category:string\" --validation --business-rules\n```\n\n**Generated Code:**\n```go\n// domain/product.go\npackage domain\n\ntype Product struct {\n    ID       int\n    Name     string\n    Price    float64\n    Category string\n}\n\nfunc (p *Product) Validate() error {\n    if p.Name == \"\" || p.Price \u003c= 0 {\n        return ErrInvalidProductData\n    }\n    return nil\n}\n\nfunc (p *Product) IsExpensive() bool {\n    return p.Price \u003e 1000.0\n}\n```\n\n### 🔴 Use Case Layer\n\n#### `goca usecase`\nGenerates application services with DTOs and business logic.\n```bash\ngoca usecase \u003cname\u003e [flags]\n\n# Flags:\n--entity string    Associated entity\n--operations string CRUD operations (create,read,update,delete,list)\n--dto-validation   DTOs with specific validations\n```\n\n**Example:**\n```bash\ngoca usecase ProductService --entity Product --operations \"create,read,update,delete,list\" --dto-validation\n```\n\n**Generated Code:**\n```go\n// usecase/product_service.go\npackage usecase\n\nimport \"myproject/domain\"\n\ntype CreateProductInput struct {\n    Name     string `validate:\"required,min=3\"`\n    Price    float64 `validate:\"required,gt=0\"`\n    Category string `validate:\"required\"`\n}\n\ntype CreateProductOutput struct {\n    Product domain.Product\n    Message string\n}\n\ntype ProductUseCase interface {\n    CreateProduct(input CreateProductInput) (CreateProductOutput, error)\n    GetProduct(id int) (domain.Product, error)\n    UpdateProduct(id int, input UpdateProductInput) error\n    DeleteProduct(id int) error\n    ListProducts() ([]domain.Product, error)\n}\n```\n\n### 🟢 Adapter Layer (Handlers)\n\n#### `goca handler`\nGenerates delivery adapters for different protocols.\n```bash\ngoca handler \u003centity\u003e [flags]\n\n# Flags:\n--type string     Handler type (http, grpc, cli, worker, soap)\n--middleware      Include middleware setup\n--validation      Input validation in handler\n```\n\n**HTTP Example:**\n```bash\ngoca handler Product --type http --middleware --validation\n```\n\n**Generated Code:**\n```go\n// handler/http/product_handler.go\npackage http\n\nimport (\n    \"encoding/json\"\n    \"net/http\"\n    \"myproject/usecase\"\n)\n\ntype ProductHandler struct {\n    usecase usecase.ProductUseCase\n}\n\nfunc NewProductHandler(uc usecase.ProductUseCase) *ProductHandler {\n    return \u0026ProductHandler{usecase: uc}\n}\n\nfunc (h *ProductHandler) CreateProduct(w http.ResponseWriter, r *http.Request) {\n    var input usecase.CreateProductInput\n    if err := json.NewDecoder(r.Body).Decode(\u0026input); err != nil {\n        http.Error(w, \"Invalid request body\", http.StatusBadRequest)\n        return\n    }\n    \n    output, err := h.usecase.CreateProduct(input)\n    if err != nil {\n        http.Error(w, err.Error(), http.StatusInternalServerError)\n        return\n    }\n    \n    w.Header().Set(\"Content-Type\", \"application/json\")\n    json.NewEncoder(w).Encode(output)\n}\n```\n\n### 🔵 Infrastructure Layer\n\n#### `goca repository`\nGenerates repositories with interfaces and implementations.\n```bash\ngoca repository \u003centity\u003e [flags]\n\n# Flags:\n--database string  Database type (postgres, mysql, mongodb)\n--interface-only   Generate interfaces only\n--implementation   Generate implementation only\n```\n\n**Example:**\n```bash\ngoca repository Product --database postgres\n```\n\n**Generated Code:**\n```go\n// repository/interfaces/product_repository.go\npackage interfaces\n\nimport \"myproject/domain\"\n\ntype ProductRepository interface {\n    Save(product *domain.Product) error\n    FindByID(id int) (*domain.Product, error)\n    FindAll() ([]domain.Product, error)\n    Update(product *domain.Product) error\n    Delete(id int) error\n}\n\n// repository/postgres/product_repository.go\npackage postgres\n\nimport (\n    \"database/sql\"\n    \"myproject/domain\"\n    \"myproject/repository/interfaces\"\n)\n\ntype postgresProductRepository struct {\n    db *sql.DB\n}\n\nfunc NewPostgresProductRepository(db *sql.DB) interfaces.ProductRepository {\n    return \u0026postgresProductRepository{db: db}\n}\n\nfunc (r *postgresProductRepository) Save(product *domain.Product) error {\n    query := `INSERT INTO products (name, price, category) VALUES ($1, $2, $3) RETURNING id`\n    err := r.db.QueryRow(query, product.Name, product.Price, product.Category).Scan(\u0026product.ID)\n    return err\n}\n```\n\n### Auxiliary Commands\n\n#### `goca messages`\nGenerates message and constant files.\n```bash\ngoca messages \u003centity\u003e [flags]\n\n# Flags:\n--errors       Generate error messages\n--responses    Generate response messages\n--constants    Generate feature constants\n```\n\n## 📁 Complete Structure per Feature (Example: Employee)\n\n```\nemployee/\n├── domain/\n│   ├── employee.go          # Pure entity\n│   ├── errors.go           # Domain errors\n│   └── validations.go      # Business validations\n├── usecase/\n│   ├── dto.go              # Input/output DTOs\n│   ├── employee_usecase.go # Use case interface\n│   ├── employee_service.go # Use case implementation\n│   └── interfaces.go       # Contracts to other layers\n├── repository/\n│   ├── interfaces.go       # Persistence contracts\n│   ├── postgres_employee_repo.go  # PostgreSQL implementation\n│   └── memory_employee_repo.go    # In-memory implementation\n├── handler/\n│   ├── http/\n│   │   ├── dto.go          # HTTP-specific DTOs\n│   │   └── handler.go      # HTTP controller\n│   ├── grpc/\n│   │   ├── employee.proto  # gRPC definition\n│   │   └── server.go       # gRPC server\n│   ├── cli/\n│   │   └── commands.go     # CLI commands\n│   ├── worker/\n│   │   └── worker.go       # Workers/Jobs\n│   └── soap/\n│       └── soap_client.go  # SOAP client\n├── messages/\n│   ├── errors.go           # Error messages\n│   └── responses.go        # Response messages\n├── constants/\n│   └── constants.go        # Feature constants\n└── main.go                 # Entry point\n```\n\n## 📋 Best vs Bad Practices by Layer\n\n### 🟡 Domain - What to DO and NOT do\n\n#### ✅ Best Practices:\n```go\n// ✅ Pure entity with business validations\ntype Employee struct {\n    ID    int\n    Name  string\n    Email string\n    Role  string\n}\n\nfunc (e *Employee) Validate() error {\n    if e.Name == \"\" || e.Email == \"\" {\n        return ErrInvalidEmployeeData\n    }\n    return nil\n}\n\nfunc (e *Employee) IsManager() bool {\n    return e.Role == \"manager\"\n}\n```\n\n#### ❌ Bad Practices:\n```go\n// ❌ NEVER: Infrastructure dependencies in domain\ntype Employee struct {\n    ID int\n    DB *sql.DB // ❌ External dependency\n}\n\n// ❌ NEVER: Technical logic in domain\nfunc (e *Employee) SaveToDatabase() error // ❌ Wrong responsibility\n\n// ❌ NEVER: Import packages from external layers\nimport \"myproject/handler/http\" // ❌ Dependency violation\n```\n\n### 🔴 Use Cases - What to DO and NOT do\n\n#### ✅ Best Practices:\n```go\n// ✅ Well-defined DTOs\ntype CreateEmployeeInput struct {\n    Name  string `validate:\"required\"`\n    Email string `validate:\"required,email\"`\n}\n\n// ✅ Interfaces to other layers\ntype EmployeeRepository interface {\n    Save(*domain.Employee) error\n}\n\n// ✅ Pure application logic\nfunc (s *EmployeeService) CreateEmployee(input CreateEmployeeInput) error {\n    emp := domain.Employee{Name: input.Name, Email: input.Email}\n    if err := emp.Validate(); err != nil {\n        return err\n    }\n    return s.repo.Save(\u0026emp)\n}\n```\n\n#### ❌ Bad Practices:\n```go\n// ❌ NEVER: Direct infrastructure dependencies\nfunc (s *EmployeeService) CreateEmployee(db *sql.DB) error // ❌ Coupling\n\n// ❌ NEVER: Presentation logic\nfunc (s *EmployeeService) CreateEmployeeJSON() string // ❌ Wrong responsibility\n\n// ❌ NEVER: Implementation details\nfunc (s *EmployeeService) CreateEmployeeWithPostgres() error // ❌ Technical specificity\n```\n\n### 🟢 Adapters - What to DO and NOT do\n\n#### ✅ Best Practices:\n```go\n// ✅ Data transformation only\nfunc (h *EmployeeHandler) CreateEmployee(w http.ResponseWriter, r *http.Request) {\n    var httpInput HTTPCreateEmployeeInput\n    json.NewDecoder(r.Body).Decode(\u0026httpInput)\n    \n    usecaseInput := usecase.CreateEmployeeInput{\n        Name:  httpInput.Name,\n        Email: httpInput.Email,\n    }\n    \n    err := h.usecase.CreateEmployee(usecaseInput)\n    // Handle HTTP response\n}\n```\n\n#### ❌ Bad Practices:\n```go\n// ❌ NEVER: Business logic in handlers\nfunc (h *EmployeeHandler) CreateEmployee(w http.ResponseWriter, r *http.Request) {\n    // ❌ Business validations here\n    if employee.Salary \u003c 0 {\n        return errors.New(\"invalid salary\")\n    }\n}\n\n// ❌ NEVER: Direct repository access\nfunc (h *EmployeeHandler) CreateEmployee(repo EmployeeRepository) // ❌ Skip use cases\n```\n\n### 🔵 Infrastructure - What to DO and NOT do\n\n#### ✅ Best Practices:\n```go\n// ✅ Specific persistence implementation\nfunc (r *PostgresEmployeeRepo) Save(emp *domain.Employee) error {\n    query := \"INSERT INTO employees (name, email) VALUES ($1, $2)\"\n    _, err := r.db.Exec(query, emp.Name, emp.Email)\n    return err\n}\n\n// ✅ Implement domain interfaces\nfunc NewPostgresEmployeeRepo(db *sql.DB) domain.EmployeeRepository {\n    return \u0026PostgresEmployeeRepo{db: db}\n}\n```\n\n#### ❌ Bad Practices:\n```go\n// ❌ NEVER: Expose specific DB types\nfunc (r *PostgresEmployeeRepo) GetDB() *sql.DB // ❌ Technical detail exposed\n\n// ❌ NEVER: Business logic in repositories\nfunc (r *PostgresEmployeeRepo) ValidateAndSave(emp *domain.Employee) error {\n    if emp.Salary \u003c 0 { // ❌ Business validation here\n        return errors.New(\"invalid salary\")\n    }\n}\n```\n\n## 🔧 Advanced Commands\n\n### Generate Complete Feature\n```bash\n# Generates all layers for a feature\ngoca feature \u003cname\u003e --fields \"field:type,...\" --database postgres --handlers \"http,grpc,cli\"\n```\n\n### Generate Interfaces Only\n```bash\n# Useful for TDD - generate contracts first\ngoca interfaces Product --usecase --repository\n```\n\n### Generate Dependency Injection\n```bash\n# Generates DI container for automatic wiring\ngoca di --features \"Product,User,Order\"\n```\n\n## 🎯 Advantages of Each Layer\n\n### 🟡 Domain\n- **Pure entities** without external dependencies\n- **Business rules** centralized and testable\n- **Domain-specific validations**\n\n### 🔴 Use Cases\n- **Specific DTOs** for each operation\n- **Well-defined application logic**\n- **Clear interfaces** to other layers\n\n### 🟢 Adapters\n- **Complete separation** between input protocols\n- **Protocol-specific input validations**\n- **Transformation** from external to internal DTOs\n\n### 🔵 Infrastructure\n- **Interchangeable implementations** of persistence\n- **Isolation** of technical details\n- **Centralized configuration** of external resources\n\n## 🔄 Dependency Flow\n\n```\nHandler → UseCase → Repository → Database\n   ↓         ↓         ↓\n DTO ←→ Business ←→ Domain Entity\n```\n\n**Golden Rule**: Dependencies always point inward, towards the domain.\n\n## 📚 Complete Documentation\n\n### Configuration System\n- **[Quick Start Config](docs/QUICKSTART_CONFIG.md)** - Get started with `.goca.yaml` in 5 minutes\n- **[YAML Structure Reference](docs/YAML_STRUCTURE_REFERENCE.md)** - Complete reference for all configuration options\n- **[Configuration System Guide](docs/configuration-system.md)** - Detailed configuration documentation\n- **[Migration Guide](docs/migration-guide.md)** - Migrate from pure CLI to configuration files\n\n### Integration \u0026 Status\n- **[Production Ready Report](docs/PRODUCTION_READY_FINAL_REPORT.md)** - 100% production readiness verification\n- **[Configuration Integration Complete](docs/CONFIGURATION_INTEGRATION_COMPLETE.md)** - Integration status and technical details\n\n### Advanced Topics\n- **[Advanced Configuration](docs/advanced-config.md)** - Advanced configuration commands and patterns\n- **[Complete Tutorial](wiki/Complete-Tutorial.md)** - Step-by-step tutorial for full project setup\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/clean-arch-enhancement`)\n3. Commit your changes (`git commit -m 'Add enhanced clean architecture layer'`)\n4. Push to the branch (`git push origin feature/clean-arch-enhancement`)\n5. Open a Pull Request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🆘 Support\n\n- 📧 Email: support@goca.dev\n- 🐛 Issues: [GitHub Issues](https://github.com/sazardev/goca/issues)\n- 📖 Documentation: [Complete Documentation](https://docs.goca.dev)\n\n---\n\nBuilt with ❤️ for the Go community","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsazardev%2Fgoca","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsazardev%2Fgoca","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsazardev%2Fgoca/lists"}