chore: Linearlite - Electric sync + PGlite demo app
This is a demo app demonstrating how to build a local-first app using Electric sync and PGlite. It's a clone of the Linear project management tool.
Features:
- Sync with electric
- Write through the database via a write path server
src/server.tswhere you can implement custom validation and conflict handling - Merging of non-synced edits handled in database using triggers
- Postgres FTS for the search feature
- Windowed live queries synced to the windowed/virtualised scrolling so that only the rows onscreen (and a few more) are loaded
Can handle in excess of 100k issues and 500k comments.
https://github.com/user-attachments/assets/808a4de6-8488-4a98-88d3-7d3d0a9f1641
This version replaces #368 where the modified rows are in the same table as the synced data. This improves read performance.
Built bundles:
- Postgres WASM: https://github.com/electric-sql/pglite/actions/runs/12233125505/artifacts/2292799339
- Interim build files: https://github.com/electric-sql/pglite/actions/runs/12233125505/artifacts/2292799519
- PGlite: https://github.com/electric-sql/pglite/actions/runs/12233125505/artifacts/2292844820
- Demos: https://github.com/electric-sql/pglite/actions/runs/12233125505/artifacts/2292869753
What's the status on merging and deploying this?
I've cherry picked out all the changes to PGlite + the sync plugin, they are now all in main with docs and testing, and most were released (just windowed live queries aren't).
I just need to rebase this on main and merge it. I'll try and pick that up tomorrow. I'll have a chat with @balegas on plan for deploying it.
@balegas could I get you to review the merge logic: https://github.com/electric-sql/pglite/pull/393/files#diff-9ea8511284754ad34fc4d8ee4bf19aeb0996d57e0b22ac29589580fe7e21848a
@msfstef if you have a moment early next week could you have a skim though the app code. Versions of Linerarlite have been reviewed so many times it should be relatively cursory
🚀 Deployed on https://674d78c7b97b14c75c6d5041--pglite.netlify.app
This example was moved into the main Electric monorepo