Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexjg/automerge-todomvc-http
Demo of multiple platform Todo MVC using automerge to sync data over HTTP
https://github.com/alexjg/automerge-todomvc-http
Last synced: 2 months ago
JSON representation
Demo of multiple platform Todo MVC using automerge to sync data over HTTP
- Host: GitHub
- URL: https://github.com/alexjg/automerge-todomvc-http
- Owner: alexjg
- Created: 2021-01-29T15:42:24.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-11T11:19:18.000Z (about 3 years ago)
- Last Synced: 2024-09-04T00:05:44.994Z (3 months ago)
- Language: Rust
- Size: 679 KB
- Stars: 12
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple HTTP Sync Demo
This is an interop demo for automerge. It's a simple todo list application running on as many platforms as automerge supports.
## HTTP Syncing
Automerge is agnostic as to how exactly peers find each other and communicate changes. We want to avoid getting into the minefield of peer to peer networking here, so we use a very simple HTTP sync method, but you can imagine this application built using libp2p.
What does HTTP syncing look like then? Well every implementation will make it's version of the document available at a publicly accessible HTTP endpoint. Each implementation provides a way for the user to pull changes from a particular URL into their document.
For the purposes of this demo there is a super simple flask application in `./server/server.py` which runs at `localhost:5000` and stores whatever you POST to it, e.g if you hit `POST http://localhost:5000/somefile` then `GET http://localhost:5000/somefile` will return the contents of that file.
## Schema
Every implementation in this application is syncing a document that is expected to look like this:
```json
{
"todos": [
{
"value": "",
"completed": false,
"id": ""
}
]
}
```## Walkthrough
There is a javascript todo list implementation in `react-todomvc` and a Rust GTK application (only tested on linux) in `vgtk-todomvc`. Refer to each of those repositories for instructions on running them. We will also need the `automerge` CLI installed, which can be done with `cargo install --git https://github.com/automerge/automerge-rs --rev a28ae6edb6674a12917a5cbe75ab8a385ca78513` (provided you have [setup](https://doc.rust-lang.org/book/ch14-04-installing-binaries.html) `cargo install` to put binaries on your path).
You'll also need the server running, refer to `./server/README.md` for details.
So, let's assume we now have our simple HTTP sync server running and have a play.
First off, let's open the react implementation: