패키지, 저장소 및 앱 카테고리 검색

패키지 상세v2.1.0

vania

Dart용 빠르고 간단하며 강력한 백엔드 프레임워크, 구축에 사용

AndroidiOSmacOSWindowsLinux
30일 다운로드
685
좋아요
165
Pub 점수
150

패키지 설치

flutter pub add vania

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Vania는 확장 가능한 웹 서버와 API를 구축하기 위해 설계된 빠르고 간단하며 강력한 Dart용 백엔드 프레임워크입니다. 성능과 개발자 경험을 고려하여 제작되었으며, 여러 플랫폼에서 서버 측 애플리케이션을 위한 가볍지만 견고한 기반을 제공합니다. Vania는 최소한의 보일러플레이트로 효율적인 백엔드 서비스를 만들 수 있게 해주며, 현대적인 웹 개발 워크플로우를 지원합니다. 모듈식 아키텍처 덕분에 기존 프로젝트에 원활하게 통합하거나 독립적인 서버 배포도 가능합니다. Android, iOS, macOS, Windows, Linux에서 실행되는 Dart 네이티브 솔루션을 찾는 팀에게 이상적입니다.

사용 사례

  • RESTful API 구축
  • 실시간 서버 애플리케이션
  • 마이크로서비스 아키텍처
  • 크로스 플랫폼 백엔드 서비스
  • 프로토타이핑 백엔드 로직

주요 기능

  • 고성능
  • 최소한의 보일러플레이트
  • 크로스 플랫폼 지원
  • 모듈러 디자인
  • 내장 라우팅

적합한 대상

  • 다트 개발자
  • 풀스택 애플리케이션
  • 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 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.