Today in the Creator’s Lab, Tony Dang joins Elixir Wizards Sundi Myint and Owen Bickford to break down his journey of creating a local-first, offline-ready to-do app using Phoenix LiveView, Svelte, and CRDTs (Conflict-free Replicated Data Types).
Tony explains why offline functionality matters and how this feature can transform various apps. He shares insights on different libraries, algorithms, and techniques for building local-first experiences and highlights the advantages of Elixir and Phoenix LiveView.
Tony also shares his go-to tools, like Inertia.js for connecting Phoenix backends with JavaScript frontends, and favorite Elixir packages like Oban, Joken, and Hammer, offering a toolkit for anyone building powerful, adaptable applications.
Topics discussed in this episode:
- Tony Dang's background from mechanical engineer to web developer
- Building an offline-enabled to-do app with Phoenix LiveView and Svelte
- CRDTs: Conflict-free Replicated Data Types for merging changes offline
- How to make a LiveView app work offline
- Sending full state updates vs. incremental updates for performance optimization
- Inspiring others through open-source projects and community contributions
- Learning vanilla Phoenix and Channels to understand LiveView better
- Handling stale CSRF tokens when reconnecting to a LiveView app offline
- Exploring service workers and browser APIs for managing offline connectivity
- Balancing the use of JavaScript and Elixir in web development
- Fostering a supportive and inspiring Elixir community
Links mentioned:
Working in Elevators: How to build an offline-enabled, real-time todo app w/ LiveView, Svelte, & Yjs
Tony’s Twitter: https://x.com/tonydangblog
https://liveview-svelte-pwa.fly.dev/
https://github.com/tonydangblog/liveview-svelte-pwa
CRDT: https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type
PWA: https://en.wikipedia.org/wiki/Progressive_web_app
https://github.com/josevalim/sync
https://github.com/sveltejs/svelte
https://github.com/woutdp/live_svelte
https://github.com/yjs/yjs
https://github.com/satoren/y_ex
https://github.com/y-crdt/y-crdt
https://linear.app/
https://github.com/automerge/automerge
https://hexdocs.pm/phoenix/1.4.0-rc.1/presence.html
Vaxine, the Rich CRDT Database for ElixirPhoenix Apps | James Arthur | Code BEAM America 2022
https://github.com/electric-sql/vaxine
Hybrid Logical Clocks https://muratbuffalo.blogspot.com/2014/07/hybrid-logical-clocks.html
https://en.wikipedia.org/wiki/256_(number)
CSRF Tokens in LiveView https://hexdocs.pm/phoenixliveview/Phoenix.LiveView.html#getconnectparams/1
Information
- Show
- FrequencyUpdated weekly
- Published31 October 2024 at 10:00 UTC
- Length48 min
- Season13
- RatingClean