Shared Note
Introduction
A basic/simple collaborative text editing platform, allowing real-time edits at the same time by multiple users. Consider it as a very simple implementation of Google Docs. It currently runs on a Google Cloud Compute Engine free-tier instance.
There are simple Android, iOS and web clients developed using flutter. The clients connect to a shared note session and has a text area for viewing and editing a block of text.
The web client is here
Server
The back-end server is a Java service running an embedded Jetty instance. The server does the work of accepting/merging edits and publishing the edits to users updating the same text. It currently runs on a Google Cloud free tier VM instance: 0.2 vCPUS / 0.60 GB.
The source for this can be found on GitHub.
Client
The Android and iOS mobile buildable but are not deployed to their respective app stores, the web app version is available here (most of the time):
Instructions
- Enter a unique session Id.
- Click ‘Connect’ to connect to the session.
- Existing text will be loaded, or the text area will remain blank, ready for editing.
- Another client can connect to the same session, by entering the same session Id.
- Both clients can view and edit the same piece of text.
Details
The text persists in-memory, so it is available till the service restarts.
Behind the scenes, the service versions each line of text. For an edit to be accepted, the client needs to provide the expected next version number for that line of text. The provided version number ensures that the client has updated the latest version of that line of text. If the version is unexpected, the server discards the update. If the server discards the update, the latest text (without changes) is published so that the client can correct itself, i.e. so that it knows the server rejected the update.
Screenshots
All clients look the same, here’s the iOS client screenshot: