-
Notifications
You must be signed in to change notification settings - Fork 0
[Refactor] With DDD #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the application from a layered architecture to Domain-Driven Design (DDD), splitting functionality into two bounded contexts: auth and user. This represents a significant architectural improvement that better separates concerns and prepares the codebase for potential microservice extraction.
Key Changes:
- Introduced DDD tactical patterns with domain/application/infrastructure/interfaces layers
- Split into
authanduserbounded contexts with separate domain models - Created a shared kernel for common value objects (Email, domain events)
- Implemented CQRS-style separation with UserQueryService and UserCommandService
- Added domain events for cross-context communication (UserRegisteredEvent, UserLoggedInEvent)
Reviewed changes
Copilot reviewed 132 out of 133 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
auth/domain/model/* |
Auth bounded context domain models (AuthUser, RefreshToken, TokenFamily, etc.) |
auth/application/service/* |
Auth application services orchestrating authentication flows |
auth/infrastructure/* |
Persistence adapters, security implementations (JWT, BCrypt) |
auth/interfaces/rest/* |
REST controllers and request/response DTOs for auth endpoints |
user/domain/model/* |
User bounded context domain models (User, UserId, UserName, UserRole) |
user/application/service/* |
User query and command services with CQRS separation |
user/infrastructure/* |
User persistence adapters and auth context integration |
user/interfaces/rest/* |
User and admin user REST controllers |
shared/kernel/* |
Shared value objects (Email), domain events, and exception hierarchy |
infrastructure/* |
Cross-cutting concerns (security filters, config, resolvers) |
test/** |
Comprehensive test structure mirroring the domain organization |
build.gradle.kts |
Updated Jacoco exclusions to match new DDD structure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What
Split into
userandauthdomain using DDD pattern.