cloudpeers / tlfs

The Local-First SDK
https://cloudpeers.co
MIT License
64 stars 3 forks source link
local-first p2p

The Local-First SDK

License dependency status

PRs welcome commits contributors

Philosophy

There is no cloud, it's just someone else's computer.

The Local-First SDK offers a stack to write applications as productively as when using state-of-the-art cloud-based architectures, while providing the Seven Ideals for Local-First Software 0 -- basically for free:


Components

The Local-First SDK comprises the following components:

  1. User and Access Control: ... (key management, acl)
  2. Multi-Device Support and Collaboration: ... (device auth, p2p, peer discovery (mdns and via cloud peer))
  3. Data Persistence ... (cloud peer or self-hosted)
  4. Multi device support and interoperability ... (browser, native, android/ios?)

Artifacts

The Local-First SDK comes in three flavours:

  1. An opinionated Javascript package (with Typescript bindings) to write Local-First applications targeting the browser.
  2. A library which can be embedded into other applications, either as a rust library or a C-compatible FFI.
  3. A native, permanent process shepherding the user's data. Applications can interface with this daemon via HTTP.

The Local-First Javascript SDK

As the browser's API guarantees are weak, its environment has to be considered ephemeral[^1]. This is why the optional Cloud-Peer supplemental services complement the browser environment very well (data persistence, peer discovery).

As of now, the SDK is just offered as an ES module, requiring asynchronous import:

import * as localFirst from 'local-first';

await localFirst.init();

[..]

[^1]: Most notably this is about persistence of user data (key material and application data). However, it's easy to lose one's browsing data by switching to another browser profile/container, etc.


Under the hood

Rust, libp2p, crdts, cambria, .. --> INSERT AWESOMENESS HERE <--


License

Licensed under either of

at your option.

Contributing

Be respectful. Check out our Contribution Guidelines for specifics. Any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.