Connected
🔍
Start searching

Enter a natural language query above to find semantically similar content

Index Document
Add a document to the vector index
Collections
Available vector collections
Query Parameters
Build your query

Configure query parameters above and click Run to see results

Supported stages: match, lookup, group, sort, limit, project, unwind

📊
Build your pipeline

Define aggregation stages and click Run to see results

Add Secret
Stored Secrets
🔐
No secrets

Add secrets above to use them in API calls

Execute Request with Secret
🔌
Connection
API and authentication details
API URL -
User -
Roles -
🔐
Change Password
Update your account password
🧠
Vector Store
Embedding configuration
Dimensions 768
Store Type binary
Max Collections 50
🎨
Appearance
Customize your view
Theme
🚀
Quick Start
Get up and running in seconds

js-doc-store is a zero-dependency vanilla JS document database with MongoDB-style queries, indices, joins, aggregation, encryption, and auth.

# Start the server
npm install
npm start

# Server runs on http://localhost:3000
🔐
Authentication
JWT-based auth with RBAC

Bootstrap (first admin only):

POST /auth/bootstrap
{
  "email": "[email protected]",
  "password": "Admin123!",
  "name": "Admin"
}

Login:

POST /auth/login
{
  "email": "[email protected]",
  "password": "Admin123!"
}
> Response: { "token": "eyJ...", "user": {...} }
📊
Tables & CRUD
Core data operations
# List tables
GET /admin/tables

# Create table
POST /admin/create-table
{ "tableName": "products", "columns": [
  { "name": "name", "type": "text" },
  { "name": "price", "type": "number" }
]}

# Insert
POST /admin/insert
{ "tableName": "products", "data": {"name":"Laptop","price":999} }

# Query
POST /admin/query
{ "tableName": "products", "filter": {"price":{"$gte":500}}, "limit": 10 }

# Update
POST /admin/update
{ "tableName": "products", "filter": {"_id":"xxx"}, "update": {"$set":{"price":899}} }

# Remove
POST /admin/remove
{ "tableName": "products", "filter": {"_id":"xxx"} }

# Aggregate
POST /admin/aggregate
{ "tableName": "products", "pipeline": [
  { "stage": "match", "params": {"price":{"$gte":100}} },
  { "stage": "group", "params": {"field":"category","accumulators":{"total":{"$sum":"price"}}} }
]}
🔍
Vector Search
Semantic search with embeddings

Requires EMBEDDING_WORKER_URL and EMBEDDING_API_KEY env vars.

# Generate embedding
POST /admin/embed
{ "text": "machine learning", "dimensions": 768 }

# Index with auto-embedding
POST /admin/vector/index-with-text
{ "collection": "docs", "id": "doc-1",
  "text": "AI is transforming...",
  "metadata": {"category":"tech"} }

# Search by natural language
POST /admin/vector/search-by-text
{ "collection": "docs", "query": "artificial intelligence", "limit": 10 }

# Hybrid search (vector + BM25)
POST /admin/vector/search-hybrid
{ "collection": "docs", "query": "neural networks", "limit": 5 }
⚙️
Configuration
Environment variables
PORT=3000
NODE_ENV=production
DATA_DIR=/opt/js-doc-store-server/data
JWT_SECRET=
VAULT_SECRET=
DB_ENCRYPTION_KEY=
[email protected]
ADMIN_PASSWORD=
EMBEDDING_WORKER_URL=https://worker.your-subdomain.workers.dev
EMBEDDING_API_KEY=your-api-key
📡
All Endpoints
Complete API reference
Public (no auth)
  • GET /public/tables
  • GET /public/query/:table
Auth
  • POST /auth/bootstrap — create first admin
  • POST /auth/register — register new user
  • POST /auth/login — get JWT token
Data (requires JWT)
  • GET /admin/tables — list tables
  • POST /admin/create-table
  • POST /admin/insert
  • POST /admin/query — find with filters
  • POST /admin/update — update documents
  • POST /admin/remove — delete documents
  • POST /admin/aggregate — pipeline aggregation
Vector Search (requires JWT)
  • POST /admin/embed — generate embedding
  • POST /admin/vector/index-with-text
  • POST /admin/vector/search-by-text
  • GET /admin/vector/collections
Users (requires JWT)
  • GET /admin/users — list users
  • POST /admin/users/create
  • POST /admin/users/update
  • POST /admin/users/delete
  • POST /admin/users/role — assign/remove role
Vault (requires JWT)
  • POST /admin/vault/add — store secret
  • GET /admin/vault/list
  • POST /admin/vault/execute