# dunx > Controllers, dependency injection, validation, OpenAPI, WebSockets, queues, an ORM, auth, a test harness and an ops dashboard. Released together, tested together, on Bun's own primitives. Every link under Setup, Guide and Reference is raw markdown, fetchable as-is. ## Setup - [Setting up dunx](https://dunx.win/setup.md): Instructions for an agent setting up a dunx application. ## Guide - [Introduction](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/01-introduction.md): dunx is a dependency injection framework for Bun. - [First steps](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/02-first-steps.md): You will scaffold an app, walk through each file, then add a route, a service and a test. - [Providers](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/03-providers.md): A provider is anything the container can hand you: a service, a repository, a configuration object, a database connection. - [Modules](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/04-modules.md): A module is a scope: a named set of registrations that are private to it, plus a list of tokens it makes visible to whoever imports it. - [Controllers](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/05-controllers.md): A controller is a provider with routes on it. - [Validation](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/06-validation.md): A route declares the shape of what it accepts on the decorator itself. - [Lifecycle](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/07-lifecycle.md): One lifetime, four hooks, eager boot. - [Middleware and guards](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/08-middleware-and-guards.md): Nest has five request concepts: middleware, guards, interceptors, pipes and filters. - [WebSockets](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/09-websockets.md): A gateway is a class in `providers` with `@Gateway('/path')` on it. - [OpenAPI](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/10-openapi.md): `@dunx/openapi` builds an OpenAPI 3.1 document out of the schemas the routes already validate against, and serves it. - [Testing](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/11-testing.md): `@dunx/testing` is centred on two functions and a logger, `createTestApp`, `createTestServer` and `RecordingLogger`, with `testRoot`, `testClient` and `http2Client` for the cases they do not cover. - [Configuration](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/12-configuration.md): `ConfigModule` in `@dunx/core` turns environment variables into a typed object once, at boot, and fails boot if a value is missing or invalid. - [Logging](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/13-logging.md): dunx logs every HTTP request by default, in an app that imported no logging module at all, and it does that without `@dunx/core` taking a single dependency. - [Database](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/14-database.md): `@dunx/infra/db` is drizzle, wired into the container. - [Caching](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/15-caching.md): `Cache` reads and writes values with a lifetime. - [Scheduling](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/16-scheduling.md): `@Cron`, `@Interval` and `@OnceOnBoot` run a method on a schedule. - [Authentication](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/17-authentication.md): Authentication in dunx is better-auth. - [Files and images](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/18-files-and-images.md): Two subpaths, both built on Bun primitives. - [bullmq over Redis](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/19-queues.md): `@dunx/infra/queue` runs bullmq jobs on dunx services. - [RabbitMQ over AMQP](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/20-message-brokers.md): RabbitMQ is the broker, and `rabbitmq-client` is the client. - [Deployment](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/21-deployment.md): A dunx app is a Bun process that calls `Bun.serve`. - [Health checks](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/22-health-checks.md): `HealthModule` mounts two routes and gives an orchestrator something to read. - [Agent tooling](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/23-agent-tooling.md): An agent working in a dunx application spends most of its budget rediscovering things the framework already knows: which routes exist, what validates a body, which module bound a provider, why boot... - [Metrics](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/24-metrics.md): Counts and timings for requests, database queries, cache reads, Redis commands and queue jobs, as JSON. - [Upgrading](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/25-upgrading.md): What changed, and the line that replaces each thing. - [Resilience](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/26-resilience.md): Timeout, retry, exponential backoff, jitter and fallback around one operation. - [Events](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/27-events.md) - [RPC](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/28-rpc.md): `@dunx/http/connect` serves protobuf services over the Connect and gRPC-Web protocols, on the port `Bun.serve` already has and through the middleware chain the app already has. - [Email](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/29-email.md): `@dunx/infra/email` gives you an `EmailTransport` contract, dry runs, rate limiting, templates, address checks and a preview server on `Bun.serve`. - [Publishing a package](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/30-publishing-a-package.md): A dunx package is a module other applications import. - [Tracing](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/31-tracing.md): Import `OtelModule` and every request served, call made, query run and message handled opens an OpenTelemetry span. - [Security](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/32-security.md): ## Response headers - [Idempotency](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/33-idempotency.md): Mark a route `@Idempotent()` and a client retrying it with the same `Idempotency-Key` gets the first response back instead of a second run. - [Versioning](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/34-versioning.md): Turn on versioning and give a controller a version. - [Cookies](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/guide/35-cookies.md): Read and set cookies on `req.cookies`, Bun's own `CookieMap`. ## Reference - [Migrating from NestJS](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/MIGRATION-FROM-NEST.md): What a production NestJS app uses, and what to write instead in dunx. - [Dependency injection](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/architecture/dependency-injection.md): The decorator dialect, how constructor types are recorded without metadata, and why modules group rather than encapsulate. - [The HTTP layer](https://raw.githubusercontent.com/petarzarkov/dunx/main/docs/architecture/http.md): The Bun.serve adapter, how routes are discovered, and multi-node websocket fan-out. ## Optional - [The documentation site](https://dunx.win/): The same guides rendered, plus the API reference and the benchmarks. - [The repository](https://github.com/petarzarkov/dunx): Source, examples and the architecture notes the site does not publish.