Search the site
GETTING STARTED
Install the dartvel command and run a new app on your machine.
Every command here matches what dartvel --help prints.
ON THIS PAGE
Install the CLI
Create an app
Write your first page
Project structure
Choose your services at startup
Go from idea to production with one CLI
Ask the CLI what your project contains
Generated code is the same on every machine
Check what is built before you depend on it
You need Flutter 3.47 or newer, which ships Dart 3.13. Pick one install method.
# pub: the CLI as a global command
dart pub global activate dartvel_cli
# Homebrew: a prebuilt binary
brew install Danroyal001/dartvel_dev/dartvel_dev
# In a project, from its dev_dependencies
dart run dartvel_cli:dartvel --help
# npm: the same prebuilt binary
npm install -g dartvel_devCopy code to clipboard
The command is dartvel, whichever way you install it.
You can also download the binary from the GitHub releases page. dartvel ensure-path adds it to your PATH if your shell cannot find it.
Activate dartvel_cli, the command. dartvel_dev is the package your app depends on, and it depends on Flutter, which pub does not run as a global command.
Pub puts dartvel in ~/.pub-cache/bin. Add that to your PATH if your shell cannot find it.
The Homebrew tap is updated after each release, so it can be a version behind pub.dev.
dart run works in a project that already lists dartvel_cli in dev_dependencies, which dartvel create writes. The first run compiles the CLI, so it is slower than the binary.
dartvel update installs the latest release later.
Prebuilt binaries are Linux only for now
The release binaries behind Homebrew and npm (v0.11.5) are Linux only, for x64 and arm64. The macOS and Windows binaries follow when the release workflow can run again.
dartvel create my_app
cd my_appCopy code to clipboard
It runs flutter create, then adds pages, a backend and the Dartvel dependencies.
Web and mobile are on by default. Add --desktop for Windows, macOS and Linux.
dartvel init adds Dartvel to a Flutter project you already have.
dartvel devCopy code to clipboard
It generates the client, starts the backend and runs the Flutter app.
Edit a page and Flutter hot-reloads. Edit a backend function and only the backend restarts.
Pick a device with -d, for example dartvel dev -d chrome.
Generated code is not committed
dartvel dev and dartvel build write lib/dartvel_client for you. After a fresh clone, run dartvel routes once before your editor analyzes the project.
A file under lib/pages is a route. This is lib/pages/index.dart, served at /.
Functional
Class
@DVPage(title: 'Home')
Widget _indexPage(BuildContext context) => DVBox.list(<Widget>[
const DVText('Hello from Dartvel'),
DVNavLink(to: DVRoutes.about, child: const DVText('About us')),
]);Copy code to clipboard
The annotated function is private. Dartvel generates the public page and the DVRoutes target.
Import the generated barrel, dartvel_client.dart. It exports Dartvel and your generated code.
my_app/
pubspec.yaml # dependencies and the dartvel: block
.env .env.example # values read at startup
lib/
main.dart
pages/ # one file per route
index.dart
index.loading.dart # shown while the page loads
index.error.dart # shown when it fails to load
models/ # @DVModel classes
components/ # your widgets
styles/ services/
backend/functions/ # one file per endpoint
health.get.dart
contact.dart
dartvel_client/ # generated, ignored by git
test/Copy code to clipboard
dartvel:
backendHost: 0.0.0.0
backendPort: 3000
devBackendHost: http://localhost:3000
prodBackendHost: https://api.my-app.com
pagesDir: lib/pages
backendDir: lib/backend
apiBasePath: /api
envFiles: [.env, .env.local]Copy code to clipboard
The app calls devBackendHost in development and prodBackendHost in a release build.
Backend functions are served under apiBasePath.
Each directory has a key of its own: pagesDir, modelsDir, backendDir, componentsDir, stylesDir and servicesDir. Leave one out and it keeps the path shown above.
# pubspec.yaml
dartvel: config/dartvel.dartCopy code to clipboard
Point dartvel: at a Dart file instead of a map. The file must declare a public class that extends DartvelConfig.
dartvel_dev re-exports the Dartvel packages as barrels: dartvel_ui.dart, dartvel_backend.dart, dartvel_auth.dart, dartvel_database.dart, dartvel_storage.dart, dartvel_ai.dart and more. A generated app imports its own dartvel_client.dart barrel.
Partial
Spec section: Project Structure
Planned work and implementation limits
Directory keys take one path each. Glob patterns are not read, so pages cannot live in two directories.
Partial
Spec section: Package Structure
Planned work and implementation limits
The Rust bindings are DVRust and DVRustInt, one integer type. They are types you construct, so there is no DV.Rust to call.
Set up auth and mail in main.dart, before runApp.
DV.Auth.configure(DVLocalAuthProvider());
DV.Notifications.mail.useProvider(DVMemoryMailProvider());Copy code to clipboard
These are the in-memory versions for development. Each topic page shows the production adapters.
You set the database in configuration and write no code for it. The generated backend opens DATABASE_URL for your data models and jobs.
# .env
DATABASE_URL=sqlite:dartvel.dbCopy code to clipboard
dartvel create shop
cd shop && dartvel dev
dartvel db migrate
dartvel test
dartvel build web-server
dartvel deploy
dartvel upgrade --planCopy code to clipboard
Every step is one command, from a new project to a deployed server.
upgrade --plan lists what a new Dartvel release would change in your project, and dartvel migrate-code --apply rewrites the source for you.
Partial
Spec section: The Golden Path
Planned work and implementation limits
dartvel upgrade updates the CLI. Applying the project changes listed by upgrade --plan is Planned; the plan is read-only.
dartvel inspect routes
dartvel inspect models
dartvel explain DV-GEN-001Copy code to clipboard
inspect prints the routes, models, functions and jobs the build found, from the same project graph Studio reads.
explain tells you what a DV- error code means and how to fix it.
Partial
Spec section: Unified Development, Transparency, and Contracts
Planned work and implementation limits
There is no inspector yet for modules, transactions, the schema or generated files.
dartvel generate --checkCopy code to clipboard
The same project generates byte-identical files on any machine and in any folder, with no timestamps or absolute paths.
generate --check fails your CI when the committed files are stale, without touching the project.
Partial
Spec section: Generated Code Determinism
Planned work and implementation limits
Generated files are not run through dart format.
Dartvel 0.11.5 ships 24 spec sections in full and 79 in part; two are planned.
Twenty-five sections are a frozen public contract with unfinished code behind them. Contract stability and implementation status are tracked separately.
Pages in these docs mark partial features and say what is missing.
The full record is spec-status.json in the Dartvel repository.
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Shipped
Partly built
Partly built
Partly built
Shipped
Partly built
Partly built
Partly built
Partly built
Shipped
Shipped
Partly built
Partly built
Shipped
Shipped
Shipped
Partly built
Partly built
Partly built
Shipped
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Shipped
Partly built
Shipped
Partly built
Partly built
Partly built
Shipped
Partly built
Partly built
Partly built
Shipped
Partly built
Partly built
Partly built
Partly built
Partly built
Shipped
Shipped
Shipped
Shipped
Partly built
Shipped
Partly built
Shipped
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Shipped
Partly built
Partly built
Shipped
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Partly built
Shipped
Partly built
Partly built
Shipped
Partly built
Shipped
Shipped
Partly built
Partly built
Partly built
Module Health
Partly built
Partly built
FSL-1.1-MIT licensed. Built with Dartvel.
Dartvel is made by
To the bottom