Skip to content

TreeOfAKind/TreeOfAKind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tree Of A Kind

Tree Of A Kind is a multi-platform system supporting the creation of a family tree.

CQRS, DDD, Clean architecture, EF, Azure, Pub-Sub

Video presentation

Physical architecture

Backend architecture

Modules of application are separated. It allows to maintain low coupling, and as a result, allows easy testing and swapping (eg. swapping database or ORM), because the business layer is fully independent of implementation. image

We are using the MediatR library to separate API from the Application layer. Requests are segregated into two types: commands and queries, this allows for separation of the read and write model. Both types are handled by corresponding handlers.

In the application layer pipeline, commands and queries are validated and checked for authorization. Validators and authorizers are injected by DI container which finds them during application startup by assembly scanning.

using FluentValidation;

namespace TreeOfAKind.Application.Command.Trees.TreeAdministration.AddTreeOwner
{
    public class AddTreeOwnerCommandValidator : AbstractValidator<AddTreeOwnerCommand>
    {
        public AddTreeOwnerCommandValidator()
        {
            RuleFor(x => x.AddedPersonMailAddress)
                .EmailAddress()
                .WithMessage("Provided string is not proper e-mail address");
        }
    }
}

After business layer operation. Events published by domain objects are aggregated and send by MediatR. This allows for adding Domain Event Handlers on a basis of PUB-SUB, which further separates business logic from implementation. We have used this functionality to add sending welcoming messages to newly registered users.

Logging

Events from the application are logged to DataDog:

image

Traces of the machines are also aggregated in DataDog service, which provides a clear view on servers response times and allows further analysis:

image

Quote

My full name is Esteban Julio Ricardo Montoya de la Rosa Ramírez.

~ Esteban Julio Ricardo Montoya de la Rosa Ramírez, The Suite Life of Zack and Cody