Skip to content

Design Discussions Modular View Server

chrisjstevo edited this page Oct 9, 2021 · 12 revisions

What do we mean by making the Vuu server modular?

A modular view server would allow us to add tables, rpc services, rest services, custom view port logic and UI components via a simple programmatic or declarative method.

Why is this good?

It means that when a consumer of the view server wants to use it for their project, they have to have little or no knowledge of the view server internals. They can simply reference a binary via a dependency mechanism (such as maven, gradle or node) and use that in their project, with the knowledge that the base server config is functionality is provided out of the box.

But wait, isn't the view server already modular?

Well, yes, on the server side it is already modular. For example a project could reference the binary of Vuu from a maven repository and then add a new module defied in their project as below:

  val config = VuuServerConfig(
    VuuHttp2ServerOptions()
      .withWebRoot("../vuu-ui/dist/app")
      .withSsl("vuu/src/main/resources/certs/cert.pem",
               "vuu/src/main/resources/certs/key.pem")
      .withDirectoryListings(true)
      .withPort(8443),
    VuuWebSocketOptions()
      .withUri("websocket")
      .withWsPort(8090)
  ).withModule(MyCustomModule()) //added my module here...
   .withModule(MetricsModule())
   .withModule(VuiStateModule(store))

This would create all the server side parts required of the view server with the custom MyCustomModule() supplied. (note: we should make the metrics and VuiStateModules added by default.

Clone this wiki locally