Skip to content

Commit

Permalink
docs: update detailed design
Browse files Browse the repository at this point in the history
  • Loading branch information
Mala1180 authored and kelvin-olaiya committed Sep 6, 2024
1 parent 28d34df commit 4693910
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 82 deletions.
8 changes: 4 additions & 4 deletions docs/website/docs/report/architecture/microservices.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,12 @@ Feature: Data and Alarm History Consultation

![Clean Architecture](../img/clean_architecture.png)

The design of all relevant microservices follow the **Clean Architecture** pattern. This helped us
in mantaining a core domain design that abstracts away from all technical issues. As showed in the
picture above we made use of the following layers:
The design of all relevant microservices follows the **Clean Architecture** pattern. This helped us
in maintaining a core domain design that abstracts away from all technical issues. As showed in the
picture above, we made use of the following layers:

* **Domain**: DDD entities, value objects, factories, ...
* **Application**: DDD services, repositories interfaces, ...
* **Application**: DDD services, repositories, ...
* **Presentation**: Machinery to translate external data representation to domain entities and viceversa.
* **Infrastructure**: Mostly external service implementation, DB interfaces, REST apis, Events managers, ...

Expand Down
78 changes: 0 additions & 78 deletions docs/website/docs/report/detailed-design.md

This file was deleted.

125 changes: 125 additions & 0 deletions docs/website/docs/report/detailed-design.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
---
sidebar_position: 50
---

# Detailed Design

N.B. In the diagrams of this section, interface notation has been used to represent the main concepts, however this will
then be encoded appropriately based on the microservice technology.

## Packages

Each microservice has a package structure that is similar to the following:

<Image
src={require('./img/uml/packages.png').default}
align="center"
width="70%"
/>

## Domain Events

All domain events are part of the **Shared Kernel** and are used by all microservices.
The following diagram shows the domain events used in the system:

<Image
src={require('./img/uml/domain-events.png').default}
align="center"
width="70%"
/>

## Microservices

### Auth

The Auth microservice is responsible for managing the authentication and authorization of users.
**User** entity here, has a focus on the authentication and authorization mechanisms.

<Image
src={require('./img/uml/microservices/auth.png').default}
align="center"
width="70%"
/>

### User

The User microservice is responsible for managing user data.
The vision of the **User** entity here is different from the Auth microservice, as it focuses on the user's personal
data.

<Image
src={require('./img/uml/microservices/user.png').default}
align="center"
width="70%"
/>

### Device

The Device microservice is responsible for managing the devices.
The focus here is on the **Capability** concept, which allows the device to have multiple and flexible types of
functionalities.

Moreover, **DeviceService** has an important role because it encapsulates the business logic for the device management
and connection using Web of Things (WoT) standard.

<Image
src={require('./img/uml/microservices/device.png').default}
align="center"
width="70%"
/>

### Monitoring

The Monitoring microservice has the responsibility of continuously listening to the devices and collecting the data.

<Image
src={require('./img/uml/microservices/monitoring.png').default}
align="center"
width="70%"
/>

### Alarm

The Alarm microservice is responsible for managing security rules and for triggering anomalies when a rule is violated.
Each `SecurityRule` has a time slot in which it is active.

When a `SecurityRule` is violated, an `Anomaly` is created and published.
<Image
src={require('./img/uml/microservices/alarm.png').default}
align="center"
width="70%"
/>

### Recognition

The Recognition microservice is an ad-hoc service used to perform object recognition on cameras' video streams.

<Image
src={require('./img/uml/microservices/recognition.png').default}
align="center"
width="50%"
/>

### Notification

In the Notification microservice, the focus is on the `Notification` entity, which is created whenever a `DomainEvent`
is triggered.
In this way, the system can notify the user about all possible events that occur.

<Image
src={require('./img/uml/microservices/notification.png').default}
align="center"
width="70%"
/>

### Log

Log microservice is an ad-hoc service used to store the major part of the system's events.
In particular, it stores all the `Anomalies` detected by the Alarm microservice and all the `Measurements` collected by
the Monitoring microservice.

<Image
src={require('./img/uml/microservices/log.png').default}
align="center"
width="70%"
/>

0 comments on commit 4693910

Please sign in to comment.