Quickstart Guide
Prerequisites
Before installing NexusDB, ensure you have the following:
- Node.js 18+ or Python 3.10+
- At least 2GB free RAM
- macOS, Linux, or Windows with WSL2
Installation
Install NexusDB globally using npm:
npm install -g @nexusdb/cli
nexusdb init my-project
cd my-projectOr with pip:
pip install nexusdb
nexusdb init my-projectStart the Server
Launch the development server with hot reload:
nexusdb dev --port 4200You should see output like:
NexusDB v3.2.1 running at http://localhost:4200
Admin dashboard: http://localhost:4200/admin
API endpoint: http://localhost:4200/api/v1Create Your First Collection
Open a new terminal and create a collection:
nexusdb collection create users --schema schema.jsonDefine a schema in schema.json:
{
"name": "users",
"fields": [
{ "name": "email", "type": "string", "unique": true },
{ "name": "name", "type": "string" },
{ "name": "role", "type": "enum", "values": ["admin", "editor", "viewer"] },
{ "name": "created_at", "type": "datetime", "auto": true }
]
}Insert Data
const { NexusDB } = require("@nexusdb/client");
const db = new NexusDB("http://localhost:4200");
await db.collection("users").insert({
email: "jane@example.com",
name: "Jane Doe",
role: "admin"
});Query Data
const admins = await db.collection("users")
.where("role", "==", "admin")
.orderBy("created_at", "desc")
.limit(10)
.get();
console.log(admins);Next Steps
Now that you have NexusDB running, explore: