# eclipse-aaspe/server architecture

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

- Interactive diagram: https://gitdiagram.com/eclipse-aaspe/server
- Repository: https://github.com/eclipse-aaspe/server

## Overview

1. **Repository shape**
   - This is a multi-project .NET 8 mono-repo for the **Eclipse AASX Server**.
   - It contains reusable libraries, two main server applications, persistence support, protocol-specific API layers, tests, and many runnable examples/demos.

2. **Primary runtime products**
   - The two main deployable apps are **AasxServerBlazor** and **AasxServerAspNetCore**.
   - The Blazor variant is the main user-facing server: it hosts the browser UI and the server-side APIs together.
   - The ASP.NET Core variant is the lighter server host, focused on headless service exposure.

3. **Core domain boundary**
   - The central domain is the **AASX / Asset Administration Shell** model.
   - `AasCore.Aas3_0` provides the canonical AAS 3.0 metamodel and serialization/verification utilities.
   - `AasxCsharpLibrary` adds higher-level utilities, compatibility models, extension methods, and package/environment handling around that metamodel.

4. **Server orchestration layer**
   - `AasxServerStandardBib` is the shared server “business/runtime” layer used by the server apps.
   - It contains request handling, eventing, logging, update transformation, time-series support, Modbus client integration, and various AAS-specific services.
   - This is where the server’s internal workflows are coordinated before reaching storage or transport adapters.

5. **Web/UI boundary**
   - `AasxServerBlazor` is the interactive UI shell.
   - Its `Pages`, `Shared`, `Controller`, and `Data` folders suggest a server-side Blazor app that renders the tree/browser experience for AAS packages and calls into shared services.
   - Static assets, swagger assets, and demo content live alongside the UI, indicating the UI is tightly coupled to server-hosted package exploration.

6. **Protocol/API adapter layer**
   - `IO.Swagger.Lib.V3` and `IO.Swagger.Registry.Lib.V3` provide the REST API surface for the AAS Repository and AAS Registry profiles.
   - These projects include controllers, request/response formatters, serializers, middleware, and pagination/filtering helpers.
   - They act as protocol adapters: they translate HTTP/OpenAPI requests into AAS repository or registry operations.

7. **Registry-specific subsystem**
   - `IO.Swagger.Registry.Lib.V3` is the registry counterpart, centered on `AssetAdministrationShellDescriptor` and related registry DTOs.
   - It includes descriptor serialization/deserialization, registry services, and initializer logic.
   - This is distinct from the repository API because it models discoverability/endpoint metadata rather than package content itself.

8. **Persistence subsystem**
   - `AasxServerDB` implements database-backed storage using **Entity Framework Core**.
   - It supports both **SQLite** and **PostgreSQL** via separate DbContext implementations and migrations.
   - The entities, query results, serializer, visitor, and file/MQTT helpers indicate that the DB layer stores and reconstructs AAS package structure, not just flat rows.

9. **Security subsystem**
   - `AasSecurity` is a separate security library with authentication/authorization handlers, policy models, trust-list verification, and security settings parsing.
   - The presence of `PolicyDecisionPoint`, `PolicyEnforcementPoint`, and ABAC-related models shows a policy-driven access control boundary.
   - Demo certificates and trust lists in the repo support this as a real deployment concern, not just a stub.

10. **Contracts and DTO boundaries**
   - `Contracts` defines the cross-project interfaces and shared request/result models used between server layers.
   - `DataTransferObjects` holds the API-facing shapes for metadata and values, separating transport contracts from internal metamodel classes.
   - This separation is important for architecture: internal AAS objects are not exposed directly at every boundary.

11. **Query, serialization, and transformation flow**
   - Querying and representation are handled by dedicated components in the API libraries and DB layer.
   - There are explicit paths for JSON query parsing, path/reference modifiers, value-only serializers, and serialization modifiers.
   - That means the same underlying AAS model can be projected into different REST views such as `core`, `complete`, `deep`, `value`, and paged results.

