How khannedy/golang-clean-architecture works
Project Type Analysis
This is a Clean Architecture implementation in Go with both synchronous (HTTP) and asynchronous (Kafka) communication patterns. It's a full-stack backend application with web and worker components.
Main Components
A. External Layer (Purple):
• HTTP Clients
• Kafka Producers/Consumers
• Database (MySQL)
B. Delivery Layer (Blue):
• HTTP Controllers (user, contact, address)
• Message Consumers
• Middleware (auth)
C. Use Case Layer (Green):
• Business Logic Components (user, contact, address)
D. Repository Layer (Yellow):
• Data Access Layer
• Database Operations
E. Gateway Layer (Orange):
• Message Producers
• External System Integration
• [External Systems] ↔ [Delivery Layer] ↔ [Use Case Layer] ↔ [Repository/Gateway Layer] ↔ [Infrastructure]
Component Details
For each layer, show:
• Models/DTOs (internal/model)
• Entities (internal/entity)
• Events (internal/model/*_event.go)
• Converters (internal/model/converter)
Infrastructure Components
• MySQL Database
• Apache Kafka
• HTTP Server (Fiber)
• GORM Configuration
Specific Implementation Notes
• Clean architecture flow numbered 1-11 as mentioned in the README
• Separation between synchronous (HTTP) and asynchronous (Kafka) operations
• Database migration components
• How the configuration (config.json) affects all layers
Additional Details
• All used symbols
• Component types