Skip to content

Imperium

Inspired by NestJS, built on top of tsyringe, Fastify, and ConnectRPC.

Imperium is a modular DI framework for TypeScript services that need:

  • a single server for HTTP and RPC;
  • module boundaries with explicit exports/imports;
  • request-scoped handlers;
  • Nest-like decorators and lifecycle hooks;
  • structured logging and schema-validated runtime config.

Start Here

Installation

bash
pnpm add @smounters/imperium reflect-metadata tsyringe fastify @connectrpc/connect @connectrpc/connect-fastify zod

In your entrypoint:

ts
import "reflect-metadata";

Public Import Paths

Root import is intentionally disabled. Use subpaths:

  • @smounters/imperium/core
  • @smounters/imperium/decorators
  • @smounters/imperium/services
  • @smounters/imperium/pipes
  • @smounters/imperium/validation

Validation subpath also exports the built-in app config schema:

  • appConfigSchema
  • AppConfig

Last updated:

Inspired by NestJS. Built for internal and public TypeScript backends.