Each ShopNexus service is organized into clear internal layers so that business logic stays isolated from transport and infrastructure concerns.

Layers

LayerResponsibility
TransportReceives requests (HTTP/gRPC) and translates them into application calls.
ApplicationOrchestrates use cases; coordinates domain objects and external calls.
DomainEncapsulates business rules and invariants. Has no infrastructure dependencies.
InfrastructureImplements persistence, messaging, and third-party integrations.

Dependency direction

Dependencies point inward: outer layers depend on inner layers, never the reverse. The domain layer is the stable core and knows nothing about how it is delivered or stored.
Keeping the domain free of framework and database details makes business rules testable in isolation and resistant to infrastructure churn.