dartian 1.0.0 copy "dartian: ^1.0.0" to clipboard
dartian: ^1.0.0 copied to clipboard

A Laravel-inspired web framework for Dart - HTTP, routing, DI, ORM, auth, queues, and more

Dartian #

A Laravel-inspired web framework for Dart - HTTP, routing, DI, ORM, auth, queues, and more.

Features #

  • HTTP Kernel: Built on Shelf with middleware support
  • Routing: Fluent DSL with groups, prefixes, and named routes
  • Dependency Injection: Auto-discovery with annotations
  • ORM: Drift-based with SQLite and PostgreSQL support
  • Redis: Caching and pub/sub
  • Queues: Background job processing
  • Scheduler: Cron-based task scheduling
  • Views: Mustache templates with SSR
  • i18n: Multi-language support
  • Auth: Session, JWT, and password hashing

Installation #

dependencies:
  dartian: ^1.0.0

Or install individual packages:

dependencies:
  dartian_http: ^1.0.0
  dartian_router: ^1.0.0
  dartian_di: ^1.0.0

Quick Start #

import 'package:dartian/dartian.dart';
import 'package:shelf/shelf_io.dart' as io;

void main() async {
  // Create router
  final router = Router();
  
  router
    .get('/', (request) => Response.ok('Hello, Dartian!'))
    .get('/users', (request) => Response.ok('Users list'));
  
  router.group('/api', (api) {
    api.get('/status', (request) => Response.ok('OK'));
  });
  
  // Create HTTP kernel with middleware
  final kernel = HttpKernel();
  kernel.use(CorsMiddleware(allowOrigin: '*'));
  
  final handler = kernel.build(router.handler);
  
  // Start server
  final server = await io.serve(handler, 'localhost', 8080);
  print('Server running on http://localhost:${server.port}');
}

Documentation #

See the GitHub repository for full documentation.

Packages #

Package Description
dartian_core Core utilities
dartian_http HTTP kernel
dartian_router Routing
dartian_di Dependency injection
dartian_orm ORM
dartian_redis Redis
dartian_queue Job queues
dartian_scheduler Scheduler
dartian_view Views
dartian_i18n i18n
dartian_auth Auth
dartian_console CLI

License #

AGPL-3.0 - See LICENSE for details.