Skip to content

Commit 8362309

Browse files
committed
Initial commit: EntglDb Node.js implementation with Sync, Gossip and React Native mobile app
0 parents  commit 8362309

67 files changed

Lines changed: 14834 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Dependencies
2+
node_modules/
3+
.pnpm-store/
4+
5+
# Build outputs
6+
dist/
7+
build/
8+
coverage/
9+
.nyc_output/
10+
*.tsbuildinfo
11+
12+
# Logs
13+
*.log
14+
npm-debug.log*
15+
yarn-debug.log*
16+
yarn-error.log*
17+
pnpm-debug.log*
18+
19+
# Environment
20+
.env
21+
.env.local
22+
.DS_Store
23+
24+
# IDE
25+
.idea/
26+
.vscode/
27+
*.swp
28+
*.swo
29+
30+
# React Native / Metro
31+
.metro/
32+
.watchmanconfig
33+
34+
# Android
35+
android/local.properties
36+
android/.gradle/
37+
android/build/
38+
android/app/build/
39+
android/*/build/
40+
**/*.keystore
41+
!android/app/debug.keystore
42+
43+
# iOS
44+
ios/build/
45+
ios/Pods/
46+
ios/*.xcworkspace
47+
ios/*.xcodeproj/project.xcworkspace
48+
ios/*.xcodeproj/xcuserdata
49+
ios/.xcode.env.local
50+
**.orig

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node-linker=hoisted

README.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# EntglDb.NodeJs
2+
3+
Pure JavaScript/TypeScript implementation of EntglDb - A peer-to-peer distributed database with offline-first capabilities.
4+
5+
## 🚀 Quick Start
6+
7+
### Run the Interactive Demo
8+
9+
```bash
10+
# Windows
11+
run-demo.bat
12+
13+
# macOS/Linux
14+
./run-demo.sh
15+
```
16+
17+
### Run Electron Desktop App
18+
19+
```bash
20+
# Windows
21+
run-electron.bat
22+
23+
# macOS/Linux
24+
./run-electron.sh
25+
```
26+
27+
### Run React Native Mobile App
28+
29+
```bash
30+
# Windows
31+
run-react-native.bat
32+
33+
# macOS/Linux
34+
./run-react-native.sh
35+
```
36+
37+
Or manually:
38+
```bash
39+
cd apps/demo
40+
pnpm install
41+
pnpm demo
42+
```
43+
44+
## 📦 Packages
45+
46+
- **@entgldb/protocol** - Protocol Buffers definitions
47+
- **@entgldb/core** - Core database engine (HLC, CRDT, Collections)
48+
- **@entgldb/persistence-sqlite** - SQLite storage adapter
49+
- **@entgldb/network** - P2P networking (TCP, WebSocket)
50+
51+
## 🎯 Sample Applications
52+
53+
### Electron Desktop App
54+
```bash
55+
cd apps/sample-electron
56+
pnpm install
57+
pnpm dev
58+
```
59+
60+
### React Native Mobile App
61+
```bash
62+
cd apps/sample-react-native
63+
pnpm install
64+
cd ios && pod install && cd ..
65+
pnpm ios # or pnpm android
66+
```
67+
68+
## 🏗️ Development
69+
70+
### Install Dependencies
71+
```bash
72+
pnpm install
73+
```
74+
75+
### Build All Packages
76+
```bash
77+
pnpm build
78+
```
79+
80+
### Run Tests
81+
```bash
82+
pnpm test
83+
```
84+
85+
## 📚 Documentation
86+
87+
See [walkthrough.md](file:///C:/Users/FABLUA/.gemini/antigravity/brain/95865bf1-3161-4920-ac82-d76d69e924cd/walkthrough.md) for comprehensive documentation.
88+
89+
## ✨ Features
90+
91+
-**Hybrid Logical Clocks (HLC)** for distributed ordering
92+
-**Last-Write-Wins (LWW)** conflict resolution
93+
-**SQLite** persistence with WAL mode
94+
-**P2P Sync** via TCP with Protocol Buffers
95+
-**Multi-platform**: Node.js, Electron, React Native
96+
-**Type-safe** TypeScript API
97+
98+
## 🔧 Architecture
99+
100+
```
101+
EntglDb.NodeJs/
102+
├── packages/
103+
│ ├── protocol/ # Protobuf definitions
104+
│ ├── core/ # Database engine
105+
│ ├── persistence-sqlite/ # SQLite adapter
106+
│ └── network/ # P2P networking
107+
└── apps/
108+
├── demo/ # CLI demo
109+
├── sample-electron/ # Desktop app
110+
└── sample-react-native/ # Mobile app
111+
```
112+
113+
## 🔗 Protocol Compatibility
114+
115+
Compatible with EntglDb.NET v0.4.0 - Can sync with .NET nodes!
116+
117+
## 📄 License
118+
119+
MIT

apps/demo/data/interactive.db

36 KB
Binary file not shown.

apps/demo/data/node-3199.db

36 KB
Binary file not shown.

apps/demo/data/node-3291.db

36 KB
Binary file not shown.

apps/demo/data/node-3491.db

36 KB
Binary file not shown.

apps/demo/data/node-3532.db

4 KB
Binary file not shown.

apps/demo/data/node-3532.db-shm

32 KB
Binary file not shown.

apps/demo/data/node-3532.db-wal

52.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)