Public Access
Refactor package structure: domain -> modules
Move domain packages into a new modules.* hierarchy and rename controller packages to api.* across login, registration, and user modules. Update package declarations and imports (including shared.api DTOs and JwtService -> modules login TokenGenerator), adjust tests and persistence/mapper paths accordingly, and apply minor formatting fixes (missing EOF newlines). This reorganizes the project to better separate API surface and module boundaries.
This commit is contained in:
1 parent
815347325a
commit
fd390ac072
73 files changed
+574
-569
No files matched your search
@@ -19,20 +19,20 @@ The project strictly follows a Domain-Driven / Clean Architecture (Ports & Adapt
|
||||
|
||||
### Layer Breakdown
|
||||
|
||||
1. **Controller / Web Layer (`controller`)**
|
||||
1. **API / Web Layer (`api`)**
|
||||
* Contains REST endpoints, DTOs (`Request`/`Response` records), and Global Exception Handlers.
|
||||
* Uses `ApiMapper` to map between DTOs and Domain Models.
|
||||
* **Rule:** This layer delegates to the Service layer and never accesses persistence directly.
|
||||
|
||||
2. **Domain / Core Layer (`model`, `service`, `exception`)**
|
||||
2. **Business / Core Layer (`model`, `service`, `exception`)**
|
||||
* The heart of the application. Contains pure Java classes (Models) and Business Logic (Services).
|
||||
* Throws specific business exceptions (e.g., `InvalidCredentialsException`).
|
||||
* **Rule:** This layer has **no dependencies** on the Controller or Persistence layer. It defines interfaces that the persistence layer must implement.
|
||||
* **Rule:** This layer has **no dependencies** on the API or Persistence layer. It defines interfaces that the persistence layer must implement.
|
||||
|
||||
3. **Persistence Layer (`persistence`)**
|
||||
* Handles database operations. Contains JPA Entities (`UserEntity`), Spring Data Repositories, and the `EntityMapper`.
|
||||
* Implements the interfaces defined in the Domain layer.
|
||||
* **Rule:** Entities never leak into the Controller layer.
|
||||
* **Rule:** Entities never leak into the API layer.
|
||||
|
||||
*Note: Future implementations will include ArchUnit tests to automatically enforce these architectural boundaries during the CI pipeline.*
|
||||
|
||||
|
||||
Reference in new issue
Block a user