VoidDB

A high-performance LSM-tree document database written in Go — with REST API, S3-compatible blob storage, and a beautiful admin panel.

Get Started AI Agent Guide View on GitHub
LSM
Storage Engine
S3
Compatible Blob API
JWT
Authentication
KV
Built-in Cache
.void
Native Backup Format

Features

LSM-Tree Engine

Custom skip-list memtable, WAL with CRC32, SSTable segments, Bloom filters, and LRU block cache — all from scratch.

🗄️

Document Store

Databases → Collections → Documents. Supports String, Number, Boolean, Array, Object, and Blob types.

☁️

S3-Compatible Blobs

Full S3 API compatibility: buckets, objects, ETag (MD5), multipart copy, and metadata headers.

🔒

JWT Auth

Roles: admin, readwrite, readonly. HMAC-SHA256 tokens with auto-refresh.

🖥️

Admin Panel

Next.js 14 + glassmorphism UI. Browse databases, run queries, manage blobs and users in real-time.

KV

In-Memory Cache

Built-in key-value cache with a REST API for sessions, hot lookups, and ephemeral computed state.

🔐

TLS / Let's Encrypt

Automatic HTTPS via ACME HTTP-01, bring-your-own certs (including wildcards), HTTP→HTTPS redirect.

💾

Backup & Restore

Export to native .void archives (tar+gzip+NDJSON). Scheduled backups via cron or Task Scheduler.

🔧

CLI Tool

voidcli — manage databases, collections, and documents from the terminal.

📦

ORM Libraries

Type-safe clients for TypeScript (@voiddb/orm) and Go, shipped as separate companion repositories.

AI Agent Guide

Every running VoidDB server exposes a machine-readable markdown guide for AI agents and automation tools.

# Fetch the live server guide
curl http://localhost:7700/skill.md

# Alternate well-known path
curl http://localhost:7700/.well-known/voiddb-skill.md

The repository copy lives here: SKILL.md.

Quick Start

Windows
Linux / macOS
Docker
# Clone and run the interactive setup wizard
git clone https://github.com/Nopass0/void.git
cd void
.\scripts\setup.ps1

# Or start directly (builds automatically)
.\scripts\run.ps1

