tonydang
Hi everyone! I’m new to the forums and new to Elixir in general. To learn Elixir, I recently just completed my first app. It’s a todo app built with Phoenix LiveView, but with a twist, it can also work offline ![]()
By using the LiveSvelte package, I was able to use LiveView to render Svelte components which allows for offline-support. I know an offline app was not what LiveView was intended for, but I thought it was neat that it was possible to still use LiveView in such an app.
I haven’t gotten the chance to dive deeper into Phoenix Channels yet so I’m not sure if the app would perform better just using that instead. However, so far the app has been working well for me and the DX of using LiveView has been great. Anyhow, I thought I would share in case anyone else is interested in building offline-enabled apps with LiveView ![]()
Here’s a video I made walking through how I made the app:
Source code:
Live Demo:
Any questions and feedback welcomed!
Trending in Discussions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 27 to 18- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
tonydang
Whoa, thanks for sharing! I’ll definitely check it out when I get the chance.
It’s also awesome that the creator of Yjs mentioned he’d add the project to the Yjs README. Hopefully, that will get more people to try it out.
And thanks for the kind words about the Yjs/Svelte/LiveView example! I’m really glad it was helpful.
mmmrrr
I just saw that someone created a wrapper for y-crdt (the Rust library) in elixir: https://github.com/satoren/y_ex
Here is the announcement post on the YJS forum: https://discuss.yjs.dev/t/yrs-elixir-bindings/2826/3
That beeing said: thanks a ton for creating the example of combining yjs with svelte and live_view. It was a great read and I learned a lot from it
tonydang
Hi @andreaa, the app I built uses PostgreSQL as the database on the server-side. It also stores data locally in the browser’s IndexedDB, LocalStorage, and SessionStorage.
andreaa
Does this use any database?
mindreframer
@coen.bakker This sounds cool! Any chance of open-sourcing the Rust NIF? How much effort was it to wrap Automerge?
coen.bakker
The comparison was between the JS and the wasm version of the Automerge client side library. I actually ended up never benchmarking the two
. So I don’t know how big the difference is. But probably the Automerge community has made some comparisons in the process of building the wasm implementation. But not sure if that info is publicly available.
tonydang
That’s awesome! Sounds like using the Rust NIF turned out to be the more performant solution between the two?
coen.bakker
Oh and I remember now using the wasm version of their client side code also. To compare performance.
coen.bakker
I did the latter.
I used a Rust NIF to be able to create and merge crdt docs on the Elixir server. In combination with creating, merging and editing on the client side with their js library.
tonydang
Automerge is a really cool CRDT solution as well! I haven’t tried in much besides setting up a hello world project with it once.
I’m curious, how did you handle syncing? Were you using Automerge’s public sync server or did you build your own Phoenix solution?