tp-ems v1.0.0: 天普大兴园区EMS客户项目
基于 ems-core v1.0.0,包含: - customers/tianpu/config.yaml — 天普品牌配置和功能开关 - scripts/seed_data.py — 天普设备、用户、告警、充电桩种子数据 - docker-compose.override.yml — 天普部署配置 - core/ — ems-core v1.0.0 (git subtree) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
11
.env.example
Normal file
11
.env.example
Normal file
@@ -0,0 +1,11 @@
|
||||
# 天普大兴园区 EMS 环境配置
|
||||
CUSTOMER=tianpu
|
||||
DATABASE_URL=sqlite+aiosqlite:///./tianpu_ems.db
|
||||
REDIS_URL=redis://localhost:6379/0
|
||||
REDIS_ENABLED=true
|
||||
USE_SIMULATOR=true
|
||||
AGGREGATION_ENABLED=true
|
||||
INGESTION_QUEUE_ENABLED=false
|
||||
TIMESCALE_ENABLED=false
|
||||
SECRET_KEY=tianpu-change-this-in-production
|
||||
SMTP_ENABLED=false
|
||||
30
README.md
Normal file
30
README.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# 天普大兴园区 智慧能源管理平台 (tp-ems)
|
||||
|
||||
## 项目说明
|
||||
天普大兴园区EMS客户定制项目,基于 ems-core 标准产品。
|
||||
|
||||
## 目录结构
|
||||
- `core/` — EMS核心代码(通过git subtree引入,勿直接修改)
|
||||
- `customers/tianpu/` — 天普专属配置(设备、计费、品牌)
|
||||
- `scripts/` — 天普数据初始化脚本
|
||||
- `.env.example` — 环境变量模板
|
||||
|
||||
## 快速开始
|
||||
1. 复制环境配置:`cp .env.example core/backend/.env`
|
||||
2. 安装后端依赖:`cd core/backend && pip install -r requirements.txt`
|
||||
3. 初始化数据库:`cd core/backend && python -m alembic upgrade head`
|
||||
4. 导入种子数据:`cd scripts && python seed_data.py`(需先cd回项目根目录的scripts)
|
||||
|
||||
或者:`cd 项目根目录 && python scripts/seed_data.py`
|
||||
5. 启动后端:`cd core/backend && python -m uvicorn app.main:app --port 8000 --reload`
|
||||
6. 启动前端:`cd core/frontend && npm install && npm run dev`
|
||||
7. 访问:http://localhost:3000(admin / admin123)
|
||||
|
||||
## 更新核心代码
|
||||
当 ems-core 发布新版本时:
|
||||
```
|
||||
git subtree pull --prefix=core http://192.168.1.77:3300/tianpu/ems-core.git v1.1.0 --squash
|
||||
```
|
||||
|
||||
## 当前核心版本
|
||||
查看 `core/VERSION` 文件。
|
||||
17
customers/tianpu/config.yaml
Normal file
17
customers/tianpu/config.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
# 天普大兴园区 - 客户配置
|
||||
customer_name: "天普新能源"
|
||||
platform_name: "天普零碳园区智慧能源管理平台"
|
||||
platform_name_en: "Tianpu Zero-Carbon Park Smart EMS"
|
||||
logo_url: "/static/logo-tianpu.png"
|
||||
theme_color: "#1890ff"
|
||||
cors_origins:
|
||||
- "http://localhost:3000"
|
||||
- "http://localhost:5173"
|
||||
collectors:
|
||||
- modbus_tcp
|
||||
- mqtt
|
||||
- http_api
|
||||
features:
|
||||
charging: true
|
||||
carbon: true
|
||||
bigscreen_3d: true
|
||||
16
docker-compose.override.yml
Normal file
16
docker-compose.override.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
# 天普大兴园区 — Docker Compose Override
|
||||
# Usage: docker compose -f core/docker-compose.yml -f docker-compose.override.yml up
|
||||
version: '3.8'
|
||||
services:
|
||||
backend:
|
||||
build:
|
||||
context: ./core/backend
|
||||
environment:
|
||||
- CUSTOMER=tianpu
|
||||
volumes:
|
||||
- ./customers/tianpu:/app/customers/tianpu:ro
|
||||
- ./scripts:/app/scripts:ro
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ./core/frontend
|
||||
1008
scripts/seed_data.py
Normal file
1008
scripts/seed_data.py
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user