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
| Capability | Description |
|---|---|
| Real-Time Monitoring | Sub-second telemetry ingestion via MQTT and Webhook protocols with 30+ normalized metrics per data point |
| Predictive Forecasting | Physics-aware XGBoost ML models producing 7-day solar production, load consumption, and battery state-of-charge forecasts |
| Financial Analytics | Granular ROI calculations with historical kWh price tracking, payback period estimation, and cumulative savings projections |
| Fleet Management | Hierarchical Power Group organization with batch metrics, fault detection, and multi-source dashboards |
| Weather Integration | Automated 8-day weather forecasts correlated with solar production via Open-Meteo API |
| Data Export | CSV and Excel export with aggregated summary sheets for compliance and reporting |
| Public Sharing | Granular, 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:
| Module | Layer | Technology | Responsibility |
|---|---|---|---|
Ampra.Core | Domain | .NET 10 | Entities, enumerations, constants, configuration models, exception types |
Ampra.Application | Application | .NET 10 | Service interfaces, DTOs, request/response models, FluentValidation rules |
Ampra.Infrastructure | Infrastructure | .NET 10, EF Core | Service implementations, PostgreSQL/MongoDB data access, external API integrations |
Ampra.Web | Presentation | ASP.NET Core | REST API controllers, middleware, background jobs, authentication, DI configuration |
Ampra.UI | Client | React 19, TypeScript | Single-page application with real-time dashboards, charts, and management interfaces |
Ampra.ML | Intelligence | Python 3.12, Flask | XGBoost model training, physics-aware prediction engine, job orchestration |
Ampra.MQTT | Ingestion | .NET 10, MQTTnet | Background 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:
| Section | Contents |
|---|---|
| Architecture | System design, data flow diagrams, module relationships, and design decisions |
| Database | Complete schema reference, entity relationships, MongoDB collections, and migration history |
| Business Logic | Detailed service-by-service documentation of all business rules and workflows |
| API Reference | Complete REST API documentation with endpoints, request/response schemas, and examples |
| Deployment | Local development setup, Docker configuration, CI/CD pipeline, and production deployment |
| Code Reference | Source code organization, constants, configuration, and internal conventions |