mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-05-11 21:28:15 +00:00
Implement a hot-reloadable mock mode system that works seamlessly in both development and production environments without requiring manual restarts or port changes. Key Features: - Backend watches mock.env and auto-reloads when changed (via fsnotify + polling) - npm commands for easy toggling: mock:on, mock:off, mock:status, mock:edit - Works in both hot-dev mode and systemd deployments - Reload completes in 2-5 seconds with no manual intervention - No port changes or process restarts required Implementation: - Extended ConfigWatcher to monitor both .env and mock.env - Added callback system to trigger ReloadableMonitor.Reload() - Enhanced toggle-mock.sh to support both hot-dev and systemd modes - Updated hot-dev.sh banner to show mock status and commands - Created comprehensive documentation in docs/development/MOCK_MODE.md Testing: - Backend builds successfully - Watcher initializes and monitors both files - npm run mock:on/off toggles successfully - mock.env updates correctly - Scripts work in both hot-dev and systemd modes Documentation: - Added Mock Mode section to README.md - Created detailed guide in docs/development/MOCK_MODE.md - Updated claude.md with mock mode architecture and usage Mock mode continues to return cached data instantly from memory (no API calls, no locks, no timeouts), ensuring fast /api/state responses. |
||
|---|---|---|
| .. | ||
| config.go | ||
| main.go | ||