Drahten

Private History Service Project Structure

The project is divided into four main layers:

This structured approach ensures a clear separation of concerns, making the codebase easier to manage and extend. Below is an outline of the project’s directory structure:

------------------------------------------------------------------
PrivateHistoryService
β”œβ”€β”€ src πŸ“¦
β”‚   β”œβ”€β”€ PrivateHistoryService.Domain πŸ“‚
β”‚   β”‚   β”œβ”€β”€ Entities πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ _README.txt
β”‚   β”‚   β”‚   β”œβ”€β”€ AggregateRoot.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ User.cs
----------------------------
β”‚   β”‚   β”œβ”€β”€ Events πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ _README.txt 
β”‚   β”‚   β”‚   β”œβ”€β”€ CommentedArticleAdded.cs 
β”‚   β”‚   β”‚   β”œβ”€β”€ CommentedArticleRemoved.cs 
β”‚   β”‚   β”‚   β”œβ”€β”€ DislikedArticleAdded.cs 
β”‚   β”‚   β”‚   β”œβ”€β”€ DislikedArticleCommentAdded.cs 
β”‚   β”‚   β”‚   β”œβ”€β”€ IDomainEvent.cs 
β”‚   β”‚   β”‚   β”œβ”€β”€ LikedArticleAdded.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ LikedArticleCommentAdded.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ SearchedArticleDataAdded.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ SearchedArticleDataRemoved.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ SearchedTopicDataAdded.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ SearchedTopicDataRemoved.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ TopicSubscriptionAdded.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ TopicSubscriptionRemoved.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ UserRetentionUntilAdded.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ ViewedArticleAdded.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ ViewedArticleRemoved.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ ViewedUserAdded.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ ViewedUserRemoved.cs
----------------------------
β”‚   β”‚   β”œβ”€β”€ Exceptions πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ _README.txt 
β”‚   β”‚   β”‚   β”œβ”€β”€ <<CustomDomainLayerExceptions>>
----------------------------
β”‚   β”‚   β”œβ”€β”€ Factories πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ Interfaces πŸ“‚
β”‚   β”‚   β”‚   |   β”œβ”€β”€ IUserFactory.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ _README.txt 
β”‚   β”‚   β”‚   β”œβ”€β”€ UserFactory.cs
----------------------------
β”‚   β”‚   β”œβ”€β”€ Repositories πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ _README.txt 
β”‚   β”‚   β”‚   β”œβ”€β”€ IUserRepository.cs
----------------------------
β”‚   β”‚   β”œβ”€β”€ ValueObjects πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ _README.txt 
β”‚   β”‚   β”‚   β”œβ”€β”€ ArticleComment.cs 
β”‚   β”‚   β”‚   β”œβ”€β”€ ArticleCommentID.cs 
β”‚   β”‚   β”‚   β”œβ”€β”€ ArticleID.cs 
β”‚   β”‚   β”‚   β”œβ”€β”€ CommentedArticle.cs 
β”‚   β”‚   β”‚   β”œβ”€β”€ DislikedArticle.cs 
β”‚   β”‚   β”‚   β”œβ”€β”€ DislikedArticleComment.cs 
β”‚   β”‚   β”‚   β”œβ”€β”€ LikedArticle.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ LikedArticleComment.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ SearchedArticleData.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ SearchedData.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ SearchedDataAnswer.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ SearchedDataAnswerContext.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ SearchedTopicData.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ TopicID.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ TopicSubscription.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ UserID.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ UserRetentionUntil.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ ViewedArticle.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ ViewedUser.cs
----------------------------
β”‚   β”œβ”€β”€ PrivateHistoryService.Application πŸ“‚
β”‚   β”‚   β”œβ”€β”€ Commands πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ Dispatcher πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ _README.txt 
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ICommandDispatcher.cs 
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ InMemoryCommandDispatcher.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ Handlers πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ _README.txt 
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddCommentedArticleHandler.cs 
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddDislikedArticleCommentHandler.cs 
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddDislikedArticleHandler.cs 
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddLikedArticleCommentHandler.cs 
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddLikedArticleHandler.cs 
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddSearchedArticleDataHandler.cs 
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddSearchedTopicDataHandler.cs 
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddTopicSubscriptionHandler.cs 
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddUserHandler.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddViewedArticleHandler.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddViewedUserHandler.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ICommandHandler.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ RemoveCommentedArticleHandler.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ RemoveSearchedArticleDataHandler.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ RemoveSearchedTopicDataHandler.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ RemoveTopicSubscriptionHandler.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ RemoveViewedArticleHandler.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ RemoveViewedUserHandler.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SetUserRetentionDateTimeHandler.cs
β”‚   β”‚   |   β”œβ”€β”€ _README.txt 
β”‚   β”‚   |   β”œβ”€β”€ AddCommentedArticleCommand.cs 
β”‚   β”‚   |   β”œβ”€β”€ AddDislikedArticleCommand.cs 
β”‚   β”‚   |   β”œβ”€β”€ AddDislikedArticleCommentCommand.cs 
β”‚   β”‚   |   β”œβ”€β”€ AddLikedArticleCommand.cs 
β”‚   β”‚   |   β”œβ”€β”€ AddLikedArticleCommentCommand.cs 
β”‚   β”‚   |   β”œβ”€β”€ AddSearchedArticleDataCommand.cs 
β”‚   β”‚   |   β”œβ”€β”€ AddSearchedTopicDataCommand.cs 
β”‚   β”‚   |   β”œβ”€β”€ AddTopicSubscriptionCommand.cs 
β”‚   β”‚   |   β”œβ”€β”€ AddUserCommand.cs
β”‚   β”‚   |   β”œβ”€β”€ AddViewedArticleCommand.cs
β”‚   β”‚   |   β”œβ”€β”€ AddViewedUserCommand.cs
β”‚   β”‚   |   β”œβ”€β”€ ICommand.cs
β”‚   β”‚   |   β”œβ”€β”€ RemoveCommentedArticleCommand.cs
β”‚   β”‚   |   β”œβ”€β”€ RemoveSearchedArticleDataCommand.cs
β”‚   β”‚   |   β”œβ”€β”€ RemoveSearchedTopicDataCommand.cs
β”‚   β”‚   |   β”œβ”€β”€ RemoveTopicSubscriptionCommand.cs
β”‚   β”‚   |   β”œβ”€β”€ RemoveViewedArticleCommand.cs
β”‚   β”‚   |   β”œβ”€β”€ RemoveViewedUserCommand.cs
β”‚   β”‚   |   β”œβ”€β”€ SetUserRetentionDateTimeCommand.cs
----------------------------
β”‚   β”‚   β”œβ”€β”€ Dtos πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ _README.txt 
β”‚   β”‚   β”‚   β”œβ”€β”€ CommentedArticleDto.cs 
β”‚   β”‚   β”‚   β”œβ”€β”€ DislikedArticleCommentDto.cs 
β”‚   β”‚   β”‚   β”œβ”€β”€ DislikedArticleDto.cs 
β”‚   β”‚   β”‚   β”œβ”€β”€ LikedArticleCommentDto.cs 
β”‚   β”‚   β”‚   β”œβ”€β”€ LikedArticleDto.cs 
β”‚   β”‚   β”‚   β”œβ”€β”€ SearchedArticleDataDto.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ SearchedTopicDataDto.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ TopicSubscriptionDto.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ ViewedArticleDto.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ ViewedUserDto.cs
----------------------------
β”‚   β”‚   β”œβ”€β”€ Exceptions πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ _README.txt 
β”‚   β”‚   β”‚   β”œβ”€β”€ <<CustomApplicationLayerExceptions>>
----------------------------
β”‚   β”‚   β”œβ”€β”€ Extensions πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ DateTimeOffsetExtensions.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ ServiceCollectionExtensions.cs
----------------------------
β”‚   β”‚   β”œβ”€β”€ Queries πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ Dispatcher πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ InMemoryQueryDispatcher.cs 
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ IQueryDispatcher.cs
β”‚   β”‚   |   β”œβ”€β”€ Handlers πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ IQueryHandler.cs 
β”‚   β”‚   |   β”œβ”€β”€ _README.txt 
β”‚   β”‚   |   β”œβ”€β”€ GetArticleCommentDislikesQuery.cs 
β”‚   β”‚   |   β”œβ”€β”€ GetArticleCommentLikesQuery.cs 
β”‚   β”‚   |   β”œβ”€β”€ GetArticleDislikesQuery.cs 
β”‚   β”‚   |   β”œβ”€β”€ GetArticleLikesQuery.cs 
β”‚   β”‚   |   β”œβ”€β”€ GetCommentedArticlesQuery.cs 
β”‚   β”‚   |   β”œβ”€β”€ GetSearchedArticlesDataQuery.cs
β”‚   β”‚   |   β”œβ”€β”€ GetSearchedTopicsDataQuery.cs
β”‚   β”‚   |   β”œβ”€β”€ GetTopicSubscriptionsQuery.cs
β”‚   β”‚   |   β”œβ”€β”€ GetViewedArticlesQuery.cs
β”‚   β”‚   |   β”œβ”€β”€ GeViewedUsersQuery.cs
β”‚   β”‚   |   β”œβ”€β”€ IQuery.cs
----------------------------
β”‚   β”‚   β”œβ”€β”€ Services πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ ReadServices πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ICommentedArticleReadService.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ISearchedArticleDataReadService.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ISearchedTopicDataReadService.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ IUserReadService.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ IViewedArticleReadService.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ IViewedUserReadService.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ WriteServices πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ICommentedArticleWriteService.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ IDislikedArticleCommentWriteService.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ IDislikedArticleWriteService.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ILikedArticleCommentWriteService.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ILikedArticleWriteService.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ISearchedArticleDataWriteService.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ITopicSubscriptionWriteService.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ IUserWriteService.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ IViewedArticleWriteService.cs
β”‚   β”‚   |   β”œβ”€β”€ _README.txt
----------------------------
β”‚   β”œβ”€β”€ PrivateHistoryService.Infrastructure πŸ“‚
β”‚   β”‚   β”œβ”€β”€ AsyncDataServices πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ MessageBusSubscriber.cs
----------------------------
β”‚   β”‚   β”œβ”€β”€ Automapper πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ Profiles πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ _README.txt
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ CommentedArticleProfile.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ DislikedArticleCommentProfile.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ DislikedArticleProfile.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LikedArticleCommentProfile.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LikedArticleProfile.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SearchedArticleDataProfile.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SearchedTopicDataProfile.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ TopicSubscriptionProfile.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ViewedArticleProfile.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ViewedUserProfile.cs
----------------------------
β”‚   β”‚   β”œβ”€β”€ Dtos πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ MessageBusEventDto.cs
----------------------------
β”‚   β”‚   β”œβ”€β”€ EntityFramework πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ Contexts πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ _README.txt
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ReadDbContext.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ WriteDbContext.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ Encryption πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ EncryptionConverters πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ EncryptedArticleCommentConverter.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ EncryptedDateTimeOffsetConverter.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ EncryptedSearchedDataAnswerContextConverter.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ EncryptedSearchedDataAnswerConverter.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ EncryptedSearchedDataConverter.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ EncryptedStringConverter.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ EncryptedUserRetentionUntilConverter.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ EncryptionProvider πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ IEncryptionProvider.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ EncryptionProvider.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ Initialization πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ _README.txt
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ DbInitializer.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ Migrations πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ <<EntityFramework database migrations>>
β”‚   β”‚   β”‚   β”œβ”€β”€ ModelConfiguration πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ReadConfiguration πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ CommentedArticleConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ DislikedArticleCommentConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ DislikedArticleConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LikedArticleCommentConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LikedArticleConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SearchedArticleDataConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SearchedTopicDataConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ TopicSubscriptionConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ UserConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ViewedArticleConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ViewedUserConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ WriteConfiguration πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ CommentedArticleConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ DislikedArticleCommentConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ DislikedArticleConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LikedArticleCommentConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LikedArticleConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SearchedArticleDataConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SearchedTopicDataConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ TopicSubscriptionConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ UserConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ViewedArticleConfiguration.cs
β”‚   β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ViewedUserConfiguration.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ Models πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ CommentedArticleReadModel.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ DislikedArticleCommentReadModel.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ DislikedArticleReadModel.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LikedArticleCommentReadModel.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ LikedArticleReadModel.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SearchedArticleDataReadModel.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SearchedTopicDataReadModel.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ TopicSubscriptionReadModel.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ UserReadModel.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ViewedArticleReadModel.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ViewedUserReadModel.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ Options πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ PostgresOptions.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ Repositories πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ PostgresUserRepository.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ Services πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ReadServices πŸ“‚
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ PostgresCommentedArticleReadService.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ PostgresSearchedArticleDataReadService.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ PostgresSearchedTopicDataReadService.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ PostgresUserReadService.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ PostgresViewedArticleReadService.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ PostgresViewedUserReadService.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ WriteServices πŸ“‚
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ PostgresCommentedArticleWriteService.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ PostgresDislikedArticleCommentWriteService.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ PostgresDislikedArticleWriteService.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ PostgresLikedArticleCommentWriteService.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ PostgresLikedArticleWriteService.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ PostgresSearchedArticleDataWriteService.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ PostgresTopicSubscriptionWriteService.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ PostgresUserWriteService.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ PostgresViewedArticleWriteService.cs
----------------------------
β”‚   β”‚   β”œβ”€β”€ EventProcessing πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ EventProcessor.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ IEventProcessor.cs
----------------------------
β”‚   β”‚   β”œβ”€β”€ Exceptions πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ Interfaces πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ IExceptionToResponseMapper.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ ExceptionResponse.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ ExceptionToResponseMapper.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ InfrastructureException.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ NullDbContextException.cs
----------------------------
β”‚   β”‚   β”œβ”€β”€ Extensions πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ ConfigurationExtensions.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ ServiceCollectionExtensions.cs
----------------------------
β”‚   β”‚   β”œβ”€β”€ Logging πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ Formatters πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ SerilogJsonFormatter.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ LoggingCommandHandlerDecorator.cs
----------------------------
β”‚   β”‚   β”œβ”€β”€ Queries πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ Handlers πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ GetArticleCommentDislikesHandler.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ GetArticleCommentLikesHandler.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ GetArticleDislikesHandler.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ GetArticleLikesHandler.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ GetCommentedArticlesHandler.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ GetSearchedArticlesDataHandler.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ GetSearchedTopicsDataHandler.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ GetTopicSubscriptionsHandler.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ GetViewedArticlesHandler.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ GeViewedUsersHandler.cs
----------------------------
β”‚   β”‚   β”œβ”€β”€ Schedulers πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ RetentionJob.cs
----------------------------
β”‚   β”œβ”€β”€ PrivateHistoryService.Presentation πŸ“‚
β”‚   β”‚   β”œβ”€β”€ Properties πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ launchSettings.json
β”‚   β”‚   β”œβ”€β”€ Controllers πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ UserController.cs
β”‚   β”‚   β”œβ”€β”€ Dtos πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ ResponseDto.cs
β”‚   β”‚   β”œβ”€β”€ Middlewares πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ ErrorHandlerMiddleware.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ RateLimitingMiddleware.cs
β”‚   β”‚   β”œβ”€β”€ appsettings.json
β”‚   β”‚   β”œβ”€β”€ Program.cs
----------------------------
β”œβ”€β”€ tests πŸ§ͺ
β”‚   β”œβ”€β”€ PrivateHistoryService.Tests.EndToEnd
β”‚   β”‚   β”œβ”€β”€ Extensions πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ ServiceCollectionExtensions.cs
β”‚   β”‚   β”œβ”€β”€ Factories πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ PrivateHistoryServiceApplicationFactory.cs
β”‚   β”‚   β”œβ”€β”€ Sync πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ AddCommentedArticleTests.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ AddDislikedArticleCommentTests.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ AddDislikedArticleTests.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ AddLikedArticleCommentTests.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ AddLikedArticleTests.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ AddSearchedArticleDataTests.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ AddSearchedTopicDataTests.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ AddTopicSubscriptionTests.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ AddViewedArticleTests.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ AddViewedUserTests.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ BaseSyncIntegrationTest.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ RegisterUserTests.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ RemoveCommentedArticleTests.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ RemoveSearchedArticleDataTests.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ RemoveSearchedTopicDataTests.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ RemoveTopicSubscriptionTests.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ RemoveViewedArticleTests.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ RemoveViewedUserTests.cs
----------------------------
β”‚   β”œβ”€β”€ PrivateHistoryService.Tests.Unit
β”‚   β”‚   β”œβ”€β”€ Application πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ Handlers πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddCommentedArticleHandlerTests.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddDislikedArticleCommentHandlerTests.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddDislikedArticleHandlerTests.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddLikedArticleCommentHandlerTests.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddLikedArticleHandlerTests.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddSearchedArticleDataHandlerTests.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddSearchedTopicDataHandlerTests.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddTopicSubscriptionHandlerTests.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddViewedArticleHandlerTests.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ AddViewedUserHandlerTests.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ RemoveCommentedArticleHandlerTests.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ RemoveSearchedArticleDataHandlerTests.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ RemoveSearchedTopicDataHandlerTests.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ RemoveTopicSubscriptionHandlerTests.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ RemoveViewedArticleHandlerTests.cs
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ RemoveViewedUserHandlerTests.cs
β”‚   β”‚   β”œβ”€β”€ Domain πŸ“‚
β”‚   β”‚   β”‚   β”œβ”€β”€ Entities πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ UserTests πŸ“‚
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ AddCommentedArticle.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ AddDislikedArticle.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ AddDislikedArticleComment.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ AddLikedArticle.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ AddLikedArticleComment.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ AddSearchedArticleData.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ AddSearchedTopicData.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ AddTopicSubscription.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ AddTopicSubscription.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ AddViewedArticle.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ AddViewedUser.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ RemoveCommentedArticle.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ RemovedSearchedArticleData.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ RemoveSearchedTopicData.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ RemoveTopicSubscription.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ RemoveViewedArticle.cs
β”‚   β”‚   β”‚   β”‚   |   β”œβ”€β”€ RemoveViewedUser.cs
β”‚   β”‚   β”‚   β”œβ”€β”€ Factories πŸ“‚
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ UserFactoryTests.cs
------------------------------------------------------------------

