SGCI is the project where I treated Clean Architecture as non-negotiable. The CLI is only the delivery mechanism — underneath, the domain layer models purchases, stock movements, promotional plans, and cash registers as aggregates with their own invariants. The application layer orchestrates use cases, and infrastructure adapts to whichever storage strategy the business needs.
Architecture highlights
- Hexagonal layering with ports/adapters for persistence
- Use-case classes that take primitive inputs and return DTOs
- Repository interfaces in the domain, implementations in infrastructure
- CLI commands as thin controllers over the application layer
- Transactional workflows that compose multiple aggregates safely
The result is a codebase where every business rule is reachable from a single file, and every delivery adapter can be swapped without touching the domain.
