relic_core
2.0.0, released 8 days ago by serverpod.dev
Core framework for Relic web server
What it does
Provides a platform-agnostic core framework for building high-performance web servers and services in Dart. Offers a trie-based router, typed request and header handling, and WebSocket support.
AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to build a modern HTTP server or web API in Dart
- You are looking for an alternative to Shelf with built-in routing and typed headers
Skip it when
- You are building a client-side Flutter application that only makes outgoing HTTP requests
Strengths
- Strongly typed APIs and validated HTTP headers
- Built-in trie-based router and WebSocket support
- Familiar structure inspired by Shelf
Weaknesses
- Requires a separate adapter like relic_io or relic_native to actually serve requests
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 15
Requires Dart 3.7 or newer (Relic 2.0.0 requires Dart 3.10.0+).
import 'package:relic/io_adapter.dart';
import 'package:relic/relic.dart';
Future<void> main() async {
final app = RelicApp()
..get('/user/:name/age/:age', helloHandler);
await app.serve();
}
Response helloHandler(final Request req) {
return Response.ok(body: Body.fromString('Hello!'));
}Alternatives
Packages that do the same job and could replace relic_core.
- firebase_core_web
Web implementation of firebase_core for Flutter apps.
83Compare - bones_api
A powerful API backend framework for Dart with HTTP server, routing, SQL translator, and DB adapters.
75Compare - vania
A fast backend framework for Dart with routing, ORM, migrations, and middleware.
71Compare - dart_frog_cli
Official command-line interface for the Dart Frog backend framework.
86Compare
Works with
Packages commonly used together with relic_core: ones it builds on, ones built on it, and its own family.
- vm_servicerelic_core depends on itA library to communicate with a service implementing the Dart VM service protocol.
- cryptorelic_core depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- mimerelic_core depends on itUtilities to resolve MIME types from file names, magic bytes, and to parse multipart streams.
- stack_tracerelic_core depends on itProvides parsing, inspection, and readable formatting of Dart stack traces.
- clockrelic_core depends on itA fakeable wrapper for dart:core clock APIs.
- asyncrelic_core depends on itUtility classes and helpers that extend Dart's async library.
- http_parserrelic_core depends on itA platform-independent package for parsing and serializing HTTP formats.
- web_socket_channelrelic_core depends on itCross‑platform WebSocket channel wrapper for Dart