Open source · vishwajit-vm · 2026 – now Phase 0 complete
Strutvane
TypeScript framework & npm ecosystem for B2B apps
Strutvane is an open-source TypeScript framework and package ecosystem for enterprise B2B apps. You declare your models as fields and types; one command gives you database migrations, a secured and documented CRUD API, authentication with RBAC and multi-tenancy, and a complete UI — all as ordinary TypeScript your team owns. It is designed in the open in my GitHub organisation, vishwajit-vm. Phase 0 (foundations) is complete and Phase 1 is next; the 10 npm package names are reserved placeholders until the first release.
Built for: TypeScript teams building internal tools, admin panels and multi-tenant B2B SaaS — and developers who want enterprise-grade defaults without a black box.
Packages on npm
strutvane↗Global CLI launcher (sv)create-strutvane↗npm create strutvane@latest project starter@strutvane/framework↗Models, migrations, CRUD API, OpenAPI@strutvane/auth↗Identity, RBAC/ABAC, multi-tenancy, audit@strutvane/ui↗Metadata-driven React UI@strutvane/core↗Kernel: container, providers, config, events@strutvane/contracts↗Shared types & wire protocols@strutvane/cli↗Project-local CLI implementation@strutvane/devkit↗SDK for installers, generators, plugins@strutvane/logs↗Zero-config logging + log viewer
↓ Scroll to explore the problem, architecture and stack
The problem
Every B2B product rebuilds the same backbone by hand: CRUD APIs, migrations, login, roles and permissions, tenant isolation, audit logs and admin screens. Code generators save a day but leave a pile of code nobody wants to touch, and “low-code” tools lock you in — and most frameworks keep RBAC, audit and SSO behind a paid tier.
Why it matters
Strutvane aims for “Laravel’s ecosystem, built natively for TypeScript”: a realistic app with 10–20 models, auth, RBAC and a full UI running in one to two hours, without giving up ownership. Generated files are thin and read model metadata at runtime, so adding a field never means regenerating code — and enterprise features stay MIT-licensed in the open core.
What you can do with it
How it’s built
A simplified view of the architecture — follow the dots as a request moves down the layers.
A request, step by step
- npm create strutvane@latest acme asks for a preset, database, auth methods and tenancy, and generates the project with .env + .env.example, local Docker services, an admin seed and CI.
- pnpm sv make:model Invoice … writes a thin invoice.model.ts; pnpm sv migrate diffs models against the database and writes a reviewed SQL migration — asking about renames and blocking destructive changes.
- On pnpm dev, a registry compiler reads your models with static analysis (never executing your code) and generates a typed registry and API client.
- Each request: resolve the actor and tenant → parse the list query → validate with Zod → check permissions and compile the policy to SQL → run in a transaction with the tenant set for row-level security.
- Hooks and the handler run; the audit entry and outbox events are written in the same transaction; only fields the actor may see are returned — or an RFC 9457 problem+json error.
- The React UI reads /.well-known/strutvane.json and renders list, form and detail pages for /invoices automatically.
Tech stack
What I built
- Founded and lead the project: 12 GitHub repositories in the vishwajit-vm organisation and 10 reserved npm package names (strutvane, create-strutvane and @strutvane/*).
- Wrote the blueprint: 18 design documents (architecture, developer experience, package specs, CLI reference, security model with a STRIDE threat model mapped to OWASP API Top 10 and ASVS 5.0 L2, roadmap, integration map), 16 architecture decision records and 4 RFCs.
- Ran 9 time-boxed validation spikes against real engines (PGlite, libSQL, PostgreSQL 18, PgBouncer) — 419 tests in total — because “mocks don’t count as evidence”.
- Turned every defect the spikes found into a mandatory rule: a tenant leaking through PgBouncer 40/40 times, sessions surviving a password reset, timing that revealed which emails exist, X-Forwarded-For spoofing, and log rotation breaking across processes.
- Built and released the shared foundation: @strutvane/contracts (v0, 100% coverage), shared tooling with SHA-pinned CI and npm trusted publishing, and the live documentation site.
- Passed the Phase 0 gate (2026-11-14) and planned Phase 1: core, CLI, devkit, framework and logs → 0.1 alpha.
Hard problems & how I solved them
✅ Generated files are thin and read model metadata at runtime, so adding a field needs no regeneration. Four levels — declare, configure, override, eject — cover the rest, and ejected code upgrades with a three-way merge.
✅ Packages never import each other. They cooperate only through shared contracts, container tokens, hooks, events and installer “enhances” — enforced in CI.
✅ Isolation is enforced inside the database with row-level security under five mandatory rules (ADR-0007), on top of app-level query scoping — proven with 2,400 concurrent transactions and 0 cross-tenant rows.