How gedxxe/midea-jre-uniland-waste-calculator works
Midea Daily Energy Report is a browser-based energy reporting workspace for JRE and UNILAND operators, with account-owned history and a separate IoT diagnostics area. The main workflow is entering dated meter readings, calculating and reviewing energy and utility usage, then copying a report or Excel row while drafts autosave. Other documented branches include history and monitoring, imports/exports, accounts, and device diagnostics. The sampled excerpts support the calculation, draft, authentication, and database layers; several other capabilities are README-described but their runtime wiring was not sampled.
Main entry points: engine.js Usage calculation · storage.js Workspace storage · app.js Reading workspace · auth-handlers.js Authentication API
Components 23
Reading workspace
- Reading workspace
app.js
Energy calculations
- Period rules
reading-period.js - Plant meter schema
schema.js - Usage calculation
engine.js - Gas calculations
gas.js - Water calculations
water.js - Compressor calculations
air-compressor.js - Utility periods
utility-periods.js - Number handling
numbers.js
Drafts and history
- Draft records
draft-records.js - Workspace storage
storage.js - Draft sync UI
ui/drafts.js
Server services
- Account management
ui/accounts.js - Authentication API
server/auth-handlers.js - Session security
server/auth.js - Database access
server/db.js
Reports and devices
- Monitoring graphs
ui/graphs.js - Reports and exports
server/reports.js - Device diagnostics
ui/iot.js - IoT service
server/iot.js - Reading import export
importer.js
Other components
- Operator
- PostgreSQL
Connections 26
- Operator → Reading workspace: enters readings
README.md - Reading workspace → Period rules: uses period rules
app.js - Reading workspace → Workspace storage: restores workspace
app.js - Reading workspace → Usage calculation: calculates usage
app.js - Usage calculation → Period rules: checks periods
engine.js - Usage calculation → Gas calculations: calculates gas
engine.js - Usage calculation → Water calculations: calculates water
engine.js - Usage calculation → Compressor calculations: calculates compressor
engine.js - Usage calculation → Utility periods: uses utility layout
engine.js - Usage calculation → Number handling: parses readings
engine.js - Workspace storage → Usage calculation: creates drafts
storage.js - Workspace storage → Utility periods: moves utility data
storage.js - Workspace storage → Period rules: checks shift type
storage.js - Draft records → Workspace storage: persists drafts
draft-records.js - Draft sync UI → Draft records: restores records
ui/drafts.js - Draft sync UI → Workspace storage: compares workspace
ui/drafts.js - Account management → Authentication API: manages accounts
- Authentication API → Session security: checks sessions
server/auth-handlers.js - Authentication API → Database access: runs transactions
server/auth-handlers.js - Session security → Database access: queries sessions
- Database access → PostgreSQL: connects to
server/db.js - Operator → Monitoring graphs: reviews monitoring
README.md - Operator → Reports and exports: copies reports
README.md - Operator → Reading import export: imports readings
README.md - Operator → Device diagnostics: checks devices
README.md - Device diagnostics → IoT service: requests device data