Vania 是一個快速、簡單且強大的 Dart 後端框架,專為建立可擴展的 Web 伺服器和 API 而設計。以效能與開發者體驗為核心,提供輕量但穩健的基礎,適用於跨多個平台的伺服器端應用程式。Vania 讓開發者能以最少的樣板程式碼建立高效能的後端服務,支援現代 Web 開發工作流程。其模組化架構可無縫整合至現有專案或獨立伺服器部署。此框架非常適合尋求原生 Dart 解決方案並可在 Android、iOS、macOS、Windows 及 Linux 上執行的團隊。
適用情境
建構 RESTful API
即時伺服器應用
微服務架構
跨平台後端服務
原型設計後端邏輯
主要特色
高效能
最小化樣板程式碼
跨平台支援
模組化設計
內建路由
適合對象
Dart 開發人員
全棧應用程式
Flutter 應用中的伺服器端邏輯
快速後端原型設計
多平台部署
使用建議
與成熟框架相比,生態系統有限
早期採用
需要理解 Dart 異步模式
未針對大型資料庫工作負載進行優化
新使用者的學習曲線
原始 README
以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。
Vania
A fast, simple, and unapologetically batteries-included backend framework for Dart.
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.
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.
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.