Skip to content

nichoth/level-todo

Repository files navigation

level todo

For more words, see the blog post too

E2E encryption

We need a few modules. This uses several Bicycle Computing libraries, and the keystore from Fission.

I am using a database with Fauna DB, and a websocket via Patykit also.

The implementation

See code in the example folder.

Screenshot of the app

The app flow is designed like this:

  1. You open the app for the first time. The app prompts you to create a new identity. You create an identity. At this point you can save data, and it will be encrypted and backed up on the server.

  2. You visit the app from a second device, like your phone. At the bottom of the app are links -- "Link a device to this account" and "Add this device to an existing account".

  3. Use the app to add a second device to your account. This uses the identity module + a websocket via Partykit to facilitate multiple devices reading the same data.

State synchronization

Note that this is not a demonstration of CRDTs or any kind of state reconciliation. The push and pull buttons will simply overwrite the remote or local state.

This can work alright if you are only dealing with updates from a single user. We can assume that a single user would be mindful about which device is most up to date, and would push and pull accordingly.

authentication

Serverside, we handle auth using HTTP headers, via the request module.

develop

Start a local server with vite, a local partykit websocket server, and serve the lambda functions locally. (A complete environment can run locally.)

npm start

You need to add an environment variable for the database. In the root directory, create a file .env:

FAUNA_SECRET="abc123"

About

Level DB + E2E encryption + todo lists

Resources

License

Stars

Watchers

Forks

Packages

No packages published