Skip to content

III. Architecture

Frederik Wulf edited this page May 5, 2023 · 12 revisions

This page will cover an overview of the architecture of the project. The architecture is based on the microservice architecture pattern.

  1. Overview
  2. Service internal architecture

Overview

For an easy overview of the project architecture, the C4 model is used. The C4 model is a hierarchical way to describe the architecture of a software system. It is based on a set of diagrams, each one describing a different level of abstraction. The C4 model is composed of four levels: System Context, Container, Component and Code. More about the C4 model

The following C4 model diagrams were created from the functional requirements of the project. That are described in the Features and Functionality section of the documentation.

System Context

image

System

image

System Components

image

Account Service

image

Inventory Service

image

Shopping Cart Service

image

Fulfillment Service

image

As already described in the Features and Functionality section, the external systems payment and logistics where simplified.

image

Service internal architecture

The internal architecture of all four services is following the same patter, the Clean Architecture pattern, also known as Hexagonal or Onion Architecture. This pattern is based on the separation of concerns principle, which means that the code is separated into layers, each one with a specific responsibility.

image Image source

More about the pattern and .net implementation

For example on the following image, we can see the layers and the core components of the Account Service: C4-E-Commerce-Page-2

On the above image each box or layer has its own project. All projects of a service are grouped in a Solution. With this approach we can identify the responsibilities of each layer and also its made sure that the dependency inversion principle must be followed. In .net we can only reference projects uni-directionally, so we can't have a domain class use a application class or infrastructure class by mistake.