OrbitDB is a serverless, peer-to-peer distributed database library built on IPFS and libp2p. It provides a Merkle-CRDT (conflict-free replicated data type) log as its core primitive, supporting multiple database types like Events (append-only log), Documents (indexed JSON), KeyValue, and KeyValueIndexed. The architecture is modular: it separates storage backends (memory, LevelDB, IPFS blocks, LRU cache), identity management (pluggable providers), access control (static ACL or dynamic ACL stored in a keyvalue database), and encryption (pluggable). The primary entry point is `createOrbitDB()`, which returns an OrbitDB instance that can open databases of any registered type. Data flows involve appending operations to an immutable, signed log of IPLD entries, syncing with remote peers via pubsub-based replication, and handling conflict resolution using Last-Write-Wins. External dependencies include Helia (IPFS), libp2p, LevelDB, and various multiformats libraries. The library is designed for both Node.js and browser environments, with a comprehensive test suite covering unit and integration scenarios.
Berty is a full-stack, privacy-focused, peer-to-peer messaging application. The system consists of a Go backend implementing the Wesh protocol (based on IPFS, libp2p, and OrbitDB) that provides core messaging, push notifications, authentication, replication, and directory services. The backend is exposed via gRPC and consumed by multiple clients: a React Native mobile app (with both a legacy JS variant and a newer Expo-based variant), a Go CLI with a terminal UI (mini) and a desktop GUI (Fyne), and native bridges for iOS and Android. The architecture is modular, with separate packages for error handling, authentication, push relay, and bot framework. Key entry points include the `berty daemon` CLI command, the mobile app entry points (`App.tsx` in both `js/packages` and `berty-bridge-expo/mobile`), and the bridge framework (`go/framework/bertybridge`). Data flows involve gRPC streams from the Go backend to the mobile clients, with event-driven state management and local encrypted storage via SQLCipher. External dependencies include libp2p, OrbitDB, gRPC, protobuf, and various platform-specific native modules for BLE, mDNS, and push notifications. The repository also contains auxiliary tools for infrastructure testing, rendezvous servers, and debugging (Tyber).