Vania Dart

A powerful, and fast web framework for Dart that makes building backend applications a breeze

Get Started
🏗️

Production Ready

Built for enterprise-level applications with robust error handling, logging, and scalable architecture patterns.

Lightning Fast

Optimized for performance with efficient routing, middleware system, and asynchronous request handling for maximum throughput.

🎯

No Structure Limits

Freedom to organize your project however you want. No forced conventions - build your application architecture your way.

📦

Rich Ecosystem

Comprehensive set of built-in features including ORM, QueryBuilder, migrations, authentication, validation, and email system.

Powerful Routing

Vania provides a flexible routing system with support for parameters, middleware, and route groups for organizing your API endpoints efficiently.


class ApiRoute extends Route {
  
  String prefix = 'api/v1';

  
  void register() {
    
    super.register();

    Router.get("/login", authController.login);

    Router.group(() {
      Router.get("/", userController.index);
      Router.get("/:id", userController.show);
      Router.post("/", userController.store);
      Router.put("/:id", userController.update);
      Router.delete("/:id", userController.delete);
    }, prefix: "users");

  }
}

Easy Validation

Built-in request validation makes it simple to ensure data integrity and provide meaningful error messages to your API consumers.


  Future<Response> store(Request request) async {
    await request.validate({
      'name': 'required|string|max:100',
      'email': 'required|email|unique:users',
      'password': 'required|min:8',
    },
    {
      'name.required': 'Name is required',
      'name.max': 'Name must be less than 100 characters',
      'name.string': 'Name must be a string',
      'email.required': 'Email is required',
      'email.unique': 'Email already exists',
      'password.required': 'Password is required',
      'password.min': 'Password must be at least 8 characters',
    });

    return Response.json({'message': 'successfully'});
  }

Powerful ORM Models

Define your data models with relationships, fillable fields, and hidden attributes. Work with your database using elegant, expressive syntax.


class User extends Model {
  
  List<String> fillable = ['name', 'email'];

  
  List<String> hidden = ['password'];

  
  void registerRelations() {
    hasMany('posts', Post(), foreignKey: 'user_id');
  }
}

// Usage
final user = User().include('posts')
    .where('id', '=', 1).first();

Advanced Query Builder

Build complex database queries with joins, conditions, and aggregations using our intuitive Query Builder interface.



// Complex query with joins
final user = DB.table('users')
    .join('profiles', 'users.id', '=', 'profiles.user_id')
    .where('email', '=','[email protected]')
    .first();

// Aggregation
final count = DB.table('posts')
    .where('status','=', 'published')
    .count();

Database Migrations

Version control your database schema with powerful migrations. Create, modify, and rollback database changes with confidence.

class CreateUserTable extends Migration {
  
  Future<void> up() async {
    await create('users', (Schema table) {
      table.id();
      table.string('first_name');
      table.string('email').unique();
      table.string('password');
      table.timeStamps();
    });
  }

  
  Future<void> down() async {
    await drop('users');
  }
}

Email System

Send beautiful emails with template support. Create rich HTML emails with attachments and multiple recipients effortlessly.

class WelcomeEmail extends Mailable {
  final String to;
  final String subject;

  const WelcomeEmail({
    required this.to,
    required this.subject,
  });

  
  Envelope envelope() {
    return Envelope(
      from: Address('[email protected]', 'Vania'),
      to: [Address(to)],
      subject: subject,
    );
  }

  
  MailView? view() {
    return MailView(view: 'welcome');
  }
}