This project is organized using a hybrid structure combining technical partitioning and domain-driven partitioning, adhering to a layered architectural style. Each folder has a clear responsibility, either grouped by technical concern (e.g., configuration, security) or by business/domain logic (e.g., features, entities).
Folder | Description | Partition Type | Layer |
---|---|---|---|
common/ |
Contains common utilities like enums, converters, and constants. | Technical Partition | Shared Utility Layer |
entity/ |
Houses core domain master entity, typically reused across entities. | Domain Partition | Domain Layer |
jpa/ |
Custom JPA configuration such as naming strategies. | Technical Partition | Infrastructure Layer |
storage/ |
Implements storage-specific services (e.g., file storage). | Technical Partition | Infrastructure Layer |
config/ |
Spring and general configuration beans (e.g., ModelMapper ). |
Technical Partition | Configuration Layer |
exceptions/ |
Custom exception classes and exception handling utilities. | Technical Partition | Shared/Service Layer |
response/ |
Standardized response DTOs and utilities (e.g., API response wrappers). | Technical Partition | Presentation Layer |
features/ |
Contains business-specific logic grouped by feature/domain (e.g., User, Restaurant, etc.). | Domain Partition | Application/Domain Layer |
model/ |
JPA entities used within the database mapping. | Domain Partition | Persistence Layer |
security/ |
Security configuration (e.g., JWT, filters). | Technical Partition | Infrastructure Layer |
startup/ |
Initialization logic (e.g., seed roles or default users using CommandLineRunner ). |
Technical Partition | Bootstrap/Init Layer |
Groups code by technical responsibility.
Groups code by business domains or features.
The architecture generally follows this layer stack:
Presentation Layer
└── response/
└── controller classes inside features/
Application Layer
└── services inside features/
└── startup/ (business initialization logic)
Domain Layer
└── entity/
└── model/
└── common/ (enums, value objects, etc.)
Persistence/Infrastructure Layer
└── jpa/
└── storage/
└── config/
└── security/
Shared/Utility Layer
└── exceptions/
└── common/
Each feature/
sub-folder may itself follow mini-layered separation:
controller/
(Presentation)service/
(Application)repository/
(Persistence)dto/
(Transport)