Skip to content

embeddedos-org/eDB

Repository files navigation

eDB: Unified Multi-Model Database Ecosystem

CI Python 3.11+ License: MIT

Part of the EmbeddedOS ecosystem.

eDB is a unified multi-model database that combines SQL, Document/NoSQL, and Key-Value storage in a single embedded engine. It includes a Python backend (FastAPI + SQLite), a React/TypeScript frontend with SQL editor and AI-powered query assistance, and a standalone browser version.

Features

Feature Description
πŸ—ƒοΈ Multi-Model Storage SQL tables, JSON documents, and key-value pairs β€” all in one database
πŸ” JWT Authentication Access and refresh tokens with configurable expiration
πŸ‘₯ RBAC Admin, read_write, read_only roles with granular permissions
πŸ”’ AES-256 Encryption Field-level encryption at rest using AES-256-GCM
πŸ“‹ Audit Logging Tamper-resistant logs with hash chain verification
πŸ€– eBot AI Natural language β†’ SQL/NoSQL translation
🌐 REST API Full CRUD via FastAPI with auto-generated OpenAPI docs
πŸ›‘οΈ Input Sanitization SQL injection, NoSQL injection, and prompt injection detection
⚑ Zero Dependencies Core engine runs on SQLite β€” no external database needed
πŸ“¦ Embeddable Use as a Python library or standalone server
πŸ–₯️ React Frontend Table management, inline editing, SQL query editor, eBot sidebar
🌐 Browser Standalone Self-contained single-file HTML version with localStorage persistence

Quick Start

Backend (Python API Server)

git clone https://github.com/embeddedos-org/eDB.git
cd eDB
pip install -e ".[dev]"

# Initialize database with default admin
edb init

# Start the server
edb serve --port 8000

# API docs at http://localhost:8000/docs

Frontend (React UI)

npm install
npm run dev

The React UI runs at http://localhost:5178.

Browser Standalone

Open browser/edb.html directly in any browser for a zero-install experience with localStorage persistence.

As a Python Library

from edb.core.database import Database
from edb.core.models import ColumnDefinition, ColumnType, TableSchema

db = Database("my_app.db")

# SQL
schema = TableSchema(name="users", columns=[
    ColumnDefinition(name="id", col_type=ColumnType.INTEGER, primary_key=True),
    ColumnDefinition(name="name", col_type=ColumnType.TEXT),
])
db.sql.create_table(schema)
db.sql.insert("users", {"id": 1, "name": "Alice"})

# Documents
db.docs.insert("logs", {"event": "login", "user": "Alice"})

# Key-Value
db.kv.set("session:abc", {"user_id": 1}, ttl=3600)

Interactive Shell

edb shell
# edb> SELECT * FROM users
# edb> .tables
# edb> .collections

Architecture

eDB/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ edb/                  # Python backend
β”‚   β”‚   β”œβ”€β”€ api/              # FastAPI routes and dependencies
β”‚   β”‚   β”œβ”€β”€ auth/             # JWT, users, RBAC
β”‚   β”‚   β”œβ”€β”€ ebot/             # AI/NLP query interface
β”‚   β”‚   β”œβ”€β”€ query/            # Query parser and planner
β”‚   β”‚   β”œβ”€β”€ security/         # Encryption, audit, input validation
β”‚   β”‚   β”œβ”€β”€ config.py         # Pydantic Settings configuration
β”‚   β”‚   └── cli.py            # CLI entry point
β”‚   β”œβ”€β”€ App.tsx               # React main component
β”‚   β”œβ”€β”€ main.tsx              # React entry point
β”‚   β”œβ”€β”€ styles.css            # Full application styles
β”‚   β”œβ”€β”€ components/           # React UI components
β”‚   β”‚   β”œβ”€β”€ TopBar.tsx        # App header with controls
β”‚   β”‚   β”œβ”€β”€ TableList.tsx     # Sidebar table navigator
β”‚   β”‚   β”œβ”€β”€ TableView.tsx     # Data grid with inline editing
β”‚   β”‚   β”œβ”€β”€ QueryEditor.tsx   # SQL query editor panel
β”‚   β”‚   β”œβ”€β”€ EBotSidebar.tsx   # AI assistant sidebar
β”‚   β”‚   └── StatusBar.tsx     # Bottom status bar
β”‚   └── hooks/                # React hooks
β”‚       β”œβ”€β”€ useDatabase.ts    # In-memory database with CRUD
β”‚       └── useEBot.ts        # eBot AI integration
β”œβ”€β”€ browser/
β”‚   └── edb.html              # Standalone browser version
β”œβ”€β”€ tests/                    # Python tests
β”œβ”€β”€ docs/                     # Documentation
β”œβ”€β”€ examples/                 # Runnable examples
β”œβ”€β”€ package.json              # Node.js project manifest
β”œβ”€β”€ pyproject.toml            # Python project metadata
β”œβ”€β”€ vite.config.ts            # Vite configuration
└── tsconfig.json             # TypeScript configuration

Configuration

Configure via environment variables (prefix EDB_) or .env file:

EDB_DB_PATH=my_data.db
EDB_API_HOST=0.0.0.0
EDB_API_PORT=8000
EDB_JWT_SECRET=your-strong-secret-here
EDB_ENCRYPTION_KEY=your-encryption-key

Development

Python Backend

pip install -e ".[dev]"
pytest
ruff check src/ tests/
ruff format src/ tests/

React Frontend

Command Description
npm run dev Start development server (port 5178)
npm run build Type-check and build for production
npm run preview Preview production build

Roadmap

  • Core multi-model engine (SQL, Document, KV)
  • Query DSL with parser and planner
  • JWT authentication and RBAC
  • AES-256 encryption at rest
  • Tamper-resistant audit logging
  • REST API (FastAPI)
  • eBot rule-based NL queries
  • CLI (serve, init, shell)
  • React frontend with SQL editor
  • Browser standalone version
  • CI/CD pipeline
  • LLM-powered eBot (OpenAI/local models)
  • Graph data model (Neo4j-style)
  • Multi-node clustering (eDBE)
  • GraphQL and gRPC interfaces
  • File/blob storage with indexing
  • Predictive analytics integration

Contributing

See CONTRIBUTING.md for guidelines.

Security

See SECURITY.md for vulnerability reporting and security best practices.

License

MIT License. See LICENSE for details.

About

Lightweight embedded database manager with SQL editor, AI-powered query assistance, and multi-model storage

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors