パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v2.1.0

vania

Dart用の高速でシンプルかつ強力なバックエンドフレームワーク、構築に使用

AndroidiOSmacOSWindowsLinux
30日間ダウンロード
685
いいね数
165
Pub ポイント
150

パッケージをインストール

flutter pub add vania

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Vania は、スケーラブルな Web サーバーと API を構築するために設計された、高速でシンプルかつ強力な Dart 用バックエンドフレームワークです。パフォーマンスと開発者の体験を重視して作られており、複数のプラットフォーム上でサーバーサイドアプリケーションに軽量でありながら堅牢な基盤を提供します。Vania は最小限のボイラープレートで効率的なバックエンドサービスを構築できるようにし、現代的な Web 開発ワークフローをサポートしています。モジュールアーキテクチャにより、既存プロジェクトへのシームレスな統合やスタンドアロンのサーバー展開が可能になります。Android、iOS、macOS、Windows、Linux で実行可能なネイティブ Dart ソリューションを探しているチームにとって理想的です。

用途

  • RESTful API の構築
  • リアルタイムサーバー応用
  • マイクロサービスアーキテクチャ
  • クロスプラットフォームのバックエンドサービス
  • プロトタイピングバックエンドロジック

主な機能

  • 高性能
  • 最小限のボイラープレート
  • クロスプラットフォーム対応
  • モジュール型設計
  • 組み込みルーティング

適している対象

  • Dart開発者
  • フルスタックアプリケーション
  • Flutter アプリにおけるサーバーサイドの論理
  • 高速バックエンドプロトタイピング
  • マルチプラットフォームデプロイ

注意事項

  • 成熟したフレームワークと比べてエコシステムが限定的
  • 初期段階での導入
  • Dart の非同期パターンの理解が必要です
  • 重いデータベースワークロードには最適化されていません
  • 新規ユーザーの習得曲線

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Vania

Vania

A fast, simple, and unapologetically batteries-included backend framework for Dart.

pub package docs license


Dart is a great language for writing servers — it's fast, it AOT-compiles to a single binary, and if you already ship Flutter you know it. What it has been missing is the boring, unglamorous infrastructure every real backend ends up needing: routing, validation, an ORM, migrations, auth, sessions, a job of a CLI to tie it all together.

Vania is that infrastructure. If you've written Laravel, most of it will feel familiar. If you haven't, it should still feel obvious.

Quick start

dart pub global activate vania_cli
vania create my_api
cd my_api
vania serve

Your server is on http://localhost:8000, and vania serve reloads it whenever you save a Dart file.

What an app looks like

A route file:

import 'package:vania/route.dart';

class TodosRoute extends Route {
  @override
  String? get prefix => 'api';

  @override
  void register() {
    super.register();

    Router.get('/todos', todoController.index);
    Router.post('/todos', todoController.store);
    Router.get('/todos/{id}', todoController.show).whereInt('id');
    Router.put('/todos/{id}', todoController.update).whereInt('id');
    Router.delete('/todos/{id}', todoController.destroy).whereInt('id');
  }
}

A controller:

class TodoController extends Controller {
  Future<Response> store(Request req) async {
    await req.validate({'title': 'required|string|max_length:255'});

    final todo = await Todo().query().insertGetId({
      'title': req.input('title'),
    });

    return Response.json(todo, 201);
  }
}

And the entrypoint, which is the whole bootstrap:

void main(List<String> args) async {
  await Application().initialize(config: config);
}

The database layer

Vania's ORM, query builder, migrations, seeders, and relations all live in the core package. Drivers are thin — they translate the shared contract to a real connection and nothing more. In practice that means your application code imports one thing:

import 'package:vania/database.dart';

and the driver name appears exactly once, in main.dart:

registerMysqlDriver();   // or registerPostgresqlDriver() / registerMongodbDriver()

Swapping MySQL for PostgreSQL is a one-line change. Models, relations (hasMany, belongsTo, belongsToMany, and the full morph family), migrations, and query-builder calls come along unchanged, because none of them ever belonged to the driver in the first place.

final users = await User()
    .query()
    .where('active', '=', true)
    .orderBy('created_at', 'desc')
    .paginate(perPage: 20);

Packages

Core ships what every server needs. Everything else is opt-in — add the package, register its provider, done.

Package What it gives you
vania HTTP server, router, middleware, validation, ORM, migrations, sessions, views, mail
vania_cli Project scaffolding, generators, migrations, serve, build
vania_mysql MySQL driver
vania_postgresql PostgreSQL driver
vania_mongodb MongoDB driver and document query builder
vania_auth JWT and personal access tokens, guards, hashing, revocation
vania_redis Redis client, cache driver, pub/sub, Lua scripting, pooling
vania_websocket WebSockets with channels, rooms, presence, broadcasting
vania_graphql GraphQL execution, HTTP transport, subscriptions
vania_grpc gRPC server and client
vania_swagger OpenAPI 3.0 generation and Swagger UI
vania_elasticsearch Elasticsearch client, query builder, bulk indexing

CLI

vania create <name>          Create a new project
vania serve                  Run with hot reload
vania build                  Compile to a native executable
vania route:list             List registered routes
vania key:generate           Generate APP_KEY into .env

vania make:controller        vania make:model
vania make:middleware        vania make:provider
vania make:migration         vania make:migration-alter
vania make:mail              vania make:auth

vania migrate                Run pending migrations
vania migrate:seed           Run seeders
vania db:seed                Create and register a seeder

Examples

Runnable projects, smallest first:

Documentation

Full docs live at vdart.dev/docs. The source is in docs/ — start with installation, then directory structure and configuration.

Contributing

Issues and pull requests are welcome — see CONTRIBUTING.md. If you're fixing a bug, a failing test that reproduces it is the fastest way to get the fix merged.

License

MIT © Vania contributors — see LICENSE.

カテゴリー

依存関係

依存関係一覧 8 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。