How thedeductor/jarvis works
JARVIS is an HVAC digital-twin simulator and control dashboard. Occupants and facility managers use the frontend to inspect live building state, adjust simulation and environment controls, or submit comfort complaints. The API routes these operations through the simulation manager, which applies constraint and tariff overlays and advances the twin; physics models calculate thermal, IAQ, energy, and comfort outcomes. An optional PPO policy supplies autonomous control, while weather and NLP use external services. The frontend and API excerpts are partial, so uncertain endpoint-to-panel wiring is not expanded.
Main entry points: digital_twin.py Building twin · simulation_manager.py Simulation manager · main.py HTTP API · App.tsx Dashboard app
Components 23
Dashboard
- Dashboard app
frontend/src/App.tsx - Controls and views
frontend/src/components - API client
frontend/src/api.ts
API and orchestration
- HTTP API
backend/main.py - Simulation manager
backend/simulation_manager.py - Constraint lifecycle
backend/simulation_manager.py - Tariff response
backend/simulation_manager.py - Authentication
backend/auth.py - Database access
backend/database.py
Digital twin
- Building twin
backend/digital_twin.py - Thermal model
backend/thermal_model.py - IAQ model
backend/digital_twin.py - Energy model
backend/energy_model.py - Comfort model
backend/comfort_model.py - Baseline twin
backend/baseline.py
AI and services
- PPO controller
rl/agent.py - RL environment
rl/env/building_env.py - Complaint parser
backend/nlp_engine.py - Weather service
backend/weather_service.py
Other components
- Occupants / managers
- Groq LLM
- Open-Meteo
- Application database
Connections 23
- Occupants / managers → Dashboard app: use
- Dashboard app → Controls and views: renders
- Dashboard app → API client: requests
- API client → HTTP API: REST calls
- HTTP API → Simulation manager: controls and queries
- Simulation manager → Building twin: advances and controls
- Simulation manager → Constraint lifecycle: manages
- Simulation manager → Tariff response: applies
- Building twin → Thermal model: calculates
- Building twin → IAQ model: calculates
- Building twin → Energy model: calculates
- Building twin → Comfort model: calculates
- Building twin → Baseline twin: compares
- Simulation manager → PPO controller: executes policy
- RL environment → Building twin: simulates with
- Simulation manager → Complaint parser: parses complaints
- Complaint parser → Groq LLM: prompts
- HTTP API → Weather service: requests weather
- Weather service → Open-Meteo: fetches conditions
- HTTP API → Authentication: authenticates
- Authentication → Database access: queries users
- HTTP API → Database access: persists events
- Database access → Application database: reads and writes