Skip to content

Improve internal data model#608

Merged
FlorianK13 merged 7 commits into
mainfrom
feature-internal-data-model
May 29, 2026
Merged

Improve internal data model#608
FlorianK13 merged 7 commits into
mainfrom
feature-internal-data-model

Conversation

@FlorianK13
Copy link
Copy Markdown
Member

Internal Data Model Refactor

This PR introduces a proper internal data model for the 3D viewer, replacing the loosely-typed structures that were previously passed around.

What changed:

  • Added typed definitions in src/types/ for PVSystem, Building, Scene, Simulation, and related domain objects
  • Replaced the window.* state bridge with explicit return values, making data flow clearer and more predictable
  • Cleaned up SceneContext and hover state types to align with the new model
  • Refactored PVSystems.jsx, pvSystemCreation.js, and related modules to use the new types consistently
  • Added jsconfig.json and TypeScript tooling (tsc) to catch type errors at dev time

The previous approach used ad-hoc object shapes spread across the codebase, making it hard to refactor or extend the simulation logic. The new type definitions serve as a single source of truth for the data flowing through the viewer.

- Add jsconfig.json with tsc validation (@/* alias, checkJs per-file)
- Install typescript and @types/three as dev dependencies
- Split src/types/simulation.js into focused files: building, simulation,
  vegetation, pvSystem, frontendState, scene
- Add FrontendState runtime const (fixes ErrorAdress typo → ErrorAddress)
- SimulationResult is now defined as scene-level, not per-building
@FlorianK13 FlorianK13 merged commit 35c04b0 into main May 29, 2026
2 checks passed
@FlorianK13 FlorianK13 deleted the feature-internal-data-model branch May 29, 2026 17:25
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