
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.
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)!
}
}
- A route points at a static method. No reflection, no controller registry.
@Dto()marks an input class.build_runnergenerates the checks from the fields and their types.- The generated schema. The same schema feeds the OpenAPI docs.
- 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
422before your code runs. - 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.
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:
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 buildmakes 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
@Dtoclass. 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
- Found a bug or have a question? Open an issue on GitHub.
- Using an AI assistant? Give it llms-full.txt: all of these docs as one plain text file. llms.txt is the page list.
- Want to help? Read Contribute.