SPLASH 2023
Sun 22 - Fri 27 October 2023 Cascais, Portugal
Tue 24 Oct 2023 11:30 - 12:00 at Room VI - PLF Talks 1

TypeCell is an open source, local-first knowledge base and document management system (similar to Notion) with Live Programming capabilities and extensibility. Over the last two years, I’ve worked on several open source projects in the Local-First ecosystem. In this talk, I’d love to share my learnings building Local-First software by walking you through the experiments I’ve worked on, architectural challenges, and opportunities I see ahead.

One of the under-appreciated aspects of Local-First architecture is that by design, you need to abstract the data (syncing) layer from the rest of the application. This abstraction makes it easier to connect the View layer to your data store, or connect different (pluggable) backends which I’ll further explain below.

UI Techniques In my applications, I employ a Reactive programming model. This allows you to create views that instantly react to changes in the underlying data model, with a minimum amount of code. I will show you how I built SyncedStore to fill in the gap between the Yjs CRDT library and UI libraries that support reactivity in the View layer (MobX+React and Vue in particular).

Experimental backends Because the Yjs (and Automerge) libraries in essence operate on a stream of updates that are hydrated into an eventually consistent “state” instead of a traditional architecture that works with a “single source of truth”, there’s the surprising possibility of using infrastructure designed for Chat / messaging systems as the transport and storage of application state.

In my experiments, I’ve released Matrix-CRDT and Nostr-CRDT, which enable you to use Matrix or Nostr as the backend of a Local-First application. Without writing your own backend, you can get the benefits of a decentralized architecture, a users and permissioning system, and possibly end-to-end encryption out-of-the-box. I’ll share my experience building on top of these networks, and also the limitations that come with this approach.

Challenges / opportunities Because of some limitations with these experimental architectures, in the latest iteration, I have opted for a backend built on top of Supabase (Postgres). The backend layer is still very agnostic to the data stored compared to traditional backend design.

I’ll discuss the TypeCell document model and architecture of the new backend, including how we now handle more complex features such as Cascading Document Permissions, cross document References, and search. I’ll also explain why I think there’s an opportunity here for a framework or service that would handle most of this for application authors.

About the author Yousef El-Dardiry is a software engineer with an entrepreneurial background. During his sabbatical after co-founding Relive (outdoor app with 15M+ users), he got interested in Local-First software and Rich Text editing. This led him on a long and somewhat bumpy road building TypeCell; hoping to democratize the way we build software and give more agency to consumers of software in an increasingly digital world.

Besides the projects mentioned above he made contributions to HocusPocus (a Yjs backend), Yjs, Tiptap, Prosemirror and is developing an open source Block-Based text editor component (BlockNote).

Links: https://twitter.com/yousefed https://syncedstore.org/ https://github.com/yousefed/matrix-CRDT/ https://github.com/YousefED/nostr-crdt

Tue 24 Oct

Displayed time zone: Lisbon change

11:00 - 12:30
PLF Talks 1PLF at Room VI
11:00
30m
Talk
Collaborative offline-first applications in Education
PLF
Annette Bieniusa University of Kaiserslautern-Landau, Christopher Thyssen University of Kaiserslautern-Landau
11:30
30m
Talk
Local-first: experiments & lessons learned building TypeCell
PLF
12:00
30m
Talk
Proposal: Versioned Collaborative Documents
PLF
Matthew Weidner Carnegie Mellon University