Skip to main content

Getting Started

GenosDB provides a collection of examples to help you understand its capabilities. From simple todo lists to complex collaborative applications, each example is designed to showcase specific features with working code you can learn from.
All examples are open-source and available in the GenosDB repository.

Basic Examples

Perfect for learning GenosDB fundamentals.

Todo List

Simple real-time task management with CRUD operations and reactive queries.Features:
  • Real-time sync across tabs and devices
  • Reactive map() subscriptions
  • Inline editing
  • Persistent storage

Chat Application

Minimalist P2P chat in just 9 lines of code.Features:
  • Real-time messaging
  • No backend server
  • Cross-device sync
  • Persistent message history

Kanban Board

Drag-and-drop task board with real-time updates.Features:
  • Multiple status columns
  • Drag-and-drop
  • Real-time collaboration

Infinite Scroll

Dynamic content loading with cursor-based pagination.Features:
  • Efficient pagination
  • Lazy loading
  • Smooth scrolling

Collaborative Applications

Advanced examples showcasing real-time collaboration.

Collaborative Editor

Rich-text editor with live cursors, version history, and video chat.Features:
  • Real-time typing sync
  • Remote cursor positions
  • Markdown/HTML preview
  • Version history
  • Integrated video room
  • RBAC + WebAuthn

Whiteboard

P2P collaborative canvas for drawing.Features:
  • Real-time drawing sync
  • Multiple users
  • No backend

Shared Notes

Secure, decentralized note-taking with ACLs.Features:
  • End-to-end encryption
  • Granular permissions
  • Full-text search
  • Light/dark mode

Location Sharing

Real-time GPS tracking on an interactive map.Features:
  • Live location updates
  • Leaflet map integration
  • Path history
  • Multiple users

Media & Streaming

Examples using GenosRTC for audio/video streaming.

Audio Room

P2P voice chat with voice activity detection.Features:
  • Real-time audio streaming
  • Automatic peer discovery
  • Voice activity indicator

Video Conference

Multi-peer video conferencing.Features:
  • WebRTC video streaming
  • Automatic layout
  • Screen sharing support

File Sharing

P2P file transfer with progress tracking.Features:
  • Direct file transfer
  • No file size limits
  • Encrypted transfer

Security Examples

Demonstrations of GenosDB’s Security Manager.

RBAC Chat

Chat with role-based access control.Features:
  • WebAuthn authentication
  • Role hierarchy
  • Permission enforcement

Auth UX Demo

Best-practice authentication flow.Features:
  • Mnemonic registration
  • WebAuthn passkeys
  • Secure session management

Encryption Demo

End-to-end data encryption.Features:
  • Client-side encryption
  • User-specific keys
  • Secure storage

SM Testbed

Complete Security Manager testing environment.Features:
  • Full RBAC implementation
  • WebAuthn flows
  • Role assignment

Advanced Features

Showcasing GenosDB’s powerful capabilities.

Graph Queries

Recursive graph traversal with $edge operator.Features:
  • Multi-hop queries
  • Relationship discovery
  • Visual graph display

Search Demo

Full-text search with query operators.Features:
  • Text search
  • Regex patterns
  • Multiple filters

Pagination

Cursor-based pagination for large datasets.Features:
  • Forward/backward navigation
  • Persistent cursors
  • Efficient queries

Custom Cursors

Real-time cursor synchronization.Features:
  • Live cursor positions
  • Data channels
  • Smooth animation

Visualization & Monitoring

Tools for visualizing GenosDB’s internals.

Mesh Monitor (D3)

D3.js visualization of cellular mesh topology.Features:
  • Real-time topology
  • Bridge connections
  • Network metrics

Mesh Monitor (3D)

Three.js 3D visualization of mesh network.Features:
  • 3D cell geometries
  • Animated particles
  • Interactive camera

Performance Test

Benchmark GenosDB under load.Features:
  • Mass insertions
  • Sync performance
  • Latency testing

Graph Relations

Visualize node relationships.Features:
  • Real-time graph
  • Link visualization
  • Interactive nodes

Community Projects

Open-source projects built with GenosDB.

dKanban

Full-featured Kanban board application.GitHub: estebanrfp/dKanban

dChat

Complete chat application.GitHub: estebanrfp/dChat

dCMS

Distributed content management system.GitHub: estebanrfp/dCMS

Pixel Painting

Collaborative pixel art canvas.GitHub: estebanrfp/Pixel-Painting

Running Examples Locally

Clone the repository and open examples in your browser:
# Clone the repository
git clone https://github.com/estebanrfp/gdb.git
cd gdb/examples

# Serve with any static server
npx http-server -p 8080

# Open in browser
open http://localhost:8080/todolist.html
Some examples require HTTPS for WebAuthn features. Use a local HTTPS server or deploy to a hosting service.

Example Categories

By Difficulty

  • Beginner: Todo List, Chat, Kanban
  • Intermediate: Whiteboard, Audio/Video Streaming, Search
  • Advanced: Collaborative Editor, Shared Notes, Mesh Monitors

By Feature

  • Real-Time Sync: Todo List, Chat, Kanban, Whiteboard
  • Security: RBAC Chat, Auth Demo, Encryption, SM Testbed
  • Media: Audio Room, Video Conference, File Sharing
  • Queries: Search, Pagination, Graph Queries
  • P2P: All examples with rtc: true

By Use Case

  • Productivity: Todo List, Kanban, Collaborative Editor, Shared Notes
  • Communication: Chat, Audio Room, Video Conference
  • Visualization: Mesh Monitors, Graph Relations
  • Testing: Performance Test, SM Testbed, Edge Operator Testbed

Learn by Doing

The best way to learn GenosDB is to:
1

Start Simple

Begin with the Todo App to understand CRUD operations and real-time queries.
2

Add P2P

Explore the Chat App to see how P2P synchronization works.
3

Secure Your App

Study the RBAC Chat example to implement authentication and permissions.
4

Build Advanced Features

Dive into the Collaborative Editor for a complete application.

Example Code Patterns

Real-Time Todo Pattern

const db = await gdb('todos', { rtc: true })

// Subscribe to updates
await db.map(
  { query: { type: 'todo' } },
  ({ id, value, action }) => {
    if (action === 'added') addTodoToUI(id, value)
    if (action === 'updated') updateTodoInUI(id, value)
    if (action === 'removed') removeTodoFromUI(id)
  }
)

// Add todo
await db.put({ type: 'todo', text: 'Buy milk', completed: false })

P2P Chat Pattern

const db = await gdb('chat', { rtc: true })

// Listen for messages
await db.map(({ value }) => {
  displayMessage(value.user, value.text)
})

// Send message
await db.put({ user: 'Alice', text: 'Hello!' })

Secure Auth Pattern

const db = await gdb('secure-app', {
  rtc: true,
  sm: { superAdmins: ['0x1234...'] }
})

// Register
const { mnemonic } = await db.sm.startNewUserRegistration()
await db.sm.protectCurrentIdentityWithWebAuthn('alice@example.com')

// Login
await db.sm.loginCurrentUserWithWebAuthn()

Need Help?

Documentation

Read the full GenosDB documentation

GitHub Discussions

Ask questions and share ideas

API Reference

Explore the complete API

Report Issues

Found a bug? Let us know