Skip to content

Architecture Documentation

hamed shirbandi edited this page Jan 19, 2022 · 39 revisions

TaskoMask Application Architecture

onionarchitecture

We follow Onion Architecture so generally we have following layers:

  • Domain (Domain & Domain.Core & Domain.Share)
  • Infrastructure (Infrastructure.Data & Infrastructure.CrossCutting & Infrastructure.Share)
  • Application (Application & Application.Core & Application.Share)
  • Presentation (Website & AdminPanel & UserPanel & API & Framework.Web & Framework.Share)
  • Tests (UnitTests.Base & Application.UnitTests)

Domain Layer

This layer contains Read Model for the Read Side of application and Write Model implemented by DDD concepts. Mainly it contains Entities, Events and Repository Interfaces. In domain part of application architecture you see a layer named Domain.Core. This layer acts as seed work and we put all seed work items in it for example base models, Extensions and so on. But it just contains items that domain need them so any other items must placed in another layer by their usage. There is another class library named Domain.Share. Actually it is a part of Domain.Core but it can be shared to different target frameworks. Especially in this application it is used by Blazor project for implementing user panel. We use Share Layers because we don't want to add extra dependencies in some target projects.

Infrastructure Layer

Infrastructure part of application architecture divided into 2 layers just to keep things clean and relevant so we define Infrastructure.Data to hold all items about data configuration like database context, event store, repositories and we use Infrastructure.CrossCutting to implement any other cross cutting concern like bus, ioc, mapper and so on. There is Infrastructure.Share too that works like Domain.Share.

Application Layer

In this layer we mainly implement application services and CQRS and handle any other things about use caces. In application part of our application architecture you see a layer named Application.Core. This layer acts as seed work and we put all seed work items in it for example base classes, behaviors, resources and so on. But it just contains items that Application need them so any other items must placed in another layer by their usage. There is Application.Share too that works like Domain.Share.

Presentation Layer

This is Presentation part of application architecture and contains some web project and framework class library as explained below:

  • Website: This layer implemented by ASP.NET Core MVC and it contains a landing page website for TaskoMask.
  • AdminPanel: This layer implemented by ASP.NET Core MVC and it contains a panel to manage whole TaskoMask data by administrators.
  • REST API: This layer implemented by ASP.NET Core Web API and it contains REST API services for TaskoMask clients.
  • Framework.Web: This layer is to share items between all presentation layers. like base controllers, authentication services, components and so on
  • Framework.Share: This works like Domain.Share.

Tests Layer

It contains all unit tests for the application.

Pipelines

Command Request Pipeline

cmd pipeline

Query Request Pipeline

query pipeline

Attention

This is an open source project an some times it can have some differences between docs and the source so if you had a problem please tell us in issues or feel free to fix it by a pull request