gruelbox/orko

Bit of refactoring in progress

badgerwithagun opened this issue · 1 comments

I've been trying to clean up the front end code (I've learned a lot about front end architecture since started writing Orko) to improve and localise state management, reduce dependency on Redux and incorporate React Hooks. I'm also working towards more sensible JS bundles, specifically targeting having the login code in a specific bundle which is the only one visible when not logged in.

What has become clear is that a clean React application (with unidirectional messaging) and two-way websockets (bidirectional messaging) are not good bedfellows. The only reason we have two-way messaging is to reduce the message volume to only those messages related to the coin currently focused, but to be hones, that could easily be achieved by disconnecting, reconnecting and subscribing on handshake and it would simplify the architecture all the way down.

I'm looking at removing the concept of stateful websockets from the backend, replacing them with a gateway such as Pushpin. This would open an easy route to minimising the stateful part of the back end (fetching, aggregating and caching all the data from the various exchanges) to a dedicated service and splitting apart the APIs to separate, stateless services.

This should all make everything a lot simpler to follow and in the process eliminate weird bugs like #394. It should then be much easier to implement features like #369 which I've been slow to implement.

First tranche of changes - #501 - merged.

More to come - plenty of TODOs!