Backend
The Voltimax backend is built with .NET 10 and follows a modular architecture with clear separation of concerns. It consists of the Platform API, Azure Functions for background processing, and shared libraries.
Projects
Platform API
The Voltimax.Platform.Api project is the main ASP.NET Core web API. It provides RESTful endpoints for gateway management, asset configuration, metrics querying, and workflow orchestration. API documentation is available via Scalar (OpenAPI).
- Authentication: Keycloak (OAuth 2.0 / OIDC) with fine-grained role-based access
- Documentation: OpenAPI with Scalar UI
- CQRS: Commands and queries via source-generated Mediator
Azure Functions
Voltimax.Platform.Functions handles background and event-driven workloads:
- Azure Service Bus message processing
- Pricing data ingestion (ENTSO-E)
- Scheduled tasks and background jobs
Repositories
Voltimax.Platform.Repositories provides data access using Entity Framework Core 10 with PostgreSQL. It uses:
- Mapperly for source-generated object mapping
- CQRS pattern with command and query repositories
- Feature-folder organisation
Data
Voltimax.Platform.Data contains the PlatformDbContext, entity definitions, and EF Core migrations.
Shared Libraries
| Project | Purpose |
|---|---|
Voltimax.Iot.Contracts | Metric definitions, enums, data models shared across all projects |
Voltimax.Iot.Metrics | Elasticsearch queries and ingestion via CQRS handlers |
Voltimax.Iot.ServiceDefaults | .NET Aspire service defaults (OpenTelemetry, health checks) |
Voltimax.Messaging | Azure Service Bus abstraction with minimal API-style registration |
Voltimax.Platform.Client | Official .NET client library for the Platform API |
Voltimax.EnergyAdvisor | Energy advisory and optimisation services |
MCP Server
Voltimax.Platform.McpServer exposes platform functionality as a Model Context Protocol server for AI tooling integration. Development-only.
Key Patterns
- CQRS - Commands and queries via source-generated Mediator
- Mapperly - Source-generated object mapping with
[Mapper]attribute - FluentValidation - Request validation
- Options pattern - Configuration via
IOptions<T> - Result types - Prefer result objects over exceptions for expected failures