Skip to content

TypeScript. Node.js. Built to compose.

A backend that
fits together.

One framework for the process. Focused libraries for the pieces. Build with explicit contracts, typed errors and wiring the compiler can check.

Explicit contractsTypes and validation at the boundary

Typed failuresExpected errors in the return value

Open sourceMIT-licensed, built in the open

Start with the framework

btravstack

From a proven dependency graph to a running service. The kernel owns startup, units of work and graceful shutdown. Your application owns the business logic.

Your application module

HTTPAnswer requests
TemporalOrchestrate work
AMQPBroadcast events

One runtime per process. The same application underneath.

Take the pieces you need.

Use a library on its own, or compose them with the framework. Each has a clear job and its own documentation.

Errors

unthrown

unthrown

Expected failures in the return type. A separate defect channel keeps unexpected failures visible without mixing them into your application errors.

  • Errors as values, typed in E
  • A separate defect channel
  • Zero runtime dependencies

Domain

entity

@btravstack/entity

Declare your domain once. Derive types and request/response schemas from a field map, with sealed construction and behavior that stays with the entity.

  • Branded fields and immutable data
  • Sealed construction, enforced invariants
  • Result instead of throws

Wiring

di

@btravstack/di

Declare ports, bind providers, compose modules. Check the wiring before the process starts and keep implementation details private. Part of the framework; usable on its own.

  • Ports named by the domain, not the adapter
  • Unmet dependencies are compile errors
  • Scoped resources release themselves

Messaging

amqp-contract

@amqp-contract/contract

Type-safe contracts for AMQP & RabbitMQ. Define your exchanges, queues and messages once — get types and runtime validation on both ends.

  • End-to-end type safety
  • Reliable retry with Dead Letter Queues
  • AsyncAPI 3.0 generation

Workflows

temporal-contract

@temporal-contract/contract

Type-safe contracts for Temporal.io. End-to-end types and automatic validation across workflows, activities and clients.

  • Zod validation at every boundary
  • Compile-time implementation checks
  • Result / Future error handling

The tools behind the stack

Expressive to read. Robust to run.

Each package is small, focused and does one thing well — but they share a worldview: expressive code you can understand from its signature alone, and robust code that fails fast enough to learn from.

The signature is the doc

A contract or a function signature should be enough to understand a system. Declare the interface once and read everything from it — no digging into implementations.

Fail fast, everywhere

The sooner the error, the better the code. Anticipated failures are values in the type, malformed data stops at the boundary, missing wiring is a compile error.

Coherence at a high level

Contracts pin down how the pieces fit — publisher and consumer, workflow and client, module and dependency can't drift apart while implementations change underneath.

Better feedback for humans and agents.

Clear contracts make both human and AI-assisted work easier to check. The compiler is one feedback loop, alongside tests, runtime validation and review.

The tightest feedback loop

An agent is only as good as the signal it gets back. Fail-fast code turns a wrong guess into a precise error in seconds — and fast errors are what make iteration converge.

One clear signal

Typechecking gives generated code a reproducible check against your declared contracts. It catches mismatches early; it does not prove the program is correct.

Review at the contract level

Expressive contracts carry the intent. You review interfaces while the AI churns through implementations — the compiler checks the connections. Tests and human review still check the behavior.

Standing on good shoulders.

BtravStack borrows its instincts from the libraries that made TypeScript feel this way in the first place.

Build backends you can trust the types of.

Star the projects, open an issue, or just read the docs. Everything is MIT-licensed and built in the open.

View on GitHub