Skip to content

Make the live demo portfolio ready (v1.1.0) - #1

Merged
AddisonTech merged 10 commits into
mainfrom
claude/relaxed-mendel-sero7g
Oct 16, 2026
Merged

AddisonTech merged 10 commits into
mainfrom
claude/relaxed-mendel-sero7g

Conversation

@AddisonTech

@AddisonTech AddisonTech commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Turns the live site into a self explanatory demo of a data center power monitoring system. A visitor can open it cold, see the server wake up, and land on a working system with realistic equipment, live values, and ISA 18.2 alarm handling they can interact with.

What changed

Simulator (simulated by default, real polling behind config)

  • New 2N data center topology: utility service, standby generator, ATS, main switchboard, UPS A and B, four PDUs, mechanical panel.
  • Values are computed bottom up (IT load through PDU and UPS losses to the switchboard and active source), so totals, PUE, and currents are consistent.
  • Equipment state machines: generator crank, warm up and cooldown, ATS transfer and timed retransfer, UPS ride through and battery recharge, cooling restart after a dead bus, frequency dip on block load.
  • Scenarios: utility outage, voltage sag, PDU overload, low power factor. They fire automatically every few minutes and can be triggered from the UI.
  • 24 hours of history and alarm journal are backfilled at startup (under 0.5 s) so trends are never empty.
  • Optional Modbus TCP source (DATA_SOURCE=modbus, pymodbus in requirements-modbus.txt, example register map).

ISA 18.2 alarm management

  • State model: Normal, Unacknowledged, Acknowledged, Returned to normal unacknowledged, Shelved, Suppressed by design.
  • Deadbands and on/off delays, time limited shelving with a logged reason, designed suppression (cascade on utility failure, generator not running, panel de-energized).
  • Rationalized master alarm database with priority, consequence, and operator response for every alarm.
  • Alarm journal of every transition and operator action, plus alarm rate KPIs against ISA 18.2 targets.
  • Fixes a bug in the old engine where a high voltage warning was raised and cleared in the same scan.

Front end

  • Wake screen for Render cold starts: progress, elapsed time, explanation, health check pings to wake the API, automatic switch to live view, retry after 90 s.
  • "About this demo" panel stating the data is simulated, with event trigger buttons. Simulated data pill in the top bar.
  • Alarm banner for the highest priority unacknowledged alarm, alarm list with acknowledge and shelve, journal and alarm database tabs, state legend.
  • New one-line diagram that shows the live power path, with a portrait layout for phones.
  • Responsive layout: sidebar on desktop, icon rail on tablet, bottom tabs on phone. No horizontal page scroll at 390 px.
  • Single WebSocket feed with reconnect and stale connection watchdog. Chart pages are lazy loaded: first load JavaScript went from 169 kB to 72 kB gzipped.
  • Hash based routes (/#/alarms), so refreshing or deep linking any page works on a static host with no rewrite rule.
  • A production build without VITE_API_URL points at the live API, https://power-dashboard-api.onrender.com. An explicit VITE_API_URL still wins, and the dev server still proxies to the local backend.

Storage and API

  • History queries used mismatched timestamp formats, so the 1 h view returned the whole day. Now uses epoch columns with server side downsampling.
  • WebSocket protocol: snapshot on connect, then readings each scan and alarms on change.

Deploy, CI, docs

  • render.yaml Blueprint: static front end plus API web service, deploy from main, build filters, /api/health health check. No Render dashboard settings are required.
  • GitHub Actions CI runs backend tests, front end tests, and the production build.
  • README rewritten with the live link at the top, screenshots, what it shows, stack, and local setup. Version bumped to 1.1.0.

Tests

  • Backend (pytest, 39 tests): simulator physics and every scenario, every alarm state transition, deadband, delays, shelving, suppression, KPIs, WebSocket snapshot, streaming, ping, live alarm updates after acknowledge and shelve, REST API, Modbus decoding.
  • Front end (Vitest, 11 tests): feed reducer, WebSocket URL handling, API URL fallback.
  • Production build served by a plain static server with no rewrite rule: every route loads and survives a refresh with HTTP 200.
  • Simulator bounds checked across 60 random seeds. Render build and start commands rehearsed in a fresh clone and venv.

Utility, generator, ATS, switchboard, UPS A/B, PDUs and cooling with
physically consistent values and demo scenarios that drive alarms.
Acknowledge, return to normal, time limited shelving, designed
suppression, deadband and on/off delays, alarm rate KPIs.
Snapshot plus live readings and alarm pushes over WebSocket, alarm
journal, downsampled history, startup backfill, optional Modbus TCP.
Also use equipment names in alarm messages and blank PUE while UPS
systems carry the IT load on battery.
Cold start wake screen, About this demo panel with event triggers,
ISA 18.2 alarm list with acknowledge and shelve, alarm journal and
database, new one-line diagram, responsive layout for phones, lazy
loaded chart pages, and feed reducer tests.
Static front end plus API web service, both deploying from main with
build filters, health check, and an SPA rewrite for deep links.
Refreshing any page works on a static host without a rewrite rule, and
a production build without VITE_API_URL points at the live API.
@AddisonTech
AddisonTech merged commit e314d38 into main Oct 16, 2026
2 checks passed
@AddisonTech
AddisonTech deleted the claude/relaxed-mendel-sero7g branch October 16, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant