Backend Framework

tzin

[ Open Source ][ Active ]

Contract-first TypeScript framework. Types that scale. Realtime built in. AI-native from day one.

tzin is a contract-first TypeScript backend framework: declare your API contract once — with TypeBox — and get end-to-end typing, request validation, automatic OpenAPI 3.1 docs, an MCP server, and an LLMs.txt index ready for AI agents. Scaffold with npx create-tzin (Node, Bun or Workers), then use the CLI, DI, ORM, auth, jobs, logging, realtime channels with presence, Workers Durable Objects, Redis clustering, and test utilities. Stable at 1.0.8, with type inference that scales linearly.

// Features

  • Type-safe contracts: params, body, and responses declared once in TypeBox — handler inputs are extracted, and the compiler enforces your responses
  • OpenAPI 3.1, an MCP server, and an LLMs.txt AI-readable API index generated automatically from contracts
  • Realtime channels (SSE + WebSocket) with Phoenix-style presence and a zero-dependency browser client — multi-node via any MessageBus (Redis, Postgres, Workers DO)
  • CLI: tzin dev with hot reload, tzin build, deploy to Node (--pack/--docker) or Workers, and route/middleware/test scaffolding via npx create-tzin
  • Integrated ORM, auth, jobs, structured logging, typed DI, and onion middleware — plus Docker multi-stage + compose ready to ship
  • Type inference scales strictly linearly: ~130 types per endpoint, benchmarked against 300+ typed routes

// Technologies

// quick-start — v1.0.8

npm install @carlos-tzin/tzin
npx create-tzin my-app    # Node / Bun / Workers
npx tzin dev              # hot reload + route table
npx tzin deploy --target node --docker my-app:1.0.8

1.0.7 → CLI `tzin` instalable (bin + shebang) y exit codes propagados · 1.0.8 → `tzin.config.ts` aplicado vía import dinámico.