Skip to content

dengxp/terra-ems-server

Repository files navigation

Terra EMS Server β€” Backend Service

Terra Energy Management System β€” Enterprise-grade Energy Management & Carbon Analysis Platform

Java 21 Spring Boot PostgreSQL Redis Docker MIT License

πŸ—οΈ System Architecture

Terra EMS System Architecture

δΈ­ζ–‡ζ–‡ζ‘£ | English


πŸ–ΌοΈ System Screenshots

Dashboard V3 Pro Branch Analysis

Price Policy Carbon Analysis


πŸ“‹ Introduction

Terra EMS Demo Video

Terra EMS (Terra Energy Management System) is a modern energy management platform designed for industrial enterprises. Built with Spring Boot 3.4 and Spring Data JPA, it provides comprehensive features including energy monitoring, TOU (Time-of-Use) electricity analysis, cost accounting, carbon emission measurement, energy benchmarking, and smart alerting.

πŸ“¦ Frontend Repository: terra-ems-web

πŸš€ Online Demo

Tip

Key Innovations:

  1. High-Performance Edge Computing: Rust-based gateway supporting thousand-level point collection, with disk-level Local Cache to ensure zero data loss during network flips.
  2. Minute-Level Deployment: Support for YAML site configuration import, enabling one-click initialization of the entire site hierarchy (Site-Gateway-Meter-Point).

✨ Core Features

Module Description Status
πŸ”‹ Base Data Energy types, Energy units (tree structure), Meters, Sampling points βœ…
πŸš€ Fast Deploy One-click YAML Site Import, Auto-initialization βœ…
πŸ›‘οΈ Edge Intel Rust Collector, Local Cache, Transparent Transmission βœ…
πŸ“Š Statistics Consumption stats, YoY/MoM analysis, Trend analysis, Ranking, Dashboards βœ…
⚑ Peak & Valley TOU pricing policy configuration, peak/valley/flat usage analysis βœ…
πŸ’° Cost Mgmt Price policy management, cost binding, cost records & variance analysis βœ…
🌍 Carbon Carbon emission calculation, trend analysis, ranking βœ…
🎯 Benchmarking Energy benchmarking (National/Industry/Enterprise/Regional standards) βœ…
🌱 Energy Saving Lifecycle tracking of energy-saving projects, policy & regulation mgmt βœ…
⚠️ Alerting Limit types, pre-alarm configuration, alert records & processing βœ…
πŸ“– Knowledge Energy-saving knowledge base (Markdown support) βœ…
🏭 Production Product information, production record management βœ…
πŸ‘€ System Mgmt Users, Roles, Depts, Posts, Menus, Permissions, Dicts, Configs βœ…
πŸ“‹ Monitoring Login logs, Operation logs, Online users, Cache management βœ…

πŸ› οΈ Tech Stack

Category Technology Version
Language Java 21 / Rust 1.82+ β€”
Message Bus EMQX (MQTT 5.0) 5.x
Business DB PostgreSQL 17
TSDB GreptimeDB 0.9+
Cache Redis 6+
Backend Spring Boot 3.4.4
Frontend React + TypeScript + Ant Design Pro β€”

πŸ“ Project Structure

terra-ems-server/
β”œβ”€β”€ terra-ems-common/       # Common module: Result, ErrorCodes, Utilities
β”œβ”€β”€ terra-ems-framework/    # Framework module: Security, JPA Base, Controller Hierarchy
β”œβ”€β”€ terra-ems-system/       # Business module: Entity, Repository, Service (System + Business)
β”œβ”€β”€ terra-ems-admin/        # Admin module: Bootloader, Controllers, API definitions
β”œβ”€β”€ database/               # SQL scripts
└── Dockerfile              # Docker build file
### 3. All-in-One Start (Docker Compose)

If you have both `terra-ems-server` and `terra-ems-web` cloned in the same parent directory:

```bash
docker-compose up --build

This will spin up PostgreSQL, Redis, the Backend (8081), and the Frontend (80) automatically.


πŸš€ Quick Start

1. Database Initialization

# Using combined init script (includes schema + demo data)
psql -U postgres -d terra_ems -f database/combined_init_postgres.sql

2. Build & Run

mvn clean install -DskipTests
cd terra-ems-admin
mvn spring-boot:run

Access Swagger UI: http://localhost:8081/api/swagger-ui.html


🀝 Contribution & Feedback

We welcome bug reports, feature suggestions, or usage inquiries via Issues.

Important

About Pull Requests (PR): To maintain project architectural consistency and ensure the stability of future commercial roadmap, we are not currently accepting external code contributions (Pull Requests). We appreciate your understanding and welcome discussions through Issues.


πŸ“œ License

MIT License β€” Copyright Β© 2025-2026 Terra Technology (Guangzhou) Co., Ltd.

About

🌿 Terra EMS Backend. Based on Spring Boot 3.4 & Java 21. Features energy monitoring, TOU pricing, cost analysis, carbon tracking, and enterprise RBAC. A robust framework for rapid Web development.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages