A Go application following Clean Architecture principles (Uncle Bob's style) with Domain-Driven Design (DDD). This project demonstrates best practices for building maintainable, testable, and scalable Go applications.
This project follows Clean Architecture with clear separation of concerns:
- Domain Layer: Business entities and interfaces (no dependencies)
- Use Case Layer: Application business logic
- Repository Layer: Data persistence implementations
- Delivery Layer: HTTP handlers and routing
# Complete project setup (creates .env, installs deps)
make setup
# Start development server with hot reloading
make dev
# Verify everything works
make test# Start development server
make dev
# Run tests with coverage
make test-coverage
# Build for all platforms
make build
# Format and lint code
make check
# View all available commands
make helpβββ cmd/app/ # Application entry point
βββ internal/ # Private application code
β βββ domain/ # Domain layer (entities, interfaces)
β βββ usecase/ # Use case layer (business logic)
β βββ repository/ # Repository implementations
β βββ delivery/http/ # HTTP delivery layer
βββ pkg/ # Public shared packages
βββ configs/ # Configuration management
βββ test/integration/ # Integration tests
βββ scripts/ # Development scripts
βββ deployments/ # Docker and deployment configs
βββ docs/ # Documentation
# Create .env from template
make env-setup
# Check current environment
make env-check
# Reset .env file (overwrites existing)
make env-resetAPP_NAME=hello-go
ENVIRONMENT=development
DEBUG=true
PORT=8080
HOST=localhostSee docs/ENVIRONMENT.md for complete configuration guide.
# All tests
make test
# Unit tests only
make test-unit
# Integration tests only
make test-integration
# Tests with coverage report
make test-coverage
# Race condition detection
make test-race
# Benchmark tests
make test-bench- Overall Coverage: 95.5%
- Domain Layer: 100%
- Use Case Layer: 100%
- Repository Layer: 100%
- Delivery Layer: 90.4%
The project features enterprise-grade security scanning with 5 security layers:
# Complete security analysis
make securitySecurity Features:
- π‘οΈ Static Analysis - 50+ security patterns via gosec
- π Vulnerability Detection - CVE scanning with govulncheck
- π¦ Dependency Audit - Supply chain security
- π Secret Detection - Prevents credential leaks
- π License Compliance - Legal and security compliance
- Zero Security Issues - All gosec rules passing
- Cryptographically Secure - Uses crypto/rand for ID generation
- No Known Vulnerabilities - Clean vulnerability scan
- Secure Dependencies - All modules verified
- Environment Security - Proper secret management
make security-gosec # Static security analysis
make security-vulncheck # Vulnerability scanning
make security-deps # Dependency security audit
make security-secrets # Secret pattern detection
make security-licenses # License compliance check
make security-report # Generate detailed reportsThe project features a comprehensive .gitignore with 350+ patterns organized into 11 sections:
# Test .gitignore patterns
make gitignore-test
# Validate .gitignore effectiveness
make gitignore-validateKey Features:
- π Security-focused - Prevents credential leaks
- π οΈ Development tools - Covers all major IDEs and tools
- π Cross-platform - Windows, macOS, Linux patterns
- βοΈ Cloud-ready - AWS, GCP, Azure, Terraform patterns
- π Monitoring - Profiling and metrics artifacts
- π³ Containers - Docker and Kubernetes patterns
Categories Covered:
- Go artifacts (binaries, coverage, vendor)
- Development environment (debug, generated files)
- IDE/Editor files (VS Code, JetBrains, Vim, etc.)
- OS files (macOS, Windows, Linux)
- Security files (keys, certificates, secrets)
- Docker and containers
- Cloud deployment artifacts
- Monitoring and profiling data
See docs/GITIGNORE.md for complete documentation.
# Build for current platform
make build-local
# Build for all platforms
make build
# Build for specific platform
make build-linux
make build-darwin
make build-windows# Build Docker image
make docker-build
# Run with Docker Compose
make docker-run
# Production environment
make docker-production
# Stop containers
make docker-down# Format code
make fmt
# Lint code
make lint
# Go vet
make vet
# All quality checks
make check# Comprehensive security analysis
make security
# Individual security scans
make security-gosec # Static security analysis
make security-vulncheck # Vulnerability detection
make security-deps # Dependency audit
make security-secrets # Secret detection
make security-licenses # License compliance
# Security reporting
make security-report # Generate detailed report
make security-install-tools # Install security tools
# Quick vulnerability check
make vuln# Install all development tools
make install-tools
# Tools included:
# - air (hot reloading)
# - golangci-lint (advanced linting)
# - goimports (import formatting)
# - govulncheck (vulnerability scanning)
# - gosec (security analysis)# Full CI pipeline
make ci
# Pre-commit checks
make pre-commit
# Release build
make release- Dependencies:
make deps - Code Quality:
make check - Testing:
make test - Build:
make build
docs/ARCHITECTURE.md- Clean Architecture detailsdocs/TESTING.md- Testing strategy and coveragedocs/SECURITY.md- Comprehensive security guidedocs/ENVIRONMENT.md- Environment configurationdocs/GITIGNORE.md- .gitignore patterns and securitydocs/GO_VERSION_UPGRADE.md- Go version upgrade guidedocs/MAKEFILE.md- Makefile commands referencedocs/API.md- API endpoint documentation
Run make help to see all available commands organized by category:
- Main:
dev,build,test,run - Testing:
test-unit,test-integration,test-coverage - Quality:
lint,fmt,vet,check,security - Repository:
gitignore-test,gitignore-validate - Docker:
docker-build,docker-run,docker-down - Build:
build-local,build-linux,build-darwin,build-windows - Environment:
env-setup,env-check,env-reset - Utility:
clean,deps,info,setup
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Hello World message |
/health |
GET | Health check |
/messages |
GET | Get all messages |
/messages |
POST | Create new message |
See docs/API.md for detailed API documentation.
- Setup:
make setup - Develop:
make dev - Test:
make test - Quality:
make pre-commit - Build:
make build
This project is licensed under the MIT License - see the LICENSE file for details.
- β Clean Architecture with proper dependency inversion
- β Go 1.24.4 with latest language features and performance
- β Comprehensive testing with 95.5% coverage
- β Enterprise security with comprehensive scanning suite
- β Hot reloading for development
- β Multi-platform builds
- β Docker support with production configs
- β Environment management with templates
- β Code quality tools and linting
- β CI/CD ready with complete pipeline
- β Extensive documentation
- β Developer-friendly Makefile with 35+ commands