Files
zpark-ems/README.md

126 lines
3.0 KiB
Markdown
Raw Normal View History

# Z-Park Medical Device Hub EMS (zpark-ems)
> Z-Park Medical Device Hub Smart Energy Management System
**Current Version: 1.2.0** | Core: 1.1.0 | See `VERSIONS.json`
Customer project for Z-Park Medical Device Hub (中关村医疗器械园), built on [ems-core](http://100.69.143.96:3300/tianpu/ems-core).
---
## Park Characteristics
- PV-focused: 4,561 solar panels across 22+ buildings
- Sungrow string inverters: AP101-AP208, 10 units
- DC combiner boxes: 49 units
- Data collection: Sungrow iSolarCloud API
---
## Directory Structure
```
zpark-ems/
+-- core/ # EMS core (git subtree, DO NOT modify directly)
+-- frontend/ # Customer frontend (React/TypeScript)
| +-- src/ # React source code
| +-- Dockerfile # Frontend container
| +-- package.json
| +-- vite.config.ts
+-- customers/zpark/ # Customer configuration
| +-- config.yaml # Branding and feature flags
| +-- devices.json # Sungrow inverter & combiner box inventory
| +-- pricing.json # Beijing C&I time-of-use pricing
| +-- hooks/ # Customer hooks plugin (zpark_hooks.py)
+-- scripts/ # Data seeding scripts
| +-- seed_zpark.py # Z-Park seed data
+-- docker-compose.override.yml # Customer Docker overrides
+-- docker-compose.ports.yml # Port configuration
+-- VERSIONS.json # Version tracking
+-- .env.example # Environment variables template (incl. Sungrow API)
```
---
## Quick Start (Docker)
```bash
# Configure environment
cp .env.example .env
# Edit .env — fill in Sungrow iSolarCloud API credentials
# Start all services
docker compose -f core/docker-compose.yml -f docker-compose.override.yml up -d
# Seed data
docker compose -f core/docker-compose.yml -f docker-compose.override.yml exec backend python scripts/seed_zpark.py
```
### Access
| Service | URL |
|---------|-----|
| Frontend | http://localhost:3000 |
| Backend API | http://localhost:8000 |
| API Docs | http://localhost:8000/docs |
### Default Login
| Role | Username | Password |
|------|----------|----------|
| Admin | admin | admin123 |
---
## Local Development
### Backend
```bash
cd core/backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
python -m alembic upgrade head
uvicorn app.main:app --port 8000 --reload
```
### Frontend
```bash
cd frontend
npm install
npm run dev
# Opens at http://localhost:3000, proxies /api to localhost:8000
```
---
## Sungrow API Configuration
Fill in Sungrow iSolarCloud API credentials in `.env`, then set `USE_SIMULATOR=false` to connect to real data.
---
## Updating Core
When ems-core releases a new version:
```bash
git subtree pull --prefix=core ems-core main --squash
```
Make sure the `ems-core` remote is configured:
```bash
git remote add ems-core http://100.69.143.96:3300/tianpu/ems-core.git
```
After pulling, update `core_version` in `VERSIONS.json`.
---
## License
Copyright 2026. All rights reserved.