# 🚀 @trap\_stevo/star-vault

**Unleash the future of data management** with the ultimate platform for secure, scalable, and dynamic data operations. Power the next generation of applications by combining advanced encryption, revolutionary real-time querying, and seamless synchronization to create an ecosystem where data transforms into action.

---

## 🌌 Features

- 🔐 **Optional Encryption** – Secure sensitive data at rest with `SecurityCore`
- ⚙️ **Sharded Storage Engine** – Efficiently scales writes across shards
- 🧠 **In-Memory Caching** – High-speed read layer with `StarCache`
- 📜 **Write-Ahead Logging** – Resilient logs with rotation and retention policies
- 🔍 **Advanced Query Engine** – Chainable and expressive queries with filtering, search, sorting, and spatial support
- 🚀 **Real-Time Event Emission** – Listen to data changes with fine-grained control
- 🛡️ **Authentication Layer** – Optional handler to authorize every operation
- 🌠 **Collection Wildcards** – Seamlessly operate across multiple collections

---

## ✨ Getting Started

### Installation

```bash
npm install @trap_stevo/star-vault
```

### Basic Usage

```js
const StarVault = require("@trap_stevo/star-vault");

const vault = new StarVault(
     "./data",
     "./logs",
     4,
     "869MB",
     "1w",
     {
          enableEncryption : true,
          masterKey : "supersecretkey",
          authHandler : (auth) => auth.token === "valid-token"
     }
);

vault.create("users", { id : "001", name : "Nova" }, { source : "init" }, { token : "valid-token" });
```

---

## 📈 Querying

```js
const results = vault.query("users")
     .where({ role : "admin" })
     .sort({ name : 1 })
     .select(["id", "name"])
     .limit(10)
     .execute();
```

---

## 🎧 Listening to Changes

```js
vault.listen("create", "users/*", (path, data) => {
     console.log("New user created:", path, data);
});
```

---

## 🌐 Wildcard Collection Queries

```js
vault.query("logs/*/2025")
     .recent("timestamp", "7d")
     .execute();
```

---

## ✨ License

See License in [LICENSE.md](./LICENSE.md)

---

## 🚀 Transform Data into Action

StarVault transcends traditional data systems—offering a full-fledged database engine and cosmic foundation that propels secure, reactive, and intelligent data-driven architectures.
