Ignis is a high-performance, enterprise-grade Server Infrastructure framework for TypeScript, built on top of Hono. It is designed to bridge the gap between minimalist web frameworks and structured enterprise solutions (like LoopBack 4 or NestJS).
- Goal: Provide a standardized, opinionated architecture for building scalable backend systems using modern tools (Bun, Drizzle, Hono).
- Philosophy: "Enterprise patterns (IOC, Repositories) meet performance (Hono/Bun)."
- Runtime: Bun (Primary/Recommended) v1.3+, Node.js (Supported) v18+.
- Language: TypeScript v5.x (Strict Mode).
- Web Framework: Hono v4.x.
- ORM: Drizzle ORM (PostgreSQL via
node-postgres). - Database: PostgreSQL v14+.
- Validation: Zod (Schema validation & OpenAPI generation).
- Documentation: OpenAPI 3.0 (via
@hono/zod-openapi), Scalar UI, Swagger UI.
- Monorepo: Managed via Bun Workspaces.
- Dependency Injection: Custom IOC container using
reflect-metadata. - Repository Pattern: Strict Layered Architecture (Controller -> Service -> Repository -> DataSource).
- Mixins: Used for composable logic in Repositories (
DefaultFilterMixin,FieldsVisibilityMixin).
The project is organized as a Monorepo:
core(@venizia/ignis): The main framework entry point. Exports base classes (BaseApplication,BaseController,DefaultCRUDRepository) and core logic.boot(@venizia/ignis-boot): Handles application bootstrapping, artifact auto-discovery, and loading strategies.inversion(@venizia/ignis-inversion): The Dependency Injection (IOC) container implementation.helpers(@venizia/ignis-helpers): Shared utility functions and types.dev-configs(@venizia/dev-configs): Shared configuration for ESLint, Prettier, and TypeScript.docs: Documentation site and MCP server.
vert: A complete, production-ready backend implementation featuring:- Advanced PostgreSQL integration with Drizzle ORM.
- JWT-based Authentication and Authorization.
- Comprehensive Swagger/OpenAPI 3.0 documentation.
- Full CRUD repositories and modular services.
- Integrated logging and environment-flow configuration.
Ignis uses a decorator-based DI system similar to LoopBack 4:
- Decorators:
@inject,@service,@controller,@repository,@datasource. - Binding: Keys are structured (e.g.,
datasources.PostgresDataSource). - Scopes: Supports Singleton, Transient, and Request scopes.
The framework implements a robust Repository pattern with built-in transaction support:
- Hierarchy:
AbstractRepository->ReadableRepository->PersistableRepository->DefaultCRUDRepository. - Transaction Mechanism:
- Transactions are managed via
resolveConnector({ transaction }). - Logic: The
DataSourcecreates a new ephemeral Drizzle instance (drizzle({ client, schema })) bound to a specificPoolClientbut sharing the global schema. - Usage: Repositories can seamlessly switch between the global pool and a transaction client without code changes in the business logic.
- Transactions are managed via
- Wrapper: DataSources wrap Drizzle ORM instances.
- Schema Discovery: The framework automatically scans registered repositories to build the Drizzle schema object at runtime, allowing for "Code-First" schema definition via Models.
- Declarative Routing:
@get,@post,@put,@deletedecorators define routes. - Zod Integration: Request bodies and Response shapes are defined using Zod, which automatically generates OpenAPI specifications.
- Bun installed (
curl -fsSL https://bun.sh/install | bash). - PostgreSQL running locally or via Docker.
- Clone:
git clone <repo> - Install: Run
bun installin the root (installs dependencies for all workspaces).
- Build Framework:
bun run build(Compiles all packages). - Run Example (Vert):
cd examples/vert bun run server:dev - Linting:
bun run lint(ESLint + Prettier). - Clean:
bun run clean.
- Define a Model (
src/models/entities/user.model.ts). - Create a Repository (
src/repositories/user.repository.ts) extendingDefaultCRUDRepository. - Register in Application.
- Run Migrations:
bun run migrate:dev(wrapsdrizzle-kit).
- Raw Queries: Use
this.resolveConnector({ transaction })in repositories to get a transaction-safe Drizzle instance. - Query API: Use
this.getQueryInterface({ options })for Drizzle's Relational Query API (db.query...). - Hidden Fields: The
FieldsVisibilityMixinautomatically handles stripping sensitive fields (defined in Models) from responses.