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, RPC, and WebSocket;
- 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
- WebSocket
- Cron
- Events
- Logger Transports
- Config and Logging
- Errors and Filters
- API Surface
Installation
bash
pnpm add @smounters/core 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/core/core@smounters/core/decorators@smounters/core/services@smounters/core/pipes@smounters/core/validation@smounters/core/ws
Validation subpath also exports the built-in app config schema:
appConfigSchemaAppConfig
Ecosystem
| Package | Description |
|---|---|
@smounters/core | Core framework (this package) |
@smounters/cron | Cron scheduling with @Cron() decorator |
All packages are in a single monorepo.