Initial commit: Tianpu Zero-Carbon EMS Platform

Full-stack energy management system for Tianpu Daxing campus.
- Frontend: React 19 + TypeScript + Ant Design + ECharts
- Backend: FastAPI + SQLAlchemy + PostgreSQL/TimescaleDB
- Features: PV monitoring, heat pump management, carbon tracking, alarms, reports

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Du Wenbo
2026-04-01 13:36:06 +08:00
commit f53a610a19
77 changed files with 8904 additions and 0 deletions

18
scripts/init_db.py Normal file
View File

@@ -0,0 +1,18 @@
"""数据库初始化 - 创建所有表"""
import asyncio
import sys
sys.path.insert(0, "../backend")
from app.core.database import engine, Base
from app.models import * # noqa: F401, F403
async def init():
async with engine.begin() as conn:
await conn.run_sync(Base.metadata.create_all)
print("All tables created successfully!")
await engine.dispose()
if __name__ == "__main__":
asyncio.run(init())