Introduction
Build modular, type-safe Bun applications with dependency injection, route validation, and direct access to Elysia.
AponiaJS is an experimental, Bun-first TypeScript application framework. It adds modules, decorated controllers, request parameter decorators, Standard Schema route validation, singleton dependency injection, explicit provider visibility, structured diagnostics, and a native Elysia integration.
Experimental software
AponiaJS 0.6.0-alpha.18 is under active development and is not recommended
for production yet. The API is pre-1.0 and can change between releases. All
public packages publish to the npm alpha channel.
Start here
Create a project
Generate a working Bun application with the Aponia CLI.
Add to an existing project
Install the HTTP platform in a Bun project you already have.
Browse the documentation
Essentials
Modules, dependency injection, routing, validation, errors, lifecycle.
Elysia platform
Native access, plugin modules, typed context, Eden Treaty.
Recipes
Task-shaped walkthroughs that combine the essentials.
Compare frameworks
AponiaJS against NestJS, AdonisJS, Elysia, Express, Fastify, and Hono.
Migrate
Move from NestJS, or adopt modules inside an Elysia application.
CLI
Generate applications, resources, and components.
API reference
Every public export in the alpha package surface.
The application model
main.ts
-> AponiaFactory.create(AppModule) or createNative(AppModule)
-> module graph validation
-> singleton provider construction
-> native plugin mounting and direct route registration
-> managed lifecycle or the composed Elysia applicationA normal HTTP application installs @aponiajs/common,
@aponiajs/platform-elysia, and the Elysia peer dependency. Most applications
do not install @aponiajs/core directly.
bun add @aponiajs/common@alpha @aponiajs/platform-elysia@alpha elysia@^1.4.29import { Controller, Get, Injectable, Module, Param } from "@aponiajs/common";
import { AponiaFactory } from "@aponiajs/platform-elysia";
@Injectable()
class GreetingService {
greet(name: string): string {
return `Hello, ${name}!`;
}
}
@Controller("greetings")
class GreetingController {
constructor(private readonly greetings: GreetingService) {}
@Get(":name")
getGreeting(@Param("name") name: string): string {
return this.greetings.greet(name);
}
}
@Module({
controllers: [GreetingController],
providers: [GreetingService],
})
class AppModule {}
const app = await AponiaFactory.create(AppModule);
await app.listen(3000);What is implemented
- decorated modules, controllers, and the seven HTTP method decorators;
- request parameter decorators for body, query, params, headers, cookies, request, response settings, and context;
- Standard Schema route validation — Zod,
ArkType, Valibot — plus platform-native TypeBox and Elysia
tvalidators, used raw or through named@Validation()model classes; - WebSocket gateways over the native Elysia and Bun socket runtime;
- RFC 9457 Problem Details responses thrown with
httpErrorandhttpErrors; - singleton class, value, factory, and alias providers with explicit tokens;
- native Elysia plugin imports, including typed plugin context;
- managed and native application bootstraps, including statically composed Elysia route types for Eden Treaty;
- bootstrap-compiled controller invokers and explicit Elysia AOT/precompile policy;
- structured system logging and the complete CLI schematic catalog.
Documentation baseline
These docs were reviewed against AponiaJS 0.6.0-alpha.18 on
a3ab9ff.
Source code and package exports are authoritative when a pre-1.0 release differs
from this site.