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:
- Install the Phoenix dependencies.
- Install the Node.js dependencies using the command
npm install --prefix assets
. - Create the database.
- Start the Phoenix server.
For deploying the project on Fly.io:
- Remove the
fly.toml
file. - Initialize and deploy the project using Fly commands.
- 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.