A professionally structured Go application implementing Clean Architecture principles with comprehensive testing automation and development workflows.
The project follows a feature-based modular architecture with clear separation of concerns:
.
├── core/ # Shared components across features
│ ├── config/ # Configuration management
│ ├── nats/ # NATS client connectivity
│ ├── redis/ # Redis client implementation
│ └── utils/ # Common utility functions
├── features/ # Feature modules
│ ├── root/ # Main business feature
│ │ ├── application/ # Business types and DTOs
│ │ ├── business/ # Use cases implementation
│ │ ├── communication/ # Entry points (HTTP, Cron)
│ │ └── infrastructure/ # Redis storage implementation
│ └── side_car/ # Supporting features
│ ├── health/ # Health checks endpoint
│ └── side_car.go # Sidecar configuration
├── docs/ # API documentation
│ ├── docs.go # Swagger annotations
│ ├── swagger.json # OpenAPI specification
│ └── swagger.yaml # Swagger YAML definition
├── main.go # Application entry point
└── test/ # Testing infrastructure
└── unit/
└── specify.go # TestContainer specialization
- Feature-based modular architecture with clear boundaries
- Domain-driven design principles
- Separation of concerns between core, features, and infrastructure
- TestContainer integration for reliable unit testing
- Centralized configuration management
- Message bus integration via NATS
- Caching layer with Redis
- Go 1.25+
- Docker and Docker Compose
- Taskfile (optional)
# Clone repository
git clone <repository-url>
cd <project-name>
# Install dependencies
go mod download# Start all services
task upShared functionality across features:
- Config - Centralized configuration management
- NATS - Message bus client implementation
- Redis - Caching layer client
- Utils - Common utility functions
- Application - Business types and data transfer objects
- Business - Use cases implementation (core business logic)
- Communication - Entry points (HTTP handlers, Cron jobs)
- Infrastructure - Redis-based storage implementation
- Health - Health check endpoints
- Future-ready for metrics and monitoring
Business logic encapsulated in feature-specific Use Cases:
type MatchUseCase interface {
FindMatch(ctx context.Context, criteria MatchCriteria) (*Match, error)
CreateMatch(ctx context.Context, match *entities.Match) error
}# Run all tests
task test
# Run tests with coverage
test:pattern:usecase:cover
# Manual tests
sh scripts/testing/manual-testing.sh- TestContainers for isolated infrastructure testing
- Specialized test configuration in
test/unit/specify.go - Comprehensive feature coverage
- Integration testing with real dependencies
task --list # Show all available tasks
# Development
task up # Run application in development mode
task lint # Run code quality checks
task test:pattern:usecase:cover # Run tests with coverage report- Standardized development workflow
- Consistent commands across team
- Automated quality checks
- Simplified CI/CD integration
Application configuration via environment variables. See .env.example for reference
- Structured JSON logging
- Health checks available at
/health/check - Ready for Prometheus metrics integration
- Future metrics endpoint planned in sidecar feature
# Build and run services
docker-compose up- Notify about creating new matches via NATS
- Advanced monitoring dashboard integration
- Kubernetes deployment manifests
- Enhanced dynamic support for bots search
- Metrics collection and visualization
This project is licensed under the MIT License - see the LICENSE file for details.
Developer Note: All development and deployment tasks are standardized through Taskfile to ensure consistency across environments. The modular feature-based architecture allows for scalable and maintainable codebase evolution.