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.

COMPOSITION MAP01 / 05
01HTTP Requestrequest id · headers · body
02Elpodcomposition · DI · lifecycle
03Elysiarouter · schemas · plugins · WS
native surface preserved↘
HOW THE PARTS HOLDELPOD / 0.1

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.

src/features/users/users.pod.tsTS / 04
export const users = pod({
  name: "users",
  prefix: "/users",
  controller: UsersController,
  providers: [UsersService],
  exports: [UserReader],
});
prefix /users
controller routes(app)
providers private graph
exports UserReader
POD/users active
users
controllerUsersController providersUsersService exportsUserReader importsClock
imports / Clock
export edge
↳Application-owned boundaryUse 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

decorators
reflection
service locator
No magic at the route boundary.
No global singleton to discover.
report.service.tsEXPLICIT / 01
export class ReportService {
  static readonly needs = [Clock] as const;

  constructor(private readonly clock: Clock) {}
}
Also readable: 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.

composition enters
composition leaves
Elpodpod wiring · lifecycle
ELY / 01Elysiarouter · schemas · plugins · ws · streamsnative app instance
Elpodrequest scope · diagnostics
routes(app: ElpodElysia) { return app.get(...);}
same instance same route API same response types

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.

elpod / preflightalpha
$ elpod sealarchitecture + DI graphPASS
$ elpod doctorproject + production hazardsPASS
GET /health/liveprocess livenessREADY
GET /health/readydependency readinessREADY
GET /openapi.jsonJSON spec · UI laterREADY
▌ launch boundary recorded
Checks are signals, not a security or availability guarantee.inspect the contracts ↗