Liveview Svelte Pwa screenshot

Liveview Svelte Pwa

Author Avatar Theme by Thisistonydang
Updated: 26 Sep 2024
265 Stars

Local-First LiveView Svelte ToDo App

Overview:

The Local-First LiveView Svelte ToDo App is a demo showcasing an installable Phoenix Progressive Web App (PWA) that allows real-time synchronization across multiple devices while also functioning locally offline. It utilizes technologies like Phoenix LiveView, Svelte, and Yjs to achieve these features.

Features:

  • Real-time synchronization: Syncs data across multiple devices in real-time.
  • Offline functionality: Ability to work locally offline without an active internet connection.
  • Phoenix LiveView: Utilizes Phoenix LiveView for real-time syncing and data persistence.
  • Svelte frontend: Uses Svelte for the frontend UI and state management.
  • Service Workers & Web Storage: Implements service workers, web storage, and IndexedDB for offline support.
  • CRDTs with Yjs: Resolves conflicts between distributed app states using Conflict-free Replicated Data Types (CRDTs) with Yjs.

Installation:

To run this app locally after cloning the repo:

  1. Install the Phoenix dependencies.
  2. Install the Node.js dependencies using the command npm install --prefix assets.
  3. Create the database.
  4. Start the Phoenix server.

For deploying the project on Fly.io:

  1. Remove the fly.toml file.
  2. Initialize and deploy the project using Fly commands.
  3. Ensure a Postgres database is included in the configuration settings.

Summary:

The Local-First LiveView Svelte ToDo App is a powerful demonstration of a Progressive Web App that offers real-time synchronization across devices and offline functionality. By leveraging technologies like Phoenix LiveView, Svelte, and Yjs, this app showcases the potential for seamless cross-device collaboration and data persistence.