What the best approach for rendering complex interactive UI in Rails?

We use the next UI stack for implementing the feature of rendering objects on the map (https://deck.gl):

 Rails
 HotWire
 StimulusJS
 ViewComponent

But with the growing business logic, our map_controller.js became so big, and it’s hard to maintain for future perspective.

Generally, the Map UI feature consists of several parts:

MapComp
  -> FilterComp
    -> ObjectsComp
      -> ObjectComp
  -> SearchComp
    -> ObjectsComp
      -> ObjectComp

MapComp - the main component that renders items on the map, with the ability to interactively click on it and show details ObjectComp in sidebar.

So what is the best architecture for complex UI?
There is any best practice for building complex UI in Rails/HotWire/Stimulus/ViewComponent paradigm?
There is any good guide or sources with a good example?
Or possibly the best way for such a problem is a front-end approach like Vue/React?

Thanks!

1 Like