Chat App
📋 Overview
🏗️ Project Structure
Chat Module Organization
EBusiness.Application/
├── Domain/
│ └── EBusiness.DomainModels/
│ └── Chat/
│ ├── Chat.cs
│ ├── Chat_SeedData.cs
│ ├── Message.cs
│ ├── Message_SeedData.cs
│ ├── ChatParticipant.cs
│ ├── ChatParticipant_SeedData.cs
│ ├── MessageReaction.cs
│ ├── MessageAttachment.cs
│ └── ChatSettings.cs
├── DomainHandler/
│ └── EBusiness.Handlers/
│ ├── CommandHandlers/
│ │ ├── Chat/
│ │ │ ├── CreateChatHandler.cs
│ │ │ ├── SendMessageHandler.cs
│ │ │ ├── AddParticipantHandler.cs
│ │ │ ├── RemoveParticipantHandler.cs
│ │ │ ├── UpdateChatSettingsHandler.cs
│ │ │ ├── ArchiveChatHandler.cs
│ │ │ ├── DeleteChatHandler.cs
│ │ │ ├── CreateGroupChatHandler.cs
│ │ │ ├── InviteToGroupChatHandler.cs
│ │ │ ├── LeaveGroupChatHandler.cs
│ │ │ ├── UpdateGroupChatInfoHandler.cs
│ │ │ └── PromoteToAdminHandler.cs
│ │ ├── Message/
│ │ │ ├── UpdateMessageStatusHandler.cs
│ │ │ ├── AddMessageReactionHandler.cs
│ │ │ ├── RemoveMessageReactionHandler.cs
│ │ │ ├── DeleteMessageHandler.cs
│ │ │ └── EditMessageHandler.cs
│ │ ├── Media/
│ │ │ ├── UploadMediaHandler.cs
│ │ │ ├── DeleteMediaHandler.cs
│ │ │ ├── GenerateThumbnailHandler.cs
│ │ │ ├── ProcessImageHandler.cs
│ │ │ ├── ProcessVideoHandler.cs
│ │ │ ├── ProcessAudioHandler.cs
│ │ │ ├── ProcessFileHandler.cs
│ │ │ ├── GenerateLinkPreviewHandler.cs
│ │ │ └── CompressMediaHandler.cs
│ │ └── RealTime/
│ │ ├── JoinChatHandler.cs
│ │ ├── LeaveChatHandler.cs
│ │ ├── UpdateTypingStatusHandler.cs
│ │ └── UpdateUserOnlineStatusHandler.cs
│ └── Subscribers/
│ ├── Chat/
│ │ ├── NotifyParticipantsOnChatCreated.cs
│ │ ├── NotifyParticipantsOnMessageSent.cs
│ │ ├── NotifyParticipantsOnParticipantAdded.cs
│ │ ├── NotifyParticipantsOnParticipantRemoved.cs
│ │ ├── UpdateChatLastMessageOnMessageSent.cs
│ │ ├── UpdateChatStatisticsOnMessageSent.cs
│ │ ├── NotifyMentionedUsersOnMessageSent.cs
│ │ ├── NotifyGroupChatCreated.cs
│ │ ├── NotifyGroupChatInvitation.cs
│ │ └── NotifyGroupChatLeft.cs
│ ├── Message/
│ │ ├── SendPushNotificationOnMessageSent.cs
│ │ ├── UpdateMessageDeliveryStatus.cs
│ │ ├── UpdateMessageReadStatus.cs
│ │ ├── ProcessMessageAnalytics.cs
│ │ └── ArchiveOldMessages.cs
│ ├── Media/
│ │ ├── ProcessMediaUpload.cs
│ │ ├── GenerateMediaThumbnail.cs
│ │ ├── CleanupUnusedMedia.cs
│ │ ├── ProcessImageUpload.cs
│ │ ├── ProcessVideoUpload.cs
│ │ ├── ProcessAudioUpload.cs
│ │ ├── ProcessFileUpload.cs
│ │ ├── GenerateLinkPreview.cs
│ │ ├── CompressMediaFiles.cs
│ │ └── ScanMediaForViruses.cs
│ └── RealTime/
│ ├── UpdateUserOnlineStatus.cs
│ ├── BroadcastTypingStatus.cs
│ ├── UpdateChatPresence.cs
│ └── ProcessRealTimeEvents.cs
├── ControlContracts/
│ └── EBusiness.DTOs/
│ ├── DomainDtos/
│ │ ├── Chat/
│ │ │ ├── ChatDto.cs
│ │ │ └── ChatDtoDtoWithId.cs
│ │ ├── Message/
│ │ │ ├── MessageDto.cs
│ │ │ └── MessageDtoDtoWithId.cs
│ │ ├── ChatParticipant/
│ │ │ ├── ChatParticipantDto.cs
│ │ │ └── ChatParticipantDtoDtoWithId.cs
│ │ └── MessageReaction/
│ │ ├── MessageReactionDto.cs
│ │ └── MessageReactionDtoDtoWithId.cs
│ └── FeatureDtos/
│ ├── Chat/
│ │ ├── Input/
│ │ │ ├── CreateChat/
│ │ │ │ └── CreateChatDto.cs
│ │ │ ├── SendMessage/
│ │ │ │ └── SendMessageDto.cs
│ │ │ ├── AddParticipant/
│ │ │ │ └── AddParticipantDto.cs
│ │ │ └── UpdateChatSettings/
│ │ │ └── UpdateChatSettingsDto.cs
│ │ └── Output/
│ │ ├── GetChatMessages/
│ │ │ └── GetChatMessagesDto.cs
│ │ ├── GetUserChats/
│ │ │ └── GetUserChatsDto.cs
│ │ └── GetChatParticipants/
│ │ └── GetChatParticipantsDto.cs
│ └── Message/
│ ├── Input/
│ │ ├── UpdateMessageStatus/
│ │ │ └── UpdateMessageStatusDto.cs
│ │ ├── AddMessageReaction/
│ │ │ └── AddMessageReactionDto.cs
│ │ └── EditMessage/
│ │ └── EditMessageDto.cs
│ └── Output/
│ └── GetMessageHistory/
│ └── GetMessageHistoryDto.cs
└── Infrastructure/
└── EventHandlers/
├── IHybridEventService.cs
├── HybridEventService.cs
├── RedisStreamProcessor.cs
└── ChatSignalRHub.cs
EBusiness.Framework/
└── EventHandlers/
├── ChatEventHandlers/
│ ├── ChatCreatedEventHandler.cs
│ ├── MessageSentEventHandler.cs
│ ├── UserOnlineEventHandler.cs
│ └── TypingStatusChangedEventHandler.cs
└── BackgroundProcessors/
├── MessageArchivalProcessor.cs
├── MediaCleanupProcessor.cs
└── AnalyticsProcessor.cs🎯 Domain Models Implementation
1. Chat Domain Model
2. Message Domain Model
🎯 Command Handlers Implementation
1. Chat Command Handlers
CreateChatHandler (SRP: Chat Creation)
SendMessageHandler (SRP: Message Sending)
2. Group Chat Command Handlers
CreateGroupChatHandler (SRP: Group Chat Creation)
InviteToGroupChatHandler (SRP: Group Chat Invitations)
3. Media Command Handlers
UploadMediaHandler (SRP: Media Upload)
GenerateLinkPreviewHandler (SRP: Link Preview Generation)
4. Message Command Handlers
UpdateMessageStatusHandler (SRP: Status Updates)
📡 Event Subscribers Implementation
1. Chat Event Subscribers
NotifyParticipantsOnChatCreated (SRP: Participant Notifications)
UpdateChatLastMessageOnMessageSent (SRP: Chat Metadata Updates)
2. @ Mentions Event Subscribers
NotifyMentionedUsersOnMessageSent (SRP: @ Mentions Notifications)
3. Message Event Subscribers
SendPushNotificationOnMessageSent (SRP: Push Notifications)
ProcessMessageAnalytics (SRP: Analytics Processing)
🔧 Infrastructure Implementation
1. Hybrid Event Service
2. Chat SignalR Hub
🎯 DTOs Implementation
1. Domain DTOs
2. Feature DTOs
2. Group Chat Feature DTOs
3. Media Feature DTOs
Last updated