Skip to content

Conversation

@nkcoder
Copy link
Owner

@nkcoder nkcoder commented Dec 8, 2025

What

Split into user and auth domain using DDD pattern.

Copilot AI review requested due to automatic review settings December 8, 2025 01:44
Copy link

Copilot AI left a 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 auth and user bounded 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.

@nkcoder nkcoder merged commit 36d8f03 into main Dec 8, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants