Skip to content

EntglDb/EntglDb.NodeJs

Repository files navigation

EntglDb.NodeJs

Pure JavaScript/TypeScript implementation of EntglDb - A peer-to-peer distributed database with offline-first capabilities.

🚀 Quick Start

Run the Interactive Demo

# Windows
run-demo.bat

# macOS/Linux
./run-demo.sh

Run Electron Desktop App

# Windows
run-electron.bat

# macOS/Linux
./run-electron.sh

Run React Native Mobile App

# Windows
run-react-native.bat

# macOS/Linux
./run-react-native.sh

Or manually:

cd apps/demo
pnpm install
pnpm demo

📦 Packages

  • @entgldb/protocol - Protocol Buffers definitions
  • @entgldb/core - Core database engine (HLC, CRDT, Collections)
  • @entgldb/persistence-sqlite - SQLite storage adapter
  • @entgldb/network - P2P networking (TCP, WebSocket)

🎯 Sample Applications

Electron Desktop App

cd apps/sample-electron
pnpm install
pnpm dev

React Native Mobile App

cd apps/sample-react-native
pnpm install
cd ios && pod install && cd ..
pnpm ios    # or pnpm android

🏗️ Development

Install Dependencies

pnpm install

Build All Packages

pnpm build

Run Tests

pnpm test

📚 Documentation

See walkthrough.md for comprehensive documentation.

✨ Features

  • Hybrid Logical Clocks (HLC) for distributed ordering
  • Last-Write-Wins (LWW) conflict resolution
  • SQLite persistence with WAL mode
  • P2P Sync via TCP with Protocol Buffers (v4)
  • Brotli Compression for efficient bandwidth usage
  • Multi-platform: Node.js, Electron, React Native
  • Type-safe TypeScript API

🔧 Architecture

EntglDb.NodeJs/
├── packages/
│   ├── protocol/          # Protobuf definitions
│   ├── core/             # Database engine
│   ├── persistence-sqlite/ # SQLite adapter
│   └── network/          # P2P networking
└── apps/
    ├── demo/             # CLI demo
    ├── sample-electron/  # Desktop app
    └── sample-react-native/ # Mobile app

🔗 Protocol Compatibility

Compatible with EntglDb.NET v0.7.0, EntglDb.Kotlin v0.7.0 Features: Brotli compression, Secure Handshake.

📄 License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages