Octomind
Octomind: opencode와 동일 모델·엔드포인트·가격
Node.js와 TypeScript용 즉시 적용 가능한 다중 테넌시
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온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기Drop-in multi-tenancy for Node.js. Tenant hierarchy, config inheritance, permissions, audit, and GDPR in one library.
저장소 README에서 가져옴
README 전체를 불러오는 중입니다.
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 |
The full documentation is at docs.stratum-hq.org. It covers getting started, guides (hierarchy, config, permissions, isolation, API keys, webhooks, GDPR, multi-region), the API reference, and a page for each package.
Contributors can run the docs site locally from website/ with cd website && npm install && npm run dev.
npm install # Install dependencies
npm run build # Build all packages
npm test # Run unit tests
npx @stratum-hq/cli doctor # Check your DB setup
Integration tests run against real PostgreSQL, MongoDB, and MySQL:
docker compose --profile test up -d test-db
cd packages/integration-tests
DATABASE_URL=postgresql://stratum_test:stratum_test@localhost:5433/stratum_test \
npx vitest run
| Variable | Description |
|---|---|
DATABASE_URL | PostgreSQL connection string |
JWT_SECRET | JWT signing secret (required whenever NODE_ENV is not development or test; at least 32 bytes, and not a placeholder) |
STRATUM_ENCRYPTION_KEY | AES-256-GCM key for field encryption (required, with STRATUM_HKDF_SALT in hex, whenever NODE_ENV is not development or test; at least 32 bytes there) |
REDIS_URL | Optional; enables distributed rate limiting |
STRATUM_API_KEY_HMAC_SECRET | HMAC secret for API key hashing |
See the installation guide for the full list.
@stratum-hq/lib (direct) ←→ @stratum-hq/control-plane (HTTP)
│ │
├── @stratum-hq/db-adapters ├── @stratum-hq/sdk
│ (pg, Prisma, Sequelize, │ (client, middleware)
│ Drizzle) │
│ ├── @stratum-hq/nestjs
├── @stratum-hq/mongodb │ (guard, decorator, DI)
│ (shared, collection, │
│ database isolation) ├── @stratum-hq/hono
│ │ (middleware, ALS context)
├── @stratum-hq/mysql │
│ (shared, table, database ├── @stratum-hq/react
│ isolation + ORM helpers) │ (UI components)
│ │
├── PostgreSQL 16 │
│ (ltree, RLS, AES) │
│ │
├── MongoDB 6/7 │
│ │
└── MySQL 8 │
└── @stratum-hq/cli
(init, doctor, migrate)
Stratum 1.x is on npm. Near-term focus:
@stratum-hq/control-plane docs: dedicated package page and deployment guideHave a use case we should prioritize? Open an issue.
MIT. See LICENSE.