Skip to content

Fast backends
in Dart

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.

Get started GitHub

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

enum Status { active, draft }

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

class BlogController {
  static Future<List<Blog>> index(BlogFilter query) async {
    // runs on Postgres, MySQL or SQLite
    return Blog().where('status', query.status.name).get();
  }
}

You are reading the 3.x docs (alpha)

3.0.0-alpha.1 is a preview. Things can still change before the stable release.

  • New here? Start with Installation.
  • Need the old docs? Pick 2.x in the version menu at the top.

Quick start

You need Dart 3.13 or newer.

dart pub global activate dox 3.0.0-alpha.1   # install the CLI
dox create new_blog                          # make a new project
cd new_blog && dox s                         # start the server

Why Dox

  • Fast by default

    One isolate per CPU core and streamed bodies. dox build makes an AOT native binary. See Performance.

  • ORM and query builder

    Models, relations, migrations and transactions for Postgres, MySQL/MariaDB and SQLite. See Database.

  • Typed validation

    Typed DTO classes, checked by generated code. See Validation.

  • OpenAPI

    Make OpenAPI 3.1 docs and a Scalar docs page with dox_openapi.

  • File storage

    Local disk and S3 behind one API with dox_storage.

  • Cache

    Memory, file and Redis cache with dox_cache.

  • Real time

    Events with WebSocket or Socket.IO.

  • Security

    JWT authentication, CORS, encryption and hashing.

  • CLI

    Create projects, controllers, models and migrations, and build for production. See Dox CLI.