Skip to content

Doxie, the Dox mascot

Fast backends
in Dart

Everything your Dart backend needs.

Dox is a web backend framework for Dart, like Laravel. Routing, an ORM, migrations, validation, auth and a CLI come in one place. It runs one isolate per CPU core and builds to a small native binary.

Build your first API GitHub Blog

Route.get('/blogs', BlogController.index); // (1)!

enum Status { active, draft }

@Dto() // (2)!
class BlogFilter {
  final Status status; // ?status=active, else 422
  const BlogFilter({required this.status});
  static const DtoSchema<BlogFilter> schema =
      $BlogFilterDto; // (3)!
}

class BlogController {
  static Future<List<Blog>> index(
    BlogFilter query, // (4)!
  ) async {
    return Blog()
        .where('status', query.status.name)
        .get(); // (5)!
  }
}
  1. A route points at a static method. No reflection, no controller registry.
  2. @Dto() marks an input class. build_runner generates the checks from the fields and their types.
  3. The generated schema. The same schema feeds the OpenAPI docs.
  4. Ask for the DTO as a parameter. Dox reads the query (or the body), checks it, and gives you a typed object. Bad input gets a 422 before your code runs.
  5. The ORM. The same code runs on Postgres, MySQL and SQLite. Postgres and MySQL use native Rust drivers.

How fast

Ahead of Rust hyper. 1.3× Bun. 2.2× Node. 4.9× plain Dart.

A full Dox app answers GET /, with the rules of the-benchmarker. Requests per second on two CPU cores, higher is better.

req/s p99 RAM
Doxnative server 638,067fastest 0.7 ms 19 MB
Rusthyper 585,6581.09× slower 0.7 ms 13 MB
BunBun.serve 501,5291.27× slower 1.0 ms 40 MB
Nodenode:http 286,8472.2× slower 1.7 ms 200 MB
Gonet/http 242,0432.6× slower 3.3 ms 36 MB
dart:ioHttpServer 129,7964.9× slower 3.8 ms 75 MB

Dox · Rust 1.99 · Bun 1.4 · Node 26 · Go 1.26 · Dart 3.13 · 2 cores · 256 connections · wrkAll results

Your code is plain Dart. The speed comes from the native server: it runs on the isolate's own thread, so a request never waits for another thread. See Performance for every route and how it was run.

Run it in two minutes

You need Dart 3.13 or newer. Nothing else: the starter project uses SQLite, so there is no database to install.

dart pub global activate dox             # install the CLI
dox create my_app                            # download the starter project
cd my_app
dart pub get
dox s                                        # start the server

Open a second terminal and call the first route:

curl localhost:3000/ping
pong

That is a Dox app. Keep going with the tutorial: it adds a model, a database table, validation, login and a Docker image, one short step at a time.

The CLI is not found?

dart pub global activate puts dox in $HOME/.pub-cache/bin. Add that folder to your PATH. See Installation.

Pick your path

You are... Start here Then
New to Dox Tutorial: build a blog API Routing, Request, Validation
Coming from Laravel Coming from Laravel How Dox works
Looking for one answer Guides (uploads, auth, Docker, pagination...) Reference
Going to production Deployment Docker, Troubleshooting

What you get

  • Fast by default

    A Rust HTTP server, one isolate per CPU core and streamed bodies. dox build makes one native binary. See Performance.

  • ORM and query builder

    Models, relations, migrations and transactions for Postgres, MySQL/MariaDB and SQLite. Postgres and MySQL use native Rust drivers. See Database.

  • Typed validation

    Write a @Dto class. Dox checks the input and gives your controller a typed object. See Validation.

  • OpenAPI

    OpenAPI 3.1 docs and a Scalar docs page, made from your routes and DTOs. See dox_openapi.

  • File storage

    Local disk and S3 behind one API, with signed URLs. See dox_storage.

  • Cache

    Memory, file and Redis cache with tags and locks. See dox_cache.

  • Real time

    Socket.IO, with Redis for many servers.

  • Security

    JWT authentication, CORS, encryption and hashing.

  • CLI

    Create projects, controllers, models and migrations. Run, build and migrate. See CLI reference.

Get help