A minimal peer-to-peer ToDo list app built with Autobase, Blind Pairing, and Corestore, running on the Pear Runtime.
This application allows two users to collaborate on a task list in real time — without any server — by pairing over a decentralized P2P network using secure invites.
- Create and share a ToDo list across peers
- Real-time syncing using Autobase view
- Mark tasks as done (replicated across peers)
- Secure pairing with invite-based blind connection
- CLI-based task management
To set up the project manually:
-
Create a new project folder:
mkdir todo-peer-app && cd todo-peer-app
-
Initialize a Node.js project:
npm init -y
-
Install required packages:
npm install autobase corestore hyperswarm blind-pairing
-
Add Source Files in
src/
Create the folder and files:
mkdir src
touch src/index.js src/pairing.js src/view.jsindex.js: CLI entry point that handles commands likeadd,done,list, etc., and interacts with Autobase.pairing.js: Handles blind pairing logic. Generates invites (--invite) or joins via provided invite string.view.js: Manages the Autobase view using event sourcing (task,markDone). Definesapply(),open(), andclose()functions.
These files define the app’s logic for pairing, syncing tasks, and CLI interaction. You'll find detailed examples in the
docs/folder or the repo reference.
Open two terminals.
node src/index.js --store=store-a --invite- Generates and prints a pairing invite
- Starts a shared Autobase
- Allows writing tasks to the shared log
Use the invite printed above:
node src/index.js --store=store-b 'invite:BASE64_STRING_HERE'- Connects securely to the inviter
- Syncs and participates in the shared ToDo list
| Command | Description |
|---|---|
add <task> |
Adds a new task |
done <index> |
Marks the task at that index as done |
list |
Displays current ToDo list |
history |
Shows raw log entries (JSON) |
clear |
Clears the terminal |
exit |
Exits the application |
todo-peer-app/
├── src/
│ ├── index.js # CLI command interface
│ ├── pairing.js # Blind pairing logic
│ ├── view.js # Autobase view & apply logic
├── docs/ # Documentation files
├── package.json # Dependencies and metadata
└── README.md # Project overview
docs/walkthrough.md– Step by step walkthroughdocs/architecture.md– System architecturedocs/functions_refenrence.md– Function descriptions
📝 > add Clean the room
📝 > done 0
📝 > list
📋 ToDo List:
0. ✅ Clean the room