Skip to content

Doxie, the Dox mascot

Fast backends in Dart

Everything your Dart backend needs.

Build APIs and full web apps in Dart, with batteries included. Routing, an ORM, validation, auth and a CLI work from the first command. One command adds the rest: queues, mail, GraphQL and more. Your app uses every CPU core and ships as one small native binary.

Build your first API Star on GitHub

req/s p99 RAM
Doxnative server 652,400fastest 0.7 ms 21 MB
Rusthyper 572,1321.14× slower 0.8 ms 14 MB
BunBun.serve 504,6721.29× slower 1.0 ms 40 MB
Relic 2relic_native 471,0051.39× slower 0.7 ms 40 MB
Nodenode:http 282,1302.3× slower 1.7 ms 199 MB
Gonet/http 237,1462.8× slower 3.3 ms 36 MB
dart:ioHttpServer 124,9965.2× slower 4.8 ms 56 MB

All results

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.

What you get

  • Fast by default

    A native 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 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, S3 and Azure Blob Storage 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.

One path for every request

  1. Routematch the URL
  2. Middlewarego on or stop
  3. DTOcheck the input
  4. Controlleryour code
  5. Viewrender a page
  6. Responsesend the answer

Each card is a page in "The basics". See How Dox works for every step.

What the code looks like

Route.post('/blogs', (BlogController c) => c.store);

@Inject() // 1
class BlogController {
  BlogController(this.blogs);
  final BlogService blogs;

  Future<Blog> store(CreateBlog input) { // 2
    return blogs.create(input);
  }
}

@Dto() // 3
class CreateBlog {
  @Length(min: 3, max: 100)
  final String title;

  @MinLength(10)
  final String body;
  ...
}
  1. Dox makes the controller and gives it the service it asks for. There is no reflection and no list of classes to keep.
  2. Ask for the DTO as a parameter. Dox reads the JSON body, checks it, and gives you a typed object. Bad input gets a 422 before your code runs.
  3. @Dto() marks an input class. The code generator writes the checks from the fields, their types and their rules.

Run it in two minutes

You need Dart 3.13 or newer, and nothing else. The starter project uses SQLite, so there is no database to install.

Start the app
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
In a second terminal, call the first route
curl localhost:3000/ping
pong

That is a Dox app. Next, follow 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

Get help