The other very nice aspect is that your golang types are now essentially shared between the frontend and backend.
We might refactor and create a package called "shared".
Later, this also makes it easy to make a CLI that communicates with the backend over the same websockets using the same types.
The CLI can operate locally or remotely of course.
If we do then suggest that all CLI commands have an option to return JSON. The reason is because then the shared package works for the GUI and the CLI. Its seems like the "shared" package is the place to also add the "ToJson" function; Its like the old generics method of "ToString", but for JSON.
The frontend and backend need a networking layer that works for Web ( WASM), Desktop and Mobile ).
There are a zillion ways to do this, but a websocket works on all of them.
https://git.sr.ht/~whereswaldon/pointstar uses this technique and is a good reference. NOTE: nhooyr.io/websocket is important because it works with GUI WASM.
The other very nice aspect is that your golang types are now essentially shared between the frontend and backend. We might refactor and create a package called "shared".
Later, this also makes it easy to make a CLI that communicates with the backend over the same websockets using the same types. The CLI can operate locally or remotely of course.