# With admin panel
.\scripts\run.ps1 -WithAdmin
git clone https://github.com/Nopass0/void.git && cd void
chmod +x scripts/*.sh
./scripts/setup.sh           # interactive wizard

# Or start directly
./scripts/run.sh
./scripts/run.sh --with-admin  # server + admin panel
git clone https://github.com/Nopass0/void.git && cd void
cp .env.example .env          # edit JWT_SECRET + ADMIN_PASSWORD
docker compose up -d

# API at http://localhost:7700
# Admin at http://localhost:3000

First steps

# Log in with CLI
voidcli login              # default: admin / admin

# Create a database and collection
voidcli db  create myapp
voidcli col create myapp users

# Insert a document
voidcli doc insert myapp users '{"name":"Alice","age":30,"active":true}'

# Query documents
voidcli doc find myapp users '{"where":[{"field":"age","op":"gt","value":18}]}'

# Backup
voidcli backup

REST API

Base URL: http://localhost:7700  |  All endpoints return JSON  |  Auth via Authorization: Bearer <token>

Authentication

MethodPathDescription
POST/v1/auth/loginLogin → {access_token, refresh_token}
POST/v1/auth/refreshRefresh tokens
GET/v1/auth/meCurrent user info

Databases & Collections

MethodPathDescription
GET/v1/databasesList all databases
POST/v1/databasesCreate database {name}
GET/v1/databases/:db/collectionsList collections
POST/v1/databases/:db/collectionsCreate collection {name}

Documents

MethodPathDescription
POST/v1/databases/:db/:colInsert document → {_id, ...}
GET/v1/databases/:db/:col/:idGet document by ID
PUT/v1/databases/:db/:col/:idReplace document
PATCH/v1/databases/:db/:col/:idPatch (merge) document
DELETE/v1/databases/:db/:col/:idDelete document
POST/v1/databases/:db/:col/queryQuery with filters/sort/pagination
GET/v1/databases/:db/:col/countCount matching documents

Query syntax

// POST /v1/databases/myapp/users/query
{
  "where": {
    "AND": [
      { "field": "age",    "op": "gte",        "value": 18 },
      { "field": "active", "op": "eq",         "value": true },
      { "field": "name",   "op": "starts_with", "value": "A" }
    ]
  },
  "order_by": [{ "field": "age", "dir": "asc" }],
  "limit": 25,
  "skip":  0
}

Supported operators: eq ne gt gte lt lte contains starts_with in

S3-Compatible Blob API

MethodPathDescription
GET/s3/List buckets
PUT/s3/:bucketCreate bucket
GET/s3/:bucketList objects
PUT/s3/:bucket/:keyUpload object
GET/s3/:bucket/:keyDownload object
HEAD/s3/:bucket/:keyObject metadata
DELETE/s3/:bucket/:keyDelete object

Blob Fields In Documents

{
  "_blob_bucket": "media",
  "_blob_key": "assets/123/original/photo.jpg",
  "_blob_url": "https://db.example.com/s3/media/assets/123/original/photo.jpg"
}
MethodPathDescription
POST/v1/databases/:db/:col/:id/files/:fieldUpload a file and store a Blob ref in the document field
DELETE/v1/databases/:db/:col/:id/files/:fieldRemove the file field and delete the stored object

Backup API

MethodPathAuthDescription
POST/v1/backupadminExport to .void archive (streamed)
POST/v1/backup/restoreadminImport from raw .void body

Cache API

MethodPathDescription
GET/v1/cache/:keyRead cached value
POST/v1/cache/:keyWrite cached JSON value
DELETE/v1/cache/:keyDelete cached value

CLI — voidcli

Build with go build ./cmd/voidcli or run .\scripts\setup.ps1 which adds it to your PATH automatically.

voidcli [--url http://host:7700] [--token JWT] COMMAND

# Authentication
voidcli login [--user admin]
voidcli logout
voidcli status

# Database management
voidcli db list
voidcli db create <name>
voidcli db drop   <name>

# Collection management
voidcli col list   <db>
voidcli col create <db> <name>
voidcli col drop   <db> <name>

# Document operations
voidcli doc insert <db> <col> '{"field":"value"}'
voidcli doc insert <db> <col> @myfile.json   # from file
voidcli doc find   <db> <col> [filter-json]
voidcli doc get    <db> <col> <id>
voidcli doc delete <db> <col> <id>

# Backup
voidcli backup              # all databases
voidcli backup mydb         # specific database
voidcli restore backup.void

ORM Libraries

TypeScript
Go

Install: npm install @voiddb/orm   or   bun add @voiddb/orm

import { VoidClient, query } from '@voiddb/orm';

const client = new VoidClient({ url: 'http://localhost:7700' });
await client.login('admin', 'admin');

const users = client.db('myapp').collection<User>('users');

// Insert
const id = await users.insert({ name: 'Alice', age: 30, active: true });

// Get by ID
const user = await users.get(id);

// Query (builder passed into find)
const results = await users.find(
  query()
    .where('age', 'gte', 18)
    .where('active', 'eq', true)
    .orderBy('age', 'asc')
    .limit(10)
);

// Update
await users.patch(id, { age: 31 });

// Cache
await client.cache.set('session:alice', { loggedIn: true }, 3600);

// Delete
await users.delete(id);

Repository: Nopass0/void_go

import voidorm "github.com/voiddb/void/orm/go"

client, _ := voidorm.New(voidorm.Config{
    URL:      "http://localhost:7700",
    Username: "admin",
    Password: "admin",
})

col := client.DB("myapp").Collection("users")

// Insert
id, _ := col.Insert(voidorm.Doc{
    "name": "Alice", "age": 30,
})

// Query
res, _ := col.Query().
    Where("age", voidorm.Gte, 18).
    OrderBy("age", voidorm.Asc).
    Limit(10).
    Execute()

// Get / Delete
doc, _ := col.GetByID(id)
col.Delete(id)

Configuration

Edit config.yaml or set VOID_* environment variables (env vars take precedence).

Env VariableDefaultDescription
VOID_HOST0.0.0.0Bind address
VOID_PORT7700API port
VOID_DATA_DIR./dataStorage directory
VOID_BLOB_DIR./blobBlob storage directory
VOID_JWT_SECRETRequired. HMAC signing key (min 32 chars)
VOID_ADMIN_PASSWORDadminInitial admin password
VOID_LOG_LEVELinfodebug | info | warn | error
VOID_TLS_MODEoffoff | file | acme
log.output_path./logs/voiddb.logRotated file logs retained for 7 days
VOID_DOMAINPublic domain (required for acme mode)
VOID_ACME_EMAILLet's Encrypt contact email
VOID_TLS_CERTCertificate PEM path (file mode)
VOID_TLS_KEYPrivate key PEM path (file mode)