mearaj / bhagad-house-booking

MIT License
3 stars 2 forks source link

networking using websockets. #8

Closed gedw99 closed 1 year ago

gedw99 commented 2 years ago

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.