How digitaltwinconsortium/aas-repository works
Project Type and Purpose
• This is a full-stack ASP.NET Core application implementing the IEC 63278 Asset Administration Shell (AAS) Repository.
• It exposes standardized REST APIs for AAS and OPC UA, a browser-based UI (Razor/Blazor), Swagger documentation, and integrates with multiple external services (WattTime, Azure Data Explorer, Dynamics 365, CESMII SMIP, time-series DB, etc.).
File-Structure Analysis
• Top-level: AAS-Repository.sln, Dockerfile, CI workflows (.github), README.
• src/: the main ASP.NET Core project, containing:
• Controllers/ – REST API controllers for AAS, OPC UA, browser UI
• Pages/ & Shared/ & Views/ – Razor pages, layouts, Blazor components for the UI
• Models/ – AAS domain classes (AssetAdministrationShell, Submodel, ConceptDescription, etc.)
• Services/ – Business-logic and integration services (AssetAdministrationShellEnvironmentService, ADXDataService, ProductCarbonFootprintService, SMIPDataService, DynamicsDataService, WattTimeClient, UAClient)
• SimpleServer.cs – embedded OPC UA server host
• Program.cs & Startup.cs – application setup, middleware (BasicAuth, Swagger, routing)
• wwwroot/ – static assets (CSS, fonts)
Key Components & Layers
a. Presentation Layer (UI)
– Browser clients load Razor/Blazor pages from the ASP.NET Core host.
– Swagger UI is served at /swagger for API exploration.
b. API Layer
– ASP.NET Core MVC controllers receiving HTTP requests:
· AssetAdministrationShellRegistryApi
· AssetAdministrationShellRepositoryApi
· SubmodelRepositoryApi
· ConceptDescriptionRepositoryApi
· SerializationApi
· UaServerController
· BrowserController
– Basic authentication middleware protects endpoints.
c. Business Logic Layer
– Services orchestrate domain use cases:
· AssetAdministrationShellEnvironmentService (in-memory store of loaded nodesets & AAS environment)
· ProductCarbonFootprintService (calculates PCF using scope 1/2/3 logic)
· ADXDataService, DynamicsDataService, SMIPDataService, WattTimeClient, UAClient (integration adapters)
· NodesetFileNodeManager (manages OPC UA nodeset XML loading)
d. Integration Layer / External Systems
– Azure Data Explorer cluster (time-series operational data)
– Dynamics 365 ERP instance
– WattTime REST API (electricity carbon intensity)
– CESMII SMIP GraphQL API
– Upstream AAS supply-chain servers
– Embedded OPC UA server (SimpleServer) for runtime exposure of loaded AAS models
Relationships & Data Flows
• User Browser ↔ (HTTPS) ↔ Razor/Blazor UI ↔ Controllers
• Controllers → Services → (in-memory) AAS environment
• Services ↔ External APIs (ADX, Dynamics, WattTime, SMIP)
• Controllers ↔ Embedded OPC UA server endpoint (via UaServerController)
• Controllers → Swagger middleware → API documentation
Architectural Patterns & Design Principles
• Layered Architecture: Presentation → API → Business Logic → Integration → External Services
• Dependency Injection: all services and clients registered in Startup.cs
• Repository pattern (AssetAdministrationShellEnvironmentService acts as an in-memory repository)
• Adapter pattern for external integrations (WattTimeClient, ADXDataService, etc.)
• Use of standard protocols: HTTP/REST, GraphQL, OPC UA