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
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
95Compare - firebase_core
If you need Firebase backend services instead of a custom server
99Compare
Works with
Packages commonly used together with dox_core: ones it builds on, ones built on it, and its own family.
- cryptodox_core depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- uuiddox_core depends on itGenerates and parses RFC‑4122/9562 UUIDs (v1‑v8) for Dart.
- mimedox_core depends on itUtilities to resolve MIME types from file names, magic bytes, and to parse multipart streams.
- matcherdox_core depends on itSupport for specifying test expectations via an extensible Matcher class.
- string_scannerdox_core depends on itA class for parsing strings using a sequence of patterns.
- bcryptdox_core depends on itHashes passwords using the BCrypt algorithm.