Skip to main content

Ampra Platform Documentation

Enterprise-grade monitoring and predictive analytics for renewable energy infrastructure.

Ampra is a full-stack solar energy management platform that provides real-time telemetry ingestion, intelligent forecasting, financial analytics, and comprehensive fleet oversight for solar panel installations, battery storage systems, and grid-tied consumers.


Platform at a Glance

CapabilityDescription
Real-Time MonitoringSub-second telemetry ingestion via MQTT and Webhook protocols with 30+ normalized metrics per data point
Predictive ForecastingPhysics-aware XGBoost ML models producing 7-day solar production, load consumption, and battery state-of-charge forecasts
Financial AnalyticsGranular ROI calculations with historical kWh price tracking, payback period estimation, and cumulative savings projections
Fleet ManagementHierarchical Power Group organization with batch metrics, fault detection, and multi-source dashboards
Weather IntegrationAutomated 8-day weather forecasts correlated with solar production via Open-Meteo API
Data ExportCSV and Excel export with aggregated summary sheets for compliance and reporting
Public SharingGranular, per-source sharing controls for monitor, weather, forecast, and returns data

System Architecture

Ampra follows a clean architecture pattern with strict separation of concerns across seven independently deployable modules:

ModuleLayerTechnologyResponsibility
Ampra.CoreDomain.NET 10Entities, enumerations, constants, configuration models, exception types
Ampra.ApplicationApplication.NET 10Service interfaces, DTOs, request/response models, FluentValidation rules
Ampra.InfrastructureInfrastructure.NET 10, EF CoreService implementations, PostgreSQL/MongoDB data access, external API integrations
Ampra.WebPresentationASP.NET CoreREST API controllers, middleware, background jobs, authentication, DI configuration
Ampra.UIClientReact 19, TypeScriptSingle-page application with real-time dashboards, charts, and management interfaces
Ampra.MLIntelligencePython 3.12, FlaskXGBoost model training, physics-aware prediction engine, job orchestration
Ampra.MQTTIngestion.NET 10, MQTTnetBackground worker for MQTT telemetry subscription, data normalization, and MongoDB storage

Technology Stack

Backend & API

  • .NET 10 with ASP.NET Core for the REST API layer
  • Entity Framework Core with PostgreSQL for relational data
  • MongoDB (via official driver) for time-series telemetry and predictions
  • Redis (via StackExchange.Redis) for job tracking and caching
  • Quartz.NET for scheduled background job execution
  • FluentValidation for declarative input validation
  • ASP.NET Identity for cookie-based authentication with role management

Frontend

  • React 19 with TypeScript and Vite (Rolldown bundler)
  • TanStack Router for file-based type-safe routing
  • TanStack Query for server state management
  • Tailwind CSS v4 with Radix UI and shadcn/ui components
  • Recharts for data visualization and Leaflet for geospatial maps
  • Framer Motion for animations

Machine Learning

  • Python 3.12 with Flask (served via Gunicorn)
  • XGBoost and scikit-learn for gradient-boosted tree models
  • pandas and NumPy for data processing
  • joblib for model serialization to MinIO

Messaging & Storage

  • EMQX v5.8 as the MQTT broker with HTTP-based authentication callbacks
  • MQTTnet for .NET MQTT client connectivity
  • MinIO for S3-compatible object storage (model artifacts, user uploads)
  • SendGrid for transactional email delivery

DevOps & Deployment

  • Docker for containerization of all services
  • Jenkins for CI/CD pipeline automation
  • Traefik as the reverse proxy with automatic Let's Encrypt SSL
  • nginx for static frontend and docs hosting

Documentation Structure

This documentation is organized into the following sections:

SectionContents
ArchitectureSystem design, data flow diagrams, module relationships, and design decisions
DatabaseComplete schema reference, entity relationships, MongoDB collections, and migration history
Business LogicDetailed service-by-service documentation of all business rules and workflows
API ReferenceComplete REST API documentation with endpoints, request/response schemas, and examples
DeploymentLocal development setup, Docker configuration, CI/CD pipeline, and production deployment
Code ReferenceSource code organization, constants, configuration, and internal conventions