Skip to content

nestelia

nestelia is a modular, decorator-driven framework built on top of Elysia and Bun. It provides decorators, dependency injection, modules, and lifecycle hooks for building structured server-side applications.

WARNING

nestelia is under active development. APIs may change before the stable release.

Why nestelia?

Elysia is one of the fastest Bun-native HTTP frameworks. nestelia adds a structured, modular architecture on top of it — without sacrificing Elysia's performance.

  • Decorators@Controller, @Get, @Post, @Body, @Param, and more
  • Dependency Injection — constructor-based DI with singleton, transient, and request scopes
  • Modules — encapsulate controllers, providers, and imports into cohesive units
  • Lifecycle HooksOnModuleInit, OnApplicationBootstrap, OnModuleDestroy, and others
  • Guards, Interceptors, Pipes — request pipeline extensibility
  • Middleware — class-based and functional middleware support
  • Exception Handling — built-in HTTP exceptions with automatic error responses
  • TypeBox validation — schema-based request validation via Elysia's native TypeBox integration

Packages

Beyond the core, nestelia ships optional packages:

PackageDescription
nestelia/schedulerCron jobs, intervals, and timeouts
nestelia/microservicesRedis, RabbitMQ, TCP transports
nestelia/apolloApollo GraphQL code-first integration
nestelia/passportPassport.js authentication strategies
nestelia/testingIsolated test modules with provider overrides
nestelia/cacheHTTP response caching with decorators
nestelia/rabbitmqAdvanced RabbitMQ messaging
nestelia/graphql-pubsubRedis PubSub for GraphQL subscriptions

Quick Example

typescript
import { createElysiaApplication, Controller, Get, Module, Injectable, Inject } from "nestelia";

@Injectable()
class GreetService {
  hello() {
    return { message: "Hello from nestelia!" };
  }
}

@Controller("/greet")
class GreetController {
  constructor(@Inject(GreetService) private greet: GreetService) {}

  @Get("/")
  sayHello() {
    return this.greet.hello();
  }
}

@Module({
  controllers: [GreetController],
  providers: [GreetService],
})
class AppModule {}

const app = await createElysiaApplication(AppModule);
app.listen(3000);

Claude Code Skill

A Claude Code skill is available for nestelia. It provides scaffolding templates, decorator usage, and best practices directly in your AI assistant.

bash
npx skills add nestelia/nestelia

Once installed, Claude Code will automatically use the correct patterns when working with nestelia.

Next Steps

Released under the MIT License.