Bun-native application structure
Elpod for
Elysia on Bun.
Elpod is a decorator-free application framework for modular Elysia services on Bun. It adds explicit constructor dependency injection and feature pods while keeping native Elysia routes.
ALPHA / 0.1.x Working alpha. Pin Elpod and Bun versions; APIs may change.
SCENE 02 / FEATURE BOUNDARY
Give a feature a perimeter.
A pod is a composition value—not a process, not a deployment unit. It names what belongs together and what may cross the edge.
export const users = pod({
name: "users",
prefix: "/users",
controller: UsersController,
providers: [UsersService],
exports: [UserReader],
}); imports / exports when a real feature dependency crosses the line.SCENE 03 / EXPLICIT DI
Read the graph in the class.
Static tuples are easy to typecheck, test, and run in Bun. The dependency is a value you can see—not metadata hidden in a transform.
NOT IN THE GRAPH
No global singleton to discover.
export class ReportService {
static readonly needs = [Clock] as const;
constructor(private readonly clock: Clock) {}
} static readonly inject = [Clock] as const; “inject” remains the canonical generated spelling.SCENE 04 / NATIVE SURFACE
Keep the engine you chose.
Elpod composes around Elysia. Your controller receives the same app instance, so schemas, plugins, WebSockets, and streams stay native.
routes(app: ElpodElysia) { return app.get(...);}SCENE 05 / LAUNCH CHECKLIST
A little structure before lift-off.
Useful checks for the boundaries Elpod actually owns. The rest belongs to your application and deployment.
Docs