Directory/File Descriptions

Layer Directory/File Description
Domain PrivateHistoryService/src/PrivateHistoryService.Domain/Entities/ Contains domain entities representing core business concepts.
Domain PrivateHistoryService/src/PrivateHistoryService.Domain/Events/ Includes domain events capturing significant changes or actions.
Domain PrivateHistoryService/src/PrivateHistoryService.Domain/Exceptions/ Houses custom exceptions specific to domain logic.
Domain PrivateHistoryService/src/PrivateHistoryService.Domain/Factories/ Provides factories for creating domain entities.
Domain PrivateHistoryService/src/PrivateHistoryService.Domain/Repositories/ Defines interfaces or base classes for data access operations.
Domain PrivateHistoryService/src/PrivateHistoryService.Domain/ValueObjects/ Contains immutable value objects used within the domain.
Application PrivateHistoryService/src/PrivateHistoryService.Application/Commands/ Contains command types and serves as the central location for defining and organizing commands.
Application PrivateHistoryService/src/PrivateHistoryService.Application/Commands/Dispatcher/ Contains command dispatcher type and serves as the central component responsible for
routing commands to their respective command handlers. Β  Β 
Application PrivateHistoryService/src/PrivateHistoryService.Application/Commands/Handlers/ Contains command handler types that implement ICommandHandler interface and plays a crucial role in implementing
Command Query Responsibility Segregation (CQRS). Β  Β 
Application PrivateHistoryService/src/PrivateHistoryService.Application/Dtos/ Contains Data Transfer Objects (DTOs).
Application PrivateHistoryService/src/PrivateHistoryService.Application/Exceptions/ Contains Application layer specific custom exception types.
Application PrivateHistoryService/src/PrivateHistoryService.Application/Extensions/ Contains custom extension methods.
Application PrivateHistoryService/src/PrivateHistoryService.Application/Queries/ Contains query types and serves as the central location for defining and organizing queries.
Application PrivateHistoryService/src/PrivateHistoryService.Application/Queries/Dispatcher/ Contains query dispatcher type that implements IQueryDispatcher interface and serves as the central component responsible for
routing queries to their respective query handlers for execution and data retrieval. Β  Β 
Application PrivateHistoryService/src/PrivateHistoryService.Application/Queries/Handlers/ Contains the definition of the IQueryHandler<TQuery, TResult> interface, which serves as a contract for all query handlers
responsible for executing queries and retrieving data from the application’s read-side or queryable data sources. Β  Β 
Application PrivateHistoryService/src/PrivateHistoryService.Application/Services/ Implements application services containing business logic.
Infrastructure PrivateHistoryService/src/PrivateHistoryService.Infrastructure/AsyncDataServices/ Defines implementations of interfaces for asynchronous operations.
Infrastructure PrivateHistoryService/src/PrivateHistoryService.Infrastructure/Automapper/ Contains types, that are inheriting the Profile type from AutoMapper library.
Infrastructure PrivateHistoryService/src/PrivateHistoryService.Infrastructure/Dtos/ Contains Data Transfer Objects (DTOs).
Infrastructure PrivateHistoryService/src/PrivateHistoryService.Infrastructure/EntityFramework/Contexts/ Contains two EntityFramework DbContext classes - ReadDbContext and WriteDbContext.
Infrastructure PrivateHistoryService/src/PrivateHistoryService.Infrastructure/EntityFramework/Encryption/ Contains custom EntityFramework encryption converters and encryption provider.
Infrastructure PrivateHistoryService/src/PrivateHistoryService.Infrastructure/EntityFramework/Initialization/ Contains DbInitializer class that applies entity framework migrations.
Infrastructure PrivateHistoryService/src/PrivateHistoryService.Infrastructure/EntityFramework/Migrations/ Contains EntityFramework migrations.
Infrastructure PrivateHistoryService/src/PrivateHistoryService.Infrastructure/EntityFramework/ModelConfiguration/ReadConfiguration/ Contains classes that implement IEntityTypeConfiguration and are containing configuration for the database models.
Infrastructure PrivateHistoryService/src/PrivateHistoryService.Infrastructure/EntityFramework/ModelConfiguration/WriteConfiguration/ Contains classes that implement IEntityTypeConfiguration and are containing configuration for DOMAIN entities and value objects.
Infrastructure PrivateHistoryService/src/PrivateHistoryService.Infrastructure/EntityFramework/Models/ Contains classes for the database models that represent the database tables and the overall database schema.
Infrastructure PrivateHistoryService/src/PrivateHistoryService.Infrastructure/EntityFramework/Options/ Contains class that is used for the OPTIONS pattern.
Infrastructure PrivateHistoryService/src/PrivateHistoryService.Infrastructure/EntityFramework/Repositories/ Contains implementations of interfaces for data access operations.
Infrastructure PrivateHistoryService/src/PrivateHistoryService.Infrastructure/EntityFramework/Services/ Contains implementations of interfaces for services containing business logic.
Infrastructure PrivateHistoryService/src/PrivateHistoryService.Infrastructure/EventProcessing/ Contains class that is responsible for processing event’s that are received from outside the application.
Infrastructure PrivateHistoryService/src/PrivateHistoryService.Infrastructure/Exceptions/ Contains Infrastructure layer specific custom exception types.
Infrastructure PrivateHistoryService/src/PrivateHistoryService.Infrastructure/Extensions/ Contains custom extension methods.
Infrastructure PrivateHistoryService/src/PrivateHistoryService.Infrastructure/Logging/ Contains logging decorators and formatters. The purpose of the decorators is to wrap the behaviour of a Command Handler or other part of the application and to enrich it’s capabilities with the ability to log information.
Infrastructure PrivateHistoryService/src/PrivateHistoryService.Infrastructure/Queries/ Contains query handlers that work with the queries from the Command Query Responsibility Segregation (CQRS) approach.
Infrastructure PrivateHistoryService/src/PrivateHistoryService.Infrastructure/Schedulers/ Contains classes that represent schedulers for various activities.
Presentation PrivateHistoryService/src/PrivateHistoryService.Presentation/Properties/ Contains the application properties related to port and protocol configuration.
Presentation PrivateHistoryService/src/PrivateHistoryService.Presentation/Controllers/ Contains API controllers handling HTTP requests and responses.
Presentation PrivateHistoryService/src/PrivateHistoryService.Presentation/DTOs/ Provides Data Transfer Objects (DTOs) for API input and output.
Presentation PrivateHistoryService/src/PrivateHistoryService.Presentation/Middlewares/ Contains custom middlewares.