Skip to content

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

ProjectPurpose
Voltimax.Iot.ContractsMetric definitions, enums, data models shared across all projects
Voltimax.Iot.MetricsElasticsearch queries and ingestion via CQRS handlers
Voltimax.Iot.ServiceDefaults.NET Aspire service defaults (OpenTelemetry, health checks)
Voltimax.MessagingAzure Service Bus abstraction with minimal API-style registration
Voltimax.Platform.ClientOfficial .NET client library for the Platform API
Voltimax.EnergyAdvisorEnergy 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