Skip to content

Modulith - Internal Activity Service to Abstract External Repository Access#447

Merged
Daggerpov merged 29 commits into
mainfrom
modulith
Feb 8, 2026
Merged

Modulith - Internal Activity Service to Abstract External Repository Access#447
Daggerpov merged 29 commits into
mainfrom
modulith

Conversation

@Daggerpov
Copy link
Copy Markdown
Owner

@Daggerpov Daggerpov commented Dec 23, 2025

Closer to microservices (modular monolith) + Misc. client (mobile) impacting changes for performance, bug fixes, etc.

Instead of outside services like UserService, UserSearchService, UserStatsService, ChatMessageService and from events like ActivityUpdateNotificationEvent, NewCommentNotificationEvent accessing ActivityUserRepository and ActivityRepository directly, this will abstract that.

Mobile-Facing Changes:

  • User friendship DTO made bigger to avoid extra api calls
  • MinimalFriendDTO to reduce memory in some cases where extra details not needed
  • Other Misc. DTO changes n
  • Other users' profile activities returning properly
  • Catching more auth errors surrounding id tokens (to debug Android issue)

@Daggerpov Daggerpov marked this pull request as ready for review December 23, 2025 19:27
- Add @ApplicationScoped to IChatQueryService
- Add @ApplicationScoped to IUserQueryService
- Add @ApplicationScoped to IUserSearchQueryService
- Update service classes to use ApplicationScoped interfaces
- Improves Spring Modulith module boundary definitions
- Move ChatMessage.java to activity.internal.domain
- Move ChatMessageLikes.java to activity.internal.domain
- Move ChatMessageLikesId.java to activity.internal.domain
- Move IChatMessageRepository to activity.internal.repositories
- Move IChatMessageLikesRepository to activity.internal.repositories

Chat messages are intrinsically tied to activities, so they belong in
the activity module. This improves module cohesion and follows Spring
Modulith best practices for shared data ownership.
- Merge all InternalActivityService methods into ActivityService
- Expand IActivityService public API with activity CRUD operations
- Delete IInternalActivityService and InternalActivityService classes
- Simplifies architecture by removing unnecessary layer
- All activity operations now accessible through single service

This consolidation eliminates redundant service layers and provides
a cleaner API surface for other modules to interact with activities.
- Update ChatMessageService to import from activity.internal.domain
- Update ChatMessageMapper with new entity package path
- Update ChatMessageLikesMapper with new entity package path
- Use IActivityService API instead of direct repository access

Follows the entity move to activity module and maintains proper
module boundaries by using the public API where appropriate.
- Update ActivityControllerTests to use consolidated ActivityService
- Update CacheServiceTests with ApplicationScoped interfaces
- Update ChatMessageServiceTests for entity package changes
- Update documentation to reflect Phase 3 completion
- Update README files with latest refactoring status

All tests updated to work with the refactored module structure.
@railway-app railway-app Bot temporarily deployed to Spawn / production January 11, 2026 00:18 Inactive
@railway-app railway-app Bot temporarily deployed to Spawn / production January 11, 2026 00:45 Inactive
@railway-app railway-app Bot temporarily deployed to Spawn / production January 11, 2026 00:45 Inactive
@railway-app railway-app Bot temporarily deployed to Spawn / production January 11, 2026 00:46 Inactive
@railway-app railway-app Bot temporarily deployed to Spawn / production January 11, 2026 01:31 Inactive
@railway-app railway-app Bot temporarily deployed to Spawn / production January 22, 2026 06:26 Inactive
@railway-app railway-app Bot temporarily deployed to Spawn / production January 28, 2026 08:08 Inactive
@railway-app railway-app Bot temporarily deployed to Spawn / production January 28, 2026 08:47 Inactive
@railway-app railway-app Bot temporarily deployed to Spawn / production January 28, 2026 08:55 Inactive
@Daggerpov Daggerpov merged commit 097e8f0 into main Feb 8, 2026
6 checks passed
@Daggerpov Daggerpov deleted the modulith branch February 8, 2026 07:34
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.

1 participant