The onion is the framework#
Everything in Rhythm is a middleware: a function that does some work, hands control down the chain, and optionally does more work on the way back up.
Combine onion-style middleware, startup context, and encapsulated modules into a pipeline you can understand from top to bottom.
$bunx rhythmx new my-app
Comparison
Pick the tool you enjoy building with. A few points of speed are a fair price for great DX, but fast and painful is never worth it.
| Bare Bun | Rhythm | Heavy frameworks | |
|---|---|---|---|
| Speed | Fastest possible | Almost the same | Pays for its abstractions |
| Structure | Build it yourself | Composable middleware and modules | Imposed by the framework |
| Types | Cast by hand | Flow through the request | Depends on decorators |
| Magic | None | None, everything explicit | Decorators, DI, conventions |
| DX | Lots of boilerplate | A small, readable pipeline | Powerful, heavy to learn |
How it works
Each middleware wraps the next one. The code before next() runs on the way in; the code after it runs on the way back out.
Features
await next().Ecosystem
Why Rhythm
A framework should be something you compose, not something you inherit.
Everything in Rhythm is a middleware: a function that does some work, hands control down the chain, and optionally does more work on the way back up.
When a middleware contributes something to the request context, such as a validated body, a session, or a request id, that contribution is visible in the types of every handler that runs after it.
There are no decorators, no dependency-injection containers, no file-system conventions, and no hidden execution order.
Begin with the quick start, follow the step-by-step tutorial from a first controller to a production app, read the philosophy behind the design, or create a project with bunx rhythmx new from the starter template for a Nest-style skeleton. If you already know the model, jump to the API reference.