Skip to main content

daravel 1.0.0-beta.1 copy "daravel: ^1.0.0-beta.1" to clipboard
daravel: ^1.0.0-beta.1 copied to clipboard

A Laravel-inspired, AOT-native backend framework for Dart with routing, validation, an ORM, auth, queues and Laravel-compatible wire formats.

Daravel

daravel #

A Laravel-inspired, AOT-native backend framework for Dart. Routing, middleware, validation with Laravel's rules and messages, a query builder and an Eloquent-style ORM, migrations, Sanctum-compatible tokens, JWT, gates, cache, queues, events, a scheduler, API resources, storage and structured logging, served by one native executable that scales across isolates.

Laravel and Daravel can share a database: error and pagination JSON, Sanctum tokens, bcrypt hashes, Crypt payloads and the framework tables use Laravel's formats, locked by a conformance suite.

Get started #

The fastest way is the CLI, which creates a complete project:

dart pub global activate dartisan_cli
dartisan new blog
cd blog
dart run bin/dartisan.dart migrate --seed
dart run bin/dartisan.dart serve --watch

Or add the framework to an existing package:

dart pub add daravel
import 'package:daravel/daravel.dart';

Application createApp() => Application.configure(basePath: '.')
    .withRouting(
      apiPrefix: '/api',
      api: (router) {
        router.get('/ping', (_) => {'message': 'pong'});
        router.post('/users', (request) async {
          final data = await request.validate({
            'email': 'required|email|unique:users',
            'password': 'required|min:8|confirmed',
          });
          return Response.created(data.toMap());
        });
      },
    )
    .create();

Future<void> main() async => Application.serveWith(createApp);

See example/main.dart and the documentation, including the Laravel ⇄ Daravel parity table.

  • dartisan_cli: project creation, dev server with hot reload, generators, migrations, native builds.
  • daravel_test: TestClient, assertions, database helpers, fakes and Laravel conformance matchers.
  • daravel_lints: AST lint rules for Daravel applications.

License and trademarks #

MIT. "Laravel" is a trademark of Laravel Holdings Inc.; "Dart" and "Flutter" are trademarks of Google LLC. Daravel is an independent project, not affiliated with or endorsed by either.

0
likes
0
points
322
downloads

Documentation

Documentation

Publisher

verified publisherframework.daravel.dev

Weekly Downloads

A Laravel-inspired, AOT-native backend framework for Dart with routing, validation, an ORM, auth, queues and Laravel-compatible wire formats.

Homepage
Repository (GitHub)
View/report issues

Topics

#server #backend #framework #http #orm

License

unknown (license)

Dependencies

bcrypt, collection, crypto, cryptography, meta, path, postgres, sqlite3, uuid

More

Packages that depend on daravel