Skip to content

Installation

3.x is alpha

The latest version is 3.0.0-alpha.1. It needs Dart 3.13 or newer.

Install the CLI

dart pub global activate dox 3.0.0-alpha.1

Export bin path

Please make sure you have included bin path to your profile. If you did not added path to your profile yet, open ~/.bashrc or ~/.zshrc and paste below line.

export PATH="$PATH":"~/.pub-cache/bin"

Create a new project

dox create new_blog

dox create downloads the latest release of dox-sample. To get one version, add --version:

dox create new_blog --version v2.0.1

Use 3.x in a project

Set every Dox package in pubspec.yaml to ^3.0.0-alpha.1. Use dox_orm for the database.

Packages

All Dox packages share one version.

Package What it does
dox_core HTTP server, routing, requests, responses, validation
dox_orm query builder and models (was dox_query_builder)
dox_migration database migrations
dox_auth JWT authentication
dox_websocket WebSocket server
dox_builder, dox_annotation code generation for models
dox_validation typed validation schemas
dox_openapi OpenAPI docs
dox_storage file storage: local, S3
dox_cache cache: memory, file, Redis
dox_socketio Socket.IO server

Start server

dox s

or

bin/dox s

Start server with docker

docker-compose up -d --build

Tips

Set APP_ENV=development in .env for hot reload while you work. For production, build a native binary with dox build. See Deployment.

Watch the builder

dart run build_runner watch

or

dox build_runner:watch