Imperium
Inspired by NestJS, built on top of
tsyringe,Fastify, andConnectRPC.
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
- Getting Started
- Application Bootstrap
- Modules and DI
- HTTP
- RPC
- Config and Logging
- Errors and Filters
- API Surface
Installation
bash
pnpm add @smounters/imperium reflect-metadata tsyringe fastify @connectrpc/connect @connectrpc/connect-fastify zodIn 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:
appConfigSchemaAppConfig