How sahil-karkar/dysa-smart-energy works
DYSA is a simulated home-energy dashboard: a visitor explores a home, changes scenarios or circuits, and sees room-level usage, safety notices, pattern analysis, and analytics. The dashboard and 3D scene use the API to read or change session-scoped home state; the API builds simulated readings and evaluates alerts. Pattern analysis has both server-side model evaluation and browser-worker analysis, while the README also documents forecasting and replay. Some UI and model implementations were not sampled, so those subsystems are retained without guessing their internal call paths.
Main entry points: profiles.mjs Home state and API · main.tsx Energy dashboard · security.mjs API security · build-worker.mjs Worker API entry
Components 17
Home experience
- Energy dashboard
src/main.tsx - ML insights
src/MLInsights.tsx - Home setup
src/HomeSetup.tsx - 3D home scene
simulator/home.js - Scene bootstrap
simulator/boot.js - Control synchronization
simulator/control-sync.js
Home simulation
- Home state and API
profiles.mjs - Safety rules
profiles.mjs
Energy analysis
- Isolation Forest model
isolation-forest.mjs - Browser pattern analysis
src/isolation-worker.js - Usage analytics
profiles.mjs
API and persistence
- API security
security.mjs - Worker API entry
build-worker.mjs - Local server
server.mjs - SQLite adapter
local-db.mjs - Home data store
Other components
- Visitor
Connections 21
- Visitor → Energy dashboard: explores
README.md - Visitor → 3D home scene: operates
README.md - Energy dashboard → Home state and API: requests home data
- Energy dashboard → ML insights: presents analysis
- Energy dashboard → Home setup: configures homes
- Scene bootstrap → 3D home scene: loads
simulator/boot.js - 3D home scene → Control synchronization: uses controls
simulator/home.js - Control synchronization → Home state and API: requests state and changes
simulator/control-sync.js - Home state and API → Safety rules: evaluates load
profiles.mjs - Home state and API → Isolation Forest model: evaluates usage
profiles.mjs - Home state and API → Usage analytics: builds usage history
profiles.mjs - Energy dashboard → Browser pattern analysis: runs pattern analysis
- ML insights → Browser pattern analysis: shows pattern results
- Worker API entry → API security: secures API requests
build-worker.mjs - Worker API entry → Home state and API: dispatches API
build-worker.mjs - API security → Home state and API: authorizes and invokes
build-worker.mjs - Local server → Worker API entry: forwards requests
server.mjs - Local server → SQLite adapter: opens database
server.mjs - Home state and API → Home data store: reads and writes
profiles.mjs - API security → Home data store: reads and writes limits and sessions
security.mjs - SQLite adapter → Home data store: implements local storage