Building a P2P Collaborative Whiteboard with GenosDB in a Single HTML File
Build complex real-time apps without a backend

Full Stack Developer - dWEB R&D
Search for a command to run...
Build complex real-time apps without a backend

Full Stack Developer - dWEB R&D
No comments yet. Be the first to comment.
Weighing GunDB for production, or looking for an alternative? Its supply-chain report, itemized — and GenosDB's zero-trust model and serverless design.

A live Polygon NFT marketplace with no backend and no MetaMask, mirrored into GenosDB — a peer-to-peer graph database with real-time, offline-capable reads.

Engineering Excellence vs. Architectural Innovation in Browser P2P

How I turned a single-player Godot game into real-time co-op with zero servers — two browser tabs, one shared world, powered by GenosDB.

How OVGrid runs an entire real-time 3D world — peer-to-peer, offline-capable — on GenosDB.

Build complex real-time apps without a backend. This collaborative whiteboard runs entirely peer-to-peer, powered by the simplicity of GenosDB.
GenosBoard is a feature-rich, real-time collaborative whiteboard designed to showcase the power and simplicity of GenosDB. It's a complete demonstration of how to build sophisticated, decentralized applications without writing a single line of backend code. All communication, data synchronization, and state persistence happens directly between browsers in a peer-to-peer network.
This isn't just a simple demo; it's a blueprint for the next generation of collaborative tools. The magic lies in GenosDB's hybrid communication model, which this application leverages perfectly:
db.put, db.map): Shapes created, moved, or deleted are saved to the graph database. This state is automatically synchronized across all peers and persists through page reloads, providing a reliable, shared source of truth.db.room.channel): High-frequency data like live cursor positions and in-progress drag movements are sent through a separate, lightweight messaging channel. This data is never written to the database, ensuring peak performance and preventing unnecessary storage writes.The entire P2P whiteboard works with just a few lines of GenosDB:
import { gdb } from "https://cdn.jsdelivr.net/npm/genosdb@latest/dist/index.min.js";
const db = await gdb("collab-board", { rtc: true });
// Persistent state — shapes sync across all peers and survive reloads
db.put({ type: "shape/circle", x: 200, y: 150, color: "#646cff", radius: 35 });
// Reactive rendering — UI updates automatically when any peer changes data
const { unsubscribe } = await db.map({ query: { type: { $regex: "^shape" } } }, ({ id, value, action }) => {
if (action === "added" || action === "updated") shapes.set(id, value);
if (action === "removed") shapes.delete(id);
render();
});
// Ephemeral channels — high-frequency data without touching the database
const cursorChannel = db.room.channel("cursor-pos");
cursorChannel.on("message", (pos, peerId) => drawRemoteCursor(peerId, pos));
const dragChannel = db.room.channel("shape-drag");
dragChannel.on("message", (data) => updateShapePosition(data));
This hybrid model — persistent graph data combined with ephemeral real-time channels — is what makes GenosDB uniquely suited for collaborative applications. No WebSocket server, no Firebase, no backend at all.
gdb("room-name", { rtc: true }).db.map() to reactively render the UI from database changes.db.put() and db.remove().db.room.channel() for high-frequency, non-persistent data.If this whiteboard inspires you, explore other real-time applications built with GenosDB:
Dive into the code to see just how few lines it takes to build something this powerful. Start building your own decentralized, real-time application today with GenosDB.
This article is part of the official documentation of GenosDB (GDB).
GenosDB is a distributed, modular, peer-to-peer graph database built with a Zero-Trust Security Model, created by Esteban Fuster Pozzi (estebanrfp).
📄 Whitepaper | overview of GenosDB design and architecture
🛠 Roadmap | planned features and future updates
💡 Examples | code snippets and usage demos
📖 Documentation | full reference guide
🔍 API Reference | detailed API methods
📚 Wiki | additional notes and guides
💬 GitHub Discussions | community questions and feedback
🗂 Repository | Minified production-ready files
📦 Install via npm | quick setup instructions