Vania Framework Documentation
Vania is a server-side framework for Dart, built for developers who want an expressive, batteries-included backend with the performance and type safety of Dart. It covers the full spectrum of backend development: routing, ORM, migrations, authentication, real-time communication, caching, mail, and more.
Vania follows a modular architecture. The core package ships everything you need for a production API server. Optional packages extend it with database drivers, Redis, Elasticsearch, GraphQL, gRPC, Swagger, and WebSockets — install only what your project requires.
Table of Contents
Getting Started
Core Framework
- Routing
- Controllers
- Middleware
- Requests
- Responses
- Validation
- Views & Templates
- Sessions
- Service Providers
- IoC Container
- Caching
- Storage
- Logging
- Error Handling
Database & ORM
Packages
- Authentication (vania_auth)
- MySQL Driver (vania_mysql)
- PostgreSQL Driver (vania_postgresql)
- MongoDB Driver (vania_mongodb)
- Redis (vania_redis)
- Elasticsearch (vania_elasticsearch)
- GraphQL (vania_graphql)
- gRPC (vania_grpc)
- Swagger / OpenAPI (vania_swagger)
- WebSocket (vania_websocket)
- CLI (vania_cli)
Project Architecture
Tutorials
Sample Walkthroughs
Guided tours of the runnable apps in the examples/ folder — start here if you learn best by reading working code.
- Overview
- Counter — the smallest Vania app
- Todos (modular) — feature folders and repositories
- DDD Wallet — Domain-Driven Design layering
- Basic Authentication — JWT register/login/logout
- Redis Cache — a counter behind a swappable store
- WebSocket Chat — real-time rooms and presence
- GraphQL API — schema, resolvers, and GraphiQL
- gRPC Greeter — a gRPC service beside the HTTP server
- Swagger API — OpenAPI docs for a REST API
- Elasticsearch Search — full-text search
Deployment
Requirements
- Dart SDK
>=3.9.0 <4.0.0 - A database driver package if using the ORM (MySQL, PostgreSQL, or MongoDB)
Quick Start
# Install the CLI
dart pub global activate vania_cli
# Create a new project
vania create my_app
# Navigate and run
cd my_app
vania serve
Your server is now running at http://localhost:8000.
Package Overview
| Package | Description | Version |
|---|---|---|
vania | Core framework | 2.0.0 |
vania_auth | JWT authentication, guards, gates, personal access tokens | 1.0.0 |
vania_mysql | MySQL database driver | 1.0.0 |
vania_postgresql | PostgreSQL database driver | 1.0.0 |
vania_mongodb | MongoDB database driver | 1.0.0 |
vania_redis | Redis cache driver, pub/sub, Lua scripting | 1.0.0 |
vania_elasticsearch | Elasticsearch client with query builder | 1.0.0 |
vania_graphql | GraphQL server with subscriptions | 1.0.0 |
vania_grpc | gRPC server and client | 1.0.0 |
vania_swagger | OpenAPI 3.0 documentation and Swagger UI | 1.0.0 |
vania_websocket | WebSocket channels, presence, and broadcasting | 1.0.0 |
vania_cli | CLI for scaffolding, serving, and migrations | 1.0.0 |
Links
- Website: vdart.dev
- GitHub: github.com/vania-dart/framework