How naman-dua/stem-sandbox-engine works
PrecisionSTEM is a browser-based virtual physics laboratory. A learner works with a lesson’s controls and runs a simulation; the simulation controller advances lesson calculations, while scene and graph renderers present the resulting physics and history. The README also documents notebook, challenge, prediction, metrics, formula-HUD, and observation capabilities, represented by the corresponding modules where identifiable. The sampled source confirms the physics, state, and rendering boundaries, but not all UI wiring or feature-module interactions, so uncertain connections are omitted.
Main entry points: renderer.js Scene Pipeline · simulationController.js Simulation Controller · AssignmentEngine.js Challenge Assignments · engine.js Physics Engine
Components 28
Simulation Runtime
- Application State
js/stateManager.js - Simulation Controller
js/simulationController.js - Physics Engine
js/engine.js
Lessons and Rendering
- Friction Lesson
lessons/friction.js - Scene Pipeline
js/render/renderer.js - Camera
js/camera.js - Canvas Renderers
js/blockRenderer.js - Time-Series Graph
js/graphEngine.js
Learning Features
- Physics Metrics
js/MeasurementTools.js - Graph Dashboard
js/GraphDashboard.js - Lab Notebook
js/SmartLabNotebook.js - Observation Panels
js/ReflectionPanel.js - Guided Experiments
js/GuidedExperiment.js - Challenge Assignments
js/AssignmentEngine.js - Progress Tracking
js/ProgressModel.js - Experiment Comparison
js/ExperimentComparison.js - Simulation Replay
js/ReplaySystem.js - Presentation Mode
js/PresentationMode.js
Application Services
- Bootstrap
js/bootstrap.js - UI Bridge
js/uiBridge.js - Lesson Loader
js/lessonLoader.js - Manifest Validator
js/manifestValidator.js - Module Registry
js/ModuleRegistry.js - Module Registration
js/registerModules.js - Error Handling
js/ErrorHandler.js - Event Bus
js/EventBus.js - Data Store
js/DataStore.js
Other components
- Learner
Connections 9
- Simulation Controller → Physics Engine: ticks or runs
- Physics Engine → Friction Lesson: calls calculations
- Scene Pipeline → Friction Lesson: builds scene
- Scene Pipeline → Canvas Renderers: draws scene
- Scene Pipeline → Camera: projects coordinates
- UI Bridge → Time-Series Graph: supplies canvas context
- Simulation Controller → Error Handling: validates physics
- Challenge Assignments → Event Bus: subscribes and publishes
- Challenge Assignments → Data Store: loads and saves