oligo / gioview

Gio-view: A Toolkit for Faster Gio App Development
MIT License
59 stars 6 forks source link

Nats Jetstream example #2

Closed gedw99 closed 4 months ago

gedw99 commented 4 months ago

Add a simple example for data and images using NATS Jetstream.

this will automatically make the example do real time sync between all users using the app. When an image or data changes all users will get the change either online ( instantly ) or offline ( when they go back on line , it will push the message updates they missed ).

A nats leaf server can be embedded for full offline editing and sync. https://docs.nats.io/running-a-nats-service/configuration/leafnodes/jetstream_leafnodes explains it.

migrations:

Stare is stored on the NATS server.

if the data types change then the data stored in NATS must be migrated.

The typical solution to this is to use protobufs for data.

For images it’s fine because they are just binary , but we should sniff the image type and switch in the code .

web:

gio supports WASM and so does nats.go. So web works fine too

oligo commented 4 months ago

Hi, would you please make it a dedicated showcase in the example directory? Please send a PR when it's ready.

gedw99 commented 4 months ago

Yes 👍

gedw99 commented 4 months ago

Suggest we use this as a base

https://github.com/oderwat/go-nats-app

The gui is WASM , and so is gio for web at least

WSS should now work btw. Caddy also if you know what caddy is. That’s why the ports are hard coded to localhost - designed to be proxies through caddy.

gedw99 commented 4 months ago

Then add marmot nats for SQLite replication as every app needs this and we reuse the nats server.

https://github.com/maxpert/marmot

this allow event streaming with gio which is very powerful because a mutation event can update the DB as well as for example a bleve faceted search store . Check bleve ( a golang store for free text and facet search ) at https://github.com/blevesearch/bleve

gedw99 commented 4 months ago

this will be added to a different repo as it brought in too many dependencies. not sure which repo yet.

oligo commented 4 months ago

I close this issue as we have not plan on this example.