Skip to content
pubscout

dox_core

3.2.2, released 4 days ago by dartondox.dev

Dart web backend framework core with HTTP server, router, DTO validation, caching, OpenAPI and WebSocket support

$ flutter pub add dox_core
Source repository

What it does

Provides a native HTTP server, routing, typed DTO input validation, caching, OpenAPI docs, and WebSocket handling for building scalable Dart APIs.

AI-written summary of version 3.1.3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • Building a full‑stack Dart backend API
  • Need typed request validation and automatic 422 responses
  • Want built‑in caching and OpenAPI docs
  • Require WebSocket support on the same port

Skip it when

  • You only need a simple HTTP client
  • You prefer a minimal server like shelf
  • You are building a Flutter mobile app

Strengths

  • Full feature set (router, DTO, cache, OpenAPI, WebSocket)
  • Typed DTO validation with code generation
  • Native Rust HTTP server for performance
  • Built‑in caching and rate limiting

Weaknesses

  • Not a client library
  • Requires build_runner for DTO code generation
  • Heavier than minimal servers like shelf
  • Learning curve for framework concepts

Setup

Kind
Pure Dart
Effort
Medium
Code generation
Yes (build_runner)
Direct dependencies
12

Add dox_core to pubspec, run `dart run build_runner build` for DTO generation, configure AppConfig in main, optionally add dox_cache or dox_storage for caching.

import 'package:dox_core/dox_core.dart';

class ApiRouter extends Router {
  @override
  String get prefix => 'api';
  @override
  void register() {
    Route.get('/ping', (DoxRequest req) => 'pong');
  }
}

void main() async {
  Dox().initialize(AppConfig(
    appKey: Env.get('APP_KEY'),
    serverPort: 3000,
    routers: <Router>[ApiRouter()],
  ));
  await Dox().startServer();
}

Alternatives

Packages that do the same job and could replace dox_core.

  • shelf

    Lightweight server for simple HTTP APIs without DTO validation or OpenAPI

  • firebase_core

    If you need Firebase backend services instead of a custom server

Works with

Packages commonly used together with dox_core: ones it builds on, ones built on it, and its own family.