Skip to content

Application of Seneca for client side composition #6

@flowt-au

Description

@flowt-au

Hi.
So... I have read the Tao of Microservices. I have watched the various presentations. I have implemented some of the examples from the Seneca Getting Started page in the browser using this seneca-browser component. So far, so good.

Now...
While completely getting the value of Seneca server side, my immediate interest is in composing the client side app using Seneca.

The reason is that I have an existing old monolith client app written using a mixture of MVC and MVVM patterns. Some of the code is 5 years old. It uses REST to a server (currently using ColdFusion). The server side can remain as is - it is maintainable for now.

The client side is quite complex and, while manageable at present, will quickly become a mess if I add more functionality. The app has a number of "functional modules" the user can interface with. Apart from browser versions it is also wrapped in NW,js (Chrome plus Node) to make a desktop app for OSX, Windows and Linux because the desktop version needs access to the user's local resources (eg file system, clipboard, etc).

My idea is to migrate to a MS architecture on the client side (then later the server side). I really like the idea of designing by messages and the loose coupling / strong boundaries Seneca provides. Some of my proposed client side plugins will talk to the server via REST, some will use local storage (eg PouchDb), some will use memory only, and all will have a test interface (Cucumber), etc etc.

I am also attracted to the idea of sending messages via the server (websockets) to other connected users so each active client can get real-time changes - like a chat system but passing entity data instead of simple message text.

My question...
At an architectural level, is there some reason this client-side composition is not a good idea? It seems hardly anyone has done it. Lots of client-side "microservice" offerings are tightly bound event based patterns which is fine but is not the same as the Seneca pattern. Some of them (eg https://micro-frontends.org/ store the state in the dom which seems like an anti-pattern to me. One "state" can be represented in a view, a log, a time-travel list, a test, etc etc and in my understanding each of those would be a separate service that responds to a message.

Any thoughts on the advisability of this approach would be greatly appreciated!

Thanks so much,
Murray

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions