bones_api
1.35.2, released 5 days ago by an unverified publisher
A powerful API backend framework for Dart with HTTP server, routing, SQL translator, and DB adapters.
What it does
Bones_API provides a comprehensive backend framework for Dart featuring an integrated HTTP server, modular route handling, entity handlers, a built-in SQL translator, and database adapters. It also includes cron job scheduling, static file hosting with virtual aliases, and a command-line interface.
AI-written summary of version 1.34.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Building a backend API server in Dart
- Needing built-in routing, entity management, and SQL/database adapters
- Requiring scheduled background cron tasks and static file serving with aliases
Skip it when
- Building frontend UI applications (it's a backend framework)
- Looking for a minimalist routing-only package like shelf without extra framework layers
Strengths
- Comprehensive all-in-one framework including HTTP server, routing, and DB adapters
- Built-in cron scheduler with IANA time zones and retries
- Advanced static file server features with `.aliases` path mapping
Weaknesses
- Large dependency footprint due to covering server, database, and utilities
- Less modular for developers who want to pick and choose individual micro-packages
Setup
- Kind
- Pure Dart
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 45
Activate the CLI globally using 'dart pub global activate bones_api' and configure your API routes and server modules in code.
import 'package:bones_api/bones_api_server.dart';
class MyBTCModule extends APIModule {
MyBTCModule(APIRoot apiRoot) : super(apiRoot, 'btc');
@override
void configure() {
routes.get('time', (request) => APIResponse.ok(DateTime.now()));
}
}
class MyAPI extends APIRoot {
MyAPI() : super('example', '1.0');
@override
Set<APIModule> loadModules() => {MyBTCModule(this)};
}
void main() async {
var api = MyAPI();
var serverPort = await startAPIServer(api);
print('Server started on port $serverPort');
}Alternatives
Packages that do the same job and could replace bones_api.
- relic_io
dart:io adapter for Relic web server.
81Compare - vania
A fast backend framework for Dart with routing, ORM, migrations, and middleware.
71Compare - relic_core
Core framework for Relic web server
82Compare - shelf_proxy
A shelf handler for proxying HTTP requests to another server.
86Compare
Works with
Packages commonly used together with bones_api: ones it builds on, ones built on it, and its own family.
- archivebones_api depends on itEncodes and decodes archive and compression formats such as zip, tar, gzip, and zlib.
- yamlbones_api depends on itA Dart library for parsing YAML documents into Dart data structures.
- cryptobones_api depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- mimebones_api depends on itUtilities to resolve MIME types from file names, magic bytes, and to parse multipart streams.
- petitparserbones_api depends on itBuild fast, composable, and type-safe grammars and parsers in plain Dart code.
- webbones_api depends on itLightweight bindings for browser APIs via JS interop
- shelfbones_api depends on itComposable web server middleware for Dart
- shelf_staticbones_api depends on itServe static files over HTTP with the shelf package