12. **External protocol/integration hooks**
   - The server is not only HTTP-based; the README and code names indicate support for **OPC UA** and **MQTT**, plus Modbus/time-series integration in the shared runtime library.
   - These integrations are part of the server’s operational boundary and likely bridge live industrial data into AAS content or updates.

13. **Examples and demos**
   - The `examples` tree contains many small, focused demo apps for login, MQTT, registry-of-registry, token tooling, performance testing, and certificate/token flows.
   - These are not core runtime dependencies; they document integration patterns and help validate the platform’s ecosystem.
   - The `content-for-demo` and sample `.aasx` files are deployment assets for local/demo scenarios.

14. **Build, packaging, and release automation**
   - The repo relies on GitHub Actions for build, analysis, prerelease, and Docker publishing workflows.
   - PowerShell scripts and Dockerfiles under `src/docker` support packaging the server into container images.
   - This is a multi-target distribution project: local .NET execution, Docker deployment, and versioned release artifacts are all first-class.

15. **How the pieces fit**
   - At a high level, clients talk to the Blazor UI or REST API layer.
   - Those adapters call shared server services, which operate on AAS domain objects from the core library.
   - Data may come from file-based AASX packages or from the EF-backed database, and access may be filtered by the security subsystem before being returned or persisted.

Main entry points: [`src/AasxServerStandardBib`](https://github.com/eclipse-aaspe/server/tree/main/src/AasxServerStandardBib) (Standard Bib), [`src/AasxServerBlazor`](https://github.com/eclipse-aaspe/server/tree/main/src/AasxServerBlazor) (Blazor Server), [`src/IO.Swagger.Lib.V3`](https://github.com/eclipse-aaspe/server/blob/main/src/IO.Swagger.Lib.V3) (Repo API), [`src/IO.Swagger.Registry.Lib.V3`](https://github.com/eclipse-aaspe/server/blob/main/src/IO.Swagger.Registry.Lib.V3) (Registry API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_core["Core domain"]
  node_aascore["AAS Core<br/>metamodel<br/>[AasCore.Aas3_0]"]
  node_aasxlib["Aasx Library<br/>domain helpers"]
end

subgraph group_group_runtime["Server runtime"]
  node_serverbib["Standard Bib<br/>runtime core"]
end

subgraph group_group_api["Protocol APIs"]
  node_swaggerrepo["Repo API<br/>protocol adapter<br/>[IO.Swagger.Lib.V3]"]
  node_swaggerreg["Registry API<br/>protocol adapter"]
  node_registrysvc["Registry services<br/>registry logic<br/>[Services]"]
  node_reposvc["Repo services<br/>repository logic<br/>[Services]"]
end

subgraph group_group_host["Deployable hosts"]
  node_blazorhost["Blazor Server<br/>main host"]
  node_aspnethost["ASP.NET Core Host<br/>headless host"]
  node_blazorui["UI shell<br/>blazor pages"]
  node_blazordata["UI services<br/>app services"]
  node_blazorctrl["Controllers<br/>ui endpoints"]
end

subgraph group_group_data["Persistence"]
  node_aasdb[("AasxServerDB<br/>ef storage")]
  node_dbcontexts["DB contexts<br/>ef contexts"]
end

subgraph group_group_security["Security"]
  node_security["AasSecurity<br/>authz/authn"]
end

subgraph group_group_support["Shared contracts"]
  node_contracts["Contracts<br/>shared interfaces"]
  node_dtos["DTOs<br/>api shapes"]
end

subgraph group_group_examples["Examples"]
  node_exampleslogin["Login demo<br/>example app"]
  node_examplesmqtt["MQTT demos<br/>example apps"]
  node_examplesregistry["Registry demo<br/>example app"]
  node_exampleclient["Example Client<br/>client sample"]
end

node_aasxlib -->|"builds on"| node_aascore
node_security -->|"guards"| node_aasxlib
node_serverbib -->|"operates on"| node_aascore
node_serverbib -->|"uses"| node_aasxlib
node_serverbib -->|"implements"| node_contracts
node_aasdb -->|"persists"| node_aascore
node_aasdb -->|"implements"| node_contracts
node_aasdb -->|"serves"| node_serverbib
node_reposvc -->|"uses"| node_contracts
node_reposvc -->|"maps"| node_dtos
node_reposvc -->|"serializes"| node_aascore
node_registrysvc -->|"serializes"| node_aascore
node_registrysvc -->|"uses"| node_contracts
node_swaggerrepo -->|"adapts"| node_reposvc
node_swaggerrepo -->|"returns"| node_dtos
node_swaggerrepo -->|"calls"| node_serverbib
node_swaggerreg -->|"adapts"| node_registrysvc
node_swaggerreg -->|"calls"| node_serverbib
node_blazorhost -->|"hosts"| node_blazorui
node_blazorhost -->|"uses"| node_blazordata
node_blazorhost -->|"runs with"| node_serverbib
node_blazorhost -->|"exposes"| node_swaggerrepo
node_blazorhost -->|"exposes"| node_swaggerreg
node_blazorhost -->|"enforces"| node_security
node_blazorhost -->|"persists via"| node_aasdb
node_aspnethost -->|"runs with"| node_serverbib
node_aspnethost -->|"exposes"| node_swaggerrepo
node_aspnethost -->|"exposes"| node_swaggerreg
node_aspnethost -->|"enforces"| node_security
node_exampleslogin -.->|"demonstrates"| node_security
node_examplesmqtt -.->|"demonstrates"| node_serverbib
node_examplesregistry -.->|"demonstrates"| node_swaggerreg
node_exampleclient -.->|"consumes"| node_swaggerrepo

click node_aascore "https://github.com/eclipse-aaspe/server/blob/main/src/AasCore.Aas3_0"
click node_aasxlib "https://github.com/eclipse-aaspe/server/tree/main/src/AasxCsharpLibrary"
click node_contracts "https://github.com/eclipse-aaspe/server/tree/main/src/Contracts"
click node_dtos "https://github.com/eclipse-aaspe/server/tree/main/src/DataTransferObjects"
click node_security "https://github.com/eclipse-aaspe/server/tree/main/src/AasSecurity"
click node_serverbib "https://github.com/eclipse-aaspe/server/tree/main/src/AasxServerStandardBib"
click node_aasdb "https://github.com/eclipse-aaspe/server/tree/main/src/AasxServerDB"
click node_swaggerrepo "https://github.com/eclipse-aaspe/server/blob/main/src/IO.Swagger.Lib.V3"
click node_swaggerreg "https://github.com/eclipse-aaspe/server/blob/main/src/IO.Swagger.Registry.Lib.V3"
click node_blazorhost "https://github.com/eclipse-aaspe/server/tree/main/src/AasxServerBlazor"
click node_aspnethost "https://github.com/eclipse-aaspe/server/tree/main/src/AasxServerAspNetCore"
click node_exampleslogin "https://github.com/eclipse-aaspe/server/tree/main/examples/BlazorLoginApp"
click node_examplesmqtt "https://github.com/eclipse-aaspe/server/tree/main/examples/MQTTclient"
click node_examplesregistry "https://github.com/eclipse-aaspe/server/tree/main/examples/RegistryOfRegistry"
click node_exampleclient "https://github.com/eclipse-aaspe/server/tree/main/src/ExampleClient"
click node_blazorui "https://github.com/eclipse-aaspe/server/tree/main/src/AasxServerBlazor/Pages"
click node_blazordata "https://github.com/eclipse-aaspe/server/tree/main/src/AasxServerBlazor/Data"
click node_blazorctrl "https://github.com/eclipse-aaspe/server/tree/main/src/AasxServerBlazor/Controller"
click node_dbcontexts "https://github.com/eclipse-aaspe/server/tree/main/src/AasxServerDB/Context"
click node_registrysvc "https://github.com/eclipse-aaspe/server/blob/main/src/IO.Swagger.Registry.Lib.V3/Services"
click node_reposvc "https://github.com/eclipse-aaspe/server/blob/main/src/IO.Swagger.Lib.V3/Services"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_aascore,node_aasxlib,node_contracts,node_dtos toneBlue
class node_serverbib,node_exampleslogin,node_examplesmqtt,node_examplesregistry,node_exampleclient toneAmber
class node_swaggerrepo,node_swaggerreg,node_registrysvc,node_reposvc toneMint
class node_blazorhost,node_aspnethost,node_blazorui,node_blazordata,node_blazorctrl toneRose
class node_aasdb,node_dbcontexts toneIndigo
class node_security toneTeal
```

## Components

### Core domain

AAS metamodel and higher-level library helpers

- [AAS Core](https://github.com/eclipse-aaspe/server/blob/main/src/AasCore.Aas3_0): metamodel · Canonical AAS 3.0 types plus serialization and verification utilities · `src/AasCore.Aas3_0`
- [Aasx Library](https://github.com/eclipse-aaspe/server/tree/main/src/AasxCsharpLibrary): domain helpers · Compatibility models, package handling, and extension utilities around the AAS model · `src/AasxCsharpLibrary`

### Server runtime

Shared orchestration layer used by the deployable servers

- [Standard Bib](https://github.com/eclipse-aaspe/server/tree/main/src/AasxServerStandardBib): runtime core · Shared server orchestration, logging, events, updates, time series, and integrations · `src/AasxServerStandardBib`

### Protocol APIs

REST and registry protocol adapters

- [Repo API](https://github.com/eclipse-aaspe/server/blob/main/src/IO.Swagger.Lib.V3): protocol adapter · REST/OpenAPI repository surface with query, serialization, and paging modifiers · `src/IO.Swagger.Lib.V3`
- [Registry API](https://github.com/eclipse-aaspe/server/blob/main/src/IO.Swagger.Registry.Lib.V3): protocol adapter · REST/OpenAPI registry surface for AAS descriptors and discoverability metadata · `src/IO.Swagger.Registry.Lib.V3`
- [Registry services](https://github.com/eclipse-aaspe/server/blob/main/src/IO.Swagger.Registry.Lib.V3/Services): registry logic · Descriptor serialization, pagination, initialization, and registry operations · `src/IO.Swagger.Registry.Lib.V3/Services`
- [Repo services](https://github.com/eclipse-aaspe/server/blob/main/src/IO.Swagger.Lib.V3/Services): repository logic · Query parsing, path/reference modifiers, pagination, and serialization helpers · `src/IO.Swagger.Lib.V3/Services`

### Deployable hosts

Main server applications and their UI shell

- [Blazor Server](https://github.com/eclipse-aaspe/server/tree/main/src/AasxServerBlazor): main host · Interactive server app combining browser UI and server-side APIs · `src/AasxServerBlazor`
- [ASP.NET Core Host](https://github.com/eclipse-aaspe/server/tree/main/src/AasxServerAspNetCore): headless host · Lighter server host for service exposure without the full UI shell · `src/AasxServerAspNetCore`
- [UI shell](https://github.com/eclipse-aaspe/server/tree/main/src/AasxServerBlazor/Pages): blazor pages · Tree browser, pages, shared layout, and client-facing server UI · `src/AasxServerBlazor/Pages`
- [UI services](https://github.com/eclipse-aaspe/server/tree/main/src/AasxServerBlazor/Data): app services · Blazor-side data, session, and credential services · `src/AasxServerBlazor/Data`
- [Controllers](https://github.com/eclipse-aaspe/server/tree/main/src/AasxServerBlazor/Controller): ui endpoints · UI-adjacent HTTP controllers such as image handling · `src/AasxServerBlazor/Controller`

### Persistence

Database and package reconstruction layer

- [AasxServerDB](https://github.com/eclipse-aaspe/server/tree/main/src/AasxServerDB): ef storage · EF Core persistence for AAS packages with SQLite and PostgreSQL contexts · `src/AasxServerDB`
- [DB contexts](https://github.com/eclipse-aaspe/server/tree/main/src/AasxServerDB/Context): ef contexts · SQLite and PostgreSQL DbContext implementations · `src/AasxServerDB/Context`

### Security

Authentication, authorization, and trust validation

- [AasSecurity](https://github.com/eclipse-aaspe/server/tree/main/src/AasSecurity): authz/authn · Authentication, authorization, policy enforcement, and trust-list verification · `src/AasSecurity`

### Shared contracts

Cross-project DTOs and interfaces

- [Contracts](https://github.com/eclipse-aaspe/server/tree/main/src/Contracts): shared interfaces · Cross-project request/result interfaces and common runtime contracts · `src/Contracts`
- [DTOs](https://github.com/eclipse-aaspe/server/tree/main/src/DataTransferObjects): api shapes · Transport-facing metadata and value objects · `src/DataTransferObjects`

### Examples

Runnable demos and integration samples

- [Login demo](https://github.com/eclipse-aaspe/server/tree/main/examples/BlazorLoginApp): example app · Example authentication-oriented app and UI sample · `examples/BlazorLoginApp`
- [MQTT demos](https://github.com/eclipse-aaspe/server/tree/main/examples/MQTTclient): example apps · Broker/client demos for industrial messaging integration · `examples/MQTTclient`
- [Registry demo](https://github.com/eclipse-aaspe/server/tree/main/examples/RegistryOfRegistry): example app · Demo for registry-style deployment and descriptor flows · `examples/RegistryOfRegistry`
- [Example Client](https://github.com/eclipse-aaspe/server/tree/main/src/ExampleClient): client sample · Minimal client entry point for interacting with server endpoints · `src/ExampleClient`

## Connections

- Aasx Library → AAS Core: builds on · Extends the canonical metamodel with higher-level helpers
- AasSecurity → Aasx Library: guards · Works over AAS objects and trust artifacts
- Standard Bib → AAS Core: operates on · Coordinates AAS-domain workflows
- Standard Bib → Aasx Library: uses · Relies on package/environment helpers and compatibility models
- Standard Bib → Contracts: implements · Implements shared runtime interfaces and request handling
- AasxServerDB → AAS Core: persists · Stores and reconstructs AAS structures
- AasxServerDB → Contracts: implements · Adapts DB requests and query results to shared contracts
- AasxServerDB → Standard Bib: serves · Back-end persistence for the shared runtime
- Repo services → Contracts: uses · Consumes pagination, query, and request contracts
- Repo services → DTOs: maps · Projects internal model data into transport shapes
- Repo services → AAS Core: serializes · Transforms AAS model views for REST responses
- Registry services → AAS Core: serializes · Handles AAS descriptor content and endpoint metadata
- Registry services → Contracts: uses · Shares registry request and pagination contracts
- Repo API → Repo services: adapts · HTTP/OpenAPI layer over repository services
- Repo API → DTOs: returns · Exposes metadata and value DTOs to clients
- Repo API → Standard Bib: calls · Connects protocol handling to shared runtime workflows
- Registry API → Registry services: adapts · HTTP/OpenAPI layer over registry services
- Registry API → Standard Bib: calls · Connects registry protocol handling to shared runtime workflows
- Blazor Server → UI shell: hosts · Renders the UI pages and layouts
- Blazor Server → UI services: uses · Coordinates browser-state and credential services
- Blazor Server → Standard Bib: runs with · Main interactive host built on the shared runtime
- Blazor Server → Repo API: exposes · Serves repository APIs alongside the UI
- Blazor Server → Registry API: exposes · Serves registry APIs alongside the UI
- Blazor Server → AasSecurity: enforces · Applies authn/authz and trust-list checks
- Blazor Server → AasxServerDB: persists via · Uses database-backed storage when configured
- ASP.NET Core Host → Standard Bib: runs with · Headless host built on the shared runtime
- ASP.NET Core Host → Repo API: exposes · Primary repository protocol surface
- ASP.NET Core Host → Registry API: exposes · Registry protocol surface when enabled
- ASP.NET Core Host → AasSecurity: enforces · Applies security boundary for service exposure
- Login demo → AasSecurity: demonstrates · Shows login and token-based access patterns
- MQTT demos → Standard Bib: demonstrates · Illustrates MQTT integration with the server runtime
- Registry demo → Registry API: demonstrates · Shows registry descriptor flows and deployment patterns
- Example Client → Repo API: consumes · Simple client for repository endpoints
