A template repository for building Go applications with the zoobzio framework.
Sumatra provides a production-ready project structure built on sum, following patterns established in real-world applications. It includes:
- Type-safe service registry via sum
- HTTP server with OpenAPI support via rocco
- Database access patterns via grub/astql
- Configuration management via fig
- Event system via capitan
- Comprehensive testing infrastructure
sumatra/
├── cmd/app/ # Application entrypoint
├── config/ # Configuration types
├── contracts/ # Interface definitions
├── models/ # Domain models
├── stores/ # Data access implementations
├── handlers/ # HTTP handlers
├── wire/ # Request/response types
├── transformers/ # Model ↔ Wire mapping
├── events/ # Event definitions
├── testing/ # Test infrastructure
├── internal/otel/ # OpenTelemetry setup
├── migrations/ # SQL migrations
└── .github/workflows # CI/CD
Each directory contains a README explaining its purpose and usage patterns.
# Install dependencies
go mod tidy
# Run the application
make run
# Run tests
make test
# Run linter
make lint
# Full CI check
make check- Go 1.24+
- golangci-lint v2.7.2
make install-tools
make install-hooks| Command | Description |
|---|---|
make build |
Build the application binary |
make run |
Run the application |
make test |
Run all tests with race detector |
make test-unit |
Run unit tests only |
make test-integration |
Run integration tests |
make test-bench |
Run benchmarks |
make lint |
Run linters |
make coverage |
Generate coverage report |
make check |
Run tests + lint |
make ci |
Full CI simulation |
The application follows a layered architecture with clear dependency rules:
- contracts - Define interfaces, depend only on models
- models - Domain models, no internal dependencies
- stores - Implement contracts, depend on models
- handlers - HTTP layer, depend on contracts/wire/transformers
- wire - API types, depend on models (for transformation)
- transformers - Pure mapping functions between models and wire
MIT