Skip to content

Connectum Framework

What is Connectum?

Connectum is a production-ready framework for building gRPC/ConnectRPC microservices on Node.js 18+. It eliminates boilerplate by bundling health checks, observability, resilience, authentication, and graceful shutdown into a single createServer() call.

Engineering teams with enterprise requirements -- observability, mTLS, RBAC, circuit breakers -- need a unified, well-designed framework instead of gluing together dozens of libraries. Connectum provides that foundation with a pluggable architecture where every capability is an explicit, optional package.

The Problem

Building production-ready gRPC/ConnectRPC microservices on Node.js requires:

  • A lot of boilerplate code for every new service
  • Manual observability setup (tracing, metrics, logging)
  • Integration of health checks and graceful shutdown
  • TLS, validation, and reflection configuration
  • Understanding multiple libraries and their interactions

Existing solutions (NestJS, tRPC) are either too heavy or lack native gRPC support.

What Connectum Provides

FeatureDescription
gRPC/ConnectRPC ServerHTTP/2 server with gRPC, ConnectRPC, and gRPC-Web support
TLS SupportBuilt-in TLS, mTLS, auto-reload certificates
Health ChecksgRPC Health protocol + HTTP /healthz, /readyz endpoints
Graceful ShutdownDrain connections, configurable timeout, ordered shutdown hooks
Interceptors ChainResilience interceptors with fixed execution order
OpenTelemetryDistributed tracing, RPC metrics, structured logging
Server ReflectiongRPC Server Reflection for grpcurl and similar tools
Auth & AuthzJWT, gateway, session auth; declarative RBAC; proto-based authorization
Input Validationprotovalidate integration for automatic request validation
CLI ToolsCode generation and project scaffolding

Core Principles

These principles guide every design decision in Connectum. Each links to its Architecture Decision Record for full rationale.

  1. Native TypeScript -- write TypeScript natively on Node.js 25+; packages compile to JS + type declarations for consumers on Node.js 18+. ADR-001

  2. Modular Architecture -- eight packages organized in dependency layers where each layer can only depend on lower layers. ADR-003

  3. Pluggable Protocols -- health checks and server reflection are separate packages registered via the protocols array; custom protocols implement the same interface. ADR-022

  4. Resilience by Default -- a fixed-order interceptor chain (errorHandler, timeout, bulkhead, circuitBreaker, retry, fallback, validation) with per-interceptor configuration. ADR-006

  5. Proto-First Validation -- request validation uses protovalidate constraints defined directly in .proto files and enforced automatically by the validation interceptor. ADR-005

  6. Explicit Lifecycle -- createServer() is the single entry point with no hidden defaults; interceptors and protocols are explicit parameters. ADR-023

  7. Observable by Design -- OpenTelemetry instrumentation is a first-class package providing distributed tracing, RPC metrics, and structured logging out of the box.

  8. Production-Ready -- TLS/mTLS, graceful shutdown with dependency-ordered hooks, JWT/RBAC auth, and Kubernetes-compatible health probes are built-in capabilities.

Architecture Overview

Layer 0 (Foundation): @connectum/core -- server factory with lifecycle control, zero internal dependencies.

Layer 1 (Extensions): Authentication, interceptors, health checks, reflection -- depends on Layer 0 or external packages only.

Layer 2 (Tools): OpenTelemetry, CLI, testing utilities -- may depend on all lower layers.

Non-Goals

  • Not an ORM -- Connectum does not manage databases
  • Not a full-stack framework -- gRPC/ConnectRPC server-side only
  • Not CommonJS -- ESM only
  • Not legacy Node.js -- requires Node.js 18+ (development requires Node.js 25+)

Next Steps

External Resources