DBDelve
Dive deep into your data. A fast, native, multi-engine database client written in Rust. Free and open source, no telemetry.
翻訳待ち
Drop-in multi-tenancy for Node.js and TypeScript. Hierarchical tenants, config inheritance, three isolation strategies (RLS, schema, database), GDPR compliance. Open source, MIT licensed.
翻訳待ち
開発ツールTypeScript · MDXGitHub @stratum-hqオンライン所有者未確認
Have you tried it? One tap is enough. No sign-in needed.
Drop-in multi-tenancy for Node.js. Tenant hierarchy, config inheritance, permissions, audit, and GDPR in one library.
翻訳待ち
Loading the full README.
Read the full README ↗Stratum gives you hierarchical multi-tenancy with config inheritance, permission delegation, three isolation strategies (RLS, schema-per-tenant, database-per-tenant), field-level encryption, audit logging, GDPR compliance, and multi-region support. Built for B2B SaaS, MSSP/MSP architectures, and any product that needs nested tenant boundaries.
tenant_id?Every SaaS team starts with tenant_id on every table. It works, until it doesn't:
Stratum gives you all of this from day one. Start with flat tenancy, grow into hierarchy, config inheritance, permissions, and isolation strategies as your product matures.
npm install @stratum-hq/lib pg
import { Pool } from "pg";
import { Stratum } from "@stratum-hq/lib";
const stratum = new Stratum({ pool: new Pool(), autoMigrate: true });
await stratum.initialize();
const org = await stratum.createOrganization({ name: "Acme Corp", slug: "acme" });
await stratum.setConfig(org.id, "seat_limit", { value: 25 });
const config = await stratum.resolveConfig(org.id);
console.log(config.seat_limit.value); // 25
That's it. autoMigrate: true creates all tables on first run. No CLI, no migrations, no Docker required (just a PostgreSQL connection string).
When you're ready for parent/child tenants, config inheritance, and permission delegation:
const msp = await stratum.createTenant({ name: "NorthStar MSP", slug: "northstar" });
const customer = await stratum.createTenant({ name: "Acme Corp", slug: "acme", parent_id: msp.id });
// Config flows root → leaf; children inherit automatically
await stratum.setConfig(msp.id, "max_seats", { value: 500, locked: true });
const config = await stratum.resolveConfig(customer.id);
// → { max_seats: { value: 500, inherited: true, locked: true } }
# Scaffold a new project (recommended)
npx @stratum-hq/create my-app
# Or add to an existing project
npm install @stratum-hq/lib pg
# HTTP SDK with Express/Fastify middleware
npm install @stratum-hq/sdk
# NestJS integration (guard, decorator, module)
npm install @stratum-hq/nestjs
# Hono middleware
npm install @stratum-hq/hono
# MongoDB tenant isolation
npm install @stratum-hq/mongodb mongodb
# MySQL tenant isolation
npm install @stratum-hq/mysql mysql2
# React admin components
npm install @stratum-hq/react
# CLI tools
npm install -g @stratum-hq/cli
| Package | What it does |
|---|---|
@stratum-hq/core | Shared types, Zod schemas, error classes |
@stratum-hq/lib | Direct library: tenants, config, permissions, ABAC, audit, GDPR |
@stratum-hq/control-plane | Fastify v5 REST API with auth, scopes, OTel, Redis rate limiting |
@stratum-hq/sdk | HTTP client with LRU cache, Express/Fastify middleware |
@stratum-hq/db-adapters | PostgreSQL adapters: raw pg, Prisma, Sequelize, Drizzle, RLS, schema/DB isolation |
@stratum-hq/mongodb | MongoDB tenant isolation: shared collection, collection-per-tenant, database-per-tenant |
@stratum-hq/mysql | MySQL tenant isolation: shared table, table-per-tenant, database-per-tenant, TypeORM/Knex/Sequelize integrations |
@stratum-hq/react | React components: tenant tree, config editor, permission editor |
@stratum-hq/cli | CLI: init, migrate, scaffold, doctor |
@stratum-hq/nestjs | NestJS integration: guard, @Tenant() decorator, module with DI |
@stratum-hq/hono | Hono middleware: tenant extraction, ALS context |
@stratum-hq/test-utils | Cross-tenant isolation test helpers |
@stratum-hq/create | Project scaffolding: npx @stratum-hq/create my-app |
docker compose --profile demo up --build
| Service | URL |
|---|---|
| Dashboard | http://localhost:3300 |
| API | http://localhost:3001 |
| Swagger | http://localhost:3001/api/docs |
This is the beginning of the README. Read the rest at the original. Read the full README ↗