tonydang

tonydang

Offline-enabled apps with Phoenix LiveView and LiveSvelte

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 :smirk:

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 :slight_smile:

Here’s a video I made walking through how I made the app:

Source code:

Live Demo:

Any questions and feedback welcomed!

Most Liked

tonydang

tonydang

Thanks for checking out the app!

And yes, I just added an MIT license. Please feel free to use the code as you please :slight_smile:

11
Post #2
arcanemachine

arcanemachine

Very cool. I tried it out and it works as promised.

Would you mind putting a license on the repo so that I know what I’m allowed to do with the code?

mmmrrr

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 :slight_smile:

Last Post!

tonydang

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. :smiley:

And thanks for the kind words about the Yjs/Svelte/LiveView example! I’m really glad it was helpful.

Where Next?

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2976 91332 914
New
f0rest8
Hi everyone :waving_hand: Posting here to showcase and announce that Metamorphic is now officially live on a public-facing domain at htt...
New
andrielfn
Hey there :waving_hand: I want to introduce Fluxon UI, a modern UI component library for Phoenix LiveView that I have been working on fo...
New
byu
@chrismccord : I just saw the Extract AGENTS.md from Phoenix.new into phx.new generator commit to the phoenix project. My initial shotgu...
New
arcanemachine
I was working on an Ecto migration and I needed a timestamp. So, for the nth time, I looked up the different data types for timestamps, a...
New
AstonJ
Just a general thread to post chat/news/info relating to AI/ML stuff that may be relevant for Nx now or in the future. Got anything to sh...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
kip
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
webofbits
Squid Mesh is an open source workflow automation runtime for Elixir applications. It is aimed at Phoenix and OTP apps that want to defin...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
kip
In 2021 I started a new library called Tempo with the objective of modelling time as a set of intervals - not as instants. In 2022 I gave...
New

We're in Beta

About us Mission Statement