# quyvu01/anemoi_open architecture

> Architecture diagram of the GitHub repository quyvu01/anemoi_open, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/quyvu01/anemoi_open
- Repository: https://github.com/quyvu01/anemoi_open

## Overview

##### Main Components
- Anemoi.BuildingBlocks – the shared libraries, core utilities, and foundational components.
- Anemoi.Centralize – the API aggregation layer that clients interact with (acting as an API gateway).
- Anemoi.Contract – a shared DTOs and contracts library that standardizes data transfer.
- Anemoi.Grpc – the gRPC-based communication component for high-performance inter-service calls.
- Anemoi.Identity – microservice handling authentication, authorization, and identity management.
- Anemoi.MasterData – service for serving static or reference/master data.
- Anemoi.Workspace – service for managing user/resource-specific configurations.
- Shared Infrastructure & Communication:
- A message broker (RabbitMQ) should be shown as the backbone for the event-driven design.
- Optionally, illustrate database components wherever Entity Framework is used (each service likely has its own persistence model).

##### Important Architectural Patterns and Design Elements
- For Saga orchestration, you might want to show a control component or coordination mechanism that manages distributed transactions across microservices. Annotate it as “Saga Orchestrator” if it is implemented as a part of one of the microservices (or an external coordinator).

##### Technologies, Frameworks, and Integration Points
- GRPC as the protocol for high-performance internal communications (linking Anemoi.Grpc with other services).

## Diagram (Mermaid)

```mermaid
graph TD
    A("Clients (Web/Mobile)"):::external
    B("Anemoi.Centralize (API Gateway)"):::api

    %% Shared libraries
    BB("Anemoi.BuildingBlocks"):::shared
    CT("Anemoi.Contract"):::shared

    %% Communication and Coordination Components
    GR("Anemoi.Grpc"):::grpc
    RM("RabbitMQ"):::broker
    SO("Saga Orchestrator"):::orchestrator

    %% External Flow
    A -->|"API_call"| B

    %% Microservices Subgraph
    subgraph "Microservices"
        direction TB

        %% Anemoi.Identity Service with internal layers
        subgraph "Anemoi.Identity"
            direction TB
            id("Anemoi.Identity"):::service
            id --> id_cmd("Command_Handler"):::cmd
            id --> id_query("Query_Handler"):::query
            id --> id_domain("Domain_Layer"):::domain
            id --> id_infra("Infrastructure_Layer"):::infra
        end

        %% Anemoi.MasterData Service with internal layers
        subgraph "Anemoi.MasterData"
            direction TB
            md("Anemoi.MasterData"):::service
            md --> md_cmd("Command_Handler"):::cmd
            md --> md_query("Query_Handler"):::query
            md --> md_domain("Domain_Layer"):::domain
            md --> md_infra("Infrastructure_Layer"):::infra
        end

        %% Anemoi.Workspace Service with internal layers
        subgraph "Anemoi.Workspace"
            direction TB
            ws("Anemoi.Workspace"):::service
            ws --> ws_cmd("Command_Handler"):::cmd
            ws --> ws_query("Query_Handler"):::query
            ws --> ws_domain("Domain_Layer"):::domain
            ws --> ws_infra("Infrastructure_Layer"):::infra
        end
    end

    %% Centralized API invoking Services
    B -->|"InvokeService"| id
    B -->|"InvokeService"| md
    B -->|"InvokeService"| ws

    %% Inter-service Communication using gRPC
    id ---|"gRPC"| GR
    md ---|"gRPC"| GR
    ws ---|"gRPC"| GR

    %% Asynchronous Event Flow via RabbitMQ
    id ---|"Publish/Subscribe"| RM
    md ---|"Publish/Subscribe"| RM
    ws ---|"Publish/Subscribe"| RM

    %% Saga Coordination Events
    id ---|"Saga_Event"| SO
    md ---|"Saga_Event"| SO
    ws ---|"Saga_Event"| SO

    %% Shared Library Usages (dashed connections)
    id ---."Uses".--- BB
    id ---."Uses".--- CT
    md ---."Uses".--- BB
    md ---."Uses".--- CT
    ws ---."Uses".--- BB
    ws ---."Uses".--- CT

    %% Styles
    classDef external fill:#f9e79f,stroke:#b7950b,stroke-width:2px;
    classDef api fill:#aed6f1,stroke:#2874a6,stroke-width:2px;
    classDef service fill:#a9dfbf,stroke:#1e8449,stroke-width:2px;
    classDef shared fill:#d5f5e3,stroke:#28b463,stroke-width:2px;
    classDef grpc fill:#d6eaf8,stroke:#2e86c1,stroke-width:2px;
    classDef broker fill:#fcf3cf,stroke:#f1c40f,stroke-width:2px;
    classDef orchestrator fill:#fadbd8,stroke:#e74c3c,stroke-width:2px;
    classDef cmd fill:#e8f8f5,stroke:#1abc9c;
    classDef query fill:#e8f8f5,stroke:#16a085;
    classDef domain fill:#ebedef,stroke:#566573;
    classDef infra fill:#fbeee6,stroke:#d35400;

    %% Click Events
    click BB "https://github.com/quyvu01/anemoi_open/blob/main/Anemoi.BuildingBlocks"
    click B "https://github.com/quyvu01/anemoi_open/blob/main/Anemoi.Centralize"
    click CT "https://github.com/quyvu01/anemoi_open/blob/main/Anemoi.Contract"
    click GR "https://github.com/quyvu01/anemoi_open/blob/main/Anemoi.Grpc"
    click id "https://github.com/quyvu01/anemoi_open/blob/main/Anemoi.Identity"
    click md "https://github.com/quyvu01/anemoi_open/blob/main/Anemoi.MasterData"
    click ws "https://github.com/quyvu01/anemoi_open/blob/main/Anemoi.Workspace"
    click SO "https://github.com/quyvu01/anemoi_open/blob/main/Anemoi.Orchestration/Anemoi.Orchestration.Machine"
```
