← Back to all projects
🧭

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.

12 repositories10 npm packages9 spikes · 419 tests16 ADRs · 4 RFCs

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

↓ 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

01Start a project with npm create strutvane@latest — full-stack, API-only or UI-only (planned).
02Declare a model once with defineModel and field.*, and get a migration, a CRUD API and screens from it (planned).
03Get OpenAPI 3.1 docs at /docs and a typed client for free (planned).
04Secure every route with RBAC/ABAC policies that compile to SQL, with Postgres row-level security for tenants (planned).
05Choose your level of control: declare, configure, override or eject (L0–L3) — and upgrade ejected code with a three-way merge (planned).
06Add packages with sv add; each one installs its own config, .env + .env.example, migrations, routes and screens (planned).
07Read the friendly, example-first documentation today at the live docs site.

How it’s built

A simplified view of the architecture — follow the dots as a request moves down the layers.

Your app
app/ modelsdefineModel
web/owned UI code
Product packages
frameworkmodels · CRUD API
authRBAC · tenancy
uiReact screens
Adapters
Database driversPostgres · MySQL · SQLite
HTTP hostsHono · Express · Fastify · Nest
Kernel & SDK
corecontainer · providers · events
devkitinstallers · generators
Foundation
contractszero runtime deps

A request, step by step

  1. 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.
  2. 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.
  3. On pnpm dev, a registry compiler reads your models with static analysis (never executing your code) and generates a typed registry and API client.
  4. 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.
  5. 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.
  6. The React UI reads /.well-known/strutvane.json and renders list, form and detail pages for /invoices automatically.

Tech stack

Language
Node.jsTypeScript (strict, ESM)
Backend
🔗RESTHonoDrizzleKyselyZodOpenAPI 3.1
Data
PostgreSQLMySQLSQLiteValkey
Frontend
ReactViteTailwind CSSTanStack
Security
🛡️RBAC🔑OAuth / OIDCRow-level security
Platform
GitHub ActionsOpenTelemetrynpm trusted publishing

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

❓ Generate everything, yet own every line?

✅ 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.

❓ Independent packages that still fit together.

✅ Packages never import each other. They cooperate only through shared contracts, container tokens, hooks, events and installer “enhances” — enforced in CI.

❓ No cross-tenant data leaks.

✅ 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.