Daravel documentation
Daravel is a backend framework for Dart that follows the Laravel 11/12
philosophy and compiles to a native AOT executable. If you know Laravel, you
already know where things are: routes, controllers, form requests, Eloquent
style models, migrations, queues, the scheduler and artisan (here
dartisan).
Laravel and Daravel are designed to run side by side on the same
database. Error and pagination JSON, Sanctum tokens, bcrypt hashes, Crypt
payloads and the framework tables use Laravel's formats, and a conformance
suite keeps them that way. See Laravel coexistence.
Why Daravel?#
- One native bundle: AOT machine code with SQLite bundled; no runtime or source on the server (Deployment).
- No reflection, no
build_runner: generators write plain Dart into explicit registries. - Every core on one port: a supervisor with worker isolates and a coordinator for locks, cache and rate limits, without Redis.
- Request state stays in its request:
Zonescopes for requests, jobs and commands; zone-aware transactions. - Runs next to Laravel on the same database (coexistence, migrating).
- Routes that document themselves:
.validates()and.returns()enforce 403/422 and generate OpenAPI 3.1 (Routing). - Guard rails included: hashing in compute isolates, AST lints, and security and conformance suites.
Performance numbers come from a reproducible harness, never from claims (Performance).
Guides#
- Getting started: install, create a project, serve, build.
- Routing: routes, groups, middleware, resources, rate limits.
- Validation: rules, form requests, the 422 format.
- Database: migrations, the query builder, models, pagination.
- Responses and resources: JSON, API resources, errors.
- Authentication and authorization: tokens, JWT, hashing, Crypt, gates.
- Cache, events, queues, scheduling.
- Strings, helpers and collections:
Str,retry,once,pluck, ... - HTTP client: outgoing requests with
Http, retries andHttp.fake(). - Testing:
TestClient, database helpers, fakes, conformance. - Deployment: native bundles, Docker, Cloud Run, VPS (systemd + Caddy).
- Laravel coexistence: the compatibility contract.
- Migrating from Laravel: move endpoints one at a time behind a proxy.
- Security: secure defaults and the security suite.
- Performance: the benchmark harness.
- Laravel ⇄ Daravel parity table (generated).
Bahasa Indonesia: Dokumentasi Daravel.
Code samples in these guides are copied from compiled, tested files
(packages/daravel/test/docs/guide_examples_test.dart) by
dart run tool/docs/generate.dart, so they cannot go stale.