- Remove frontend/ and nginx/ from core (each customer owns their frontend) - Update docker-compose.yml to backend-only (postgres + redis + backend) - Update docker-compose.prod.yml to backend-only - Add CLAUDE.md with dev guidelines - Update README.md with new architecture diagram Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1.3 KiB
1.3 KiB
EMS Core Development Guidelines
Overview
This is the shared core library for all EMS customer projects. Changes here affect ALL customer deployments.
Golden Rules
- All changes must go through Pull Request with code review
- Follow Conventional Commits:
<type>(<scope>): <description> - Types: feat, fix, refactor, docs, test, chore, style, perf
- Scopes: api, models, services, collector, hooks, tasks, config
Architecture
backend/app/api/v1/— API endpoint modulesbackend/app/collectors/— Device data collectors (Sungrow, Modbus, MQTT, HTTP)backend/app/hooks/— Customer plugin system (base + loader)backend/app/models/— SQLAlchemy ORM modelsbackend/app/services/— Business logic layerbackend/app/tasks/— Background tasks (Celery + APScheduler)backend/alembic/— Database migrations- Note: Frontend is NOT included in ems-core. Each customer repo owns its own frontend.
Database Migrations
- Every model change requires an Alembic migration
- Test migrations before deploying:
alembic upgrade head - Never manually edit
alembic_versiontable
Testing
- Run tests:
cd backend && pytest - Minimum test coverage for new features
Version
- Follow SemVer (MAJOR.MINOR.PATCH)
- Current: see VERSION file