Skip to content
pubscout

relic

2.0.0, released 9 days ago by serverpod.dev

Lightweight web server framework inspired by Shelf, with typed APIs and a high‑performance native Zig adapter.

$ flutter pub add relic
Source repository

What it does

Relic provides a robust HTTP server with routing, middleware, WebSocket support, static file handling, and a native adapter that boosts throughput. It offers typed request headers, unified body encoding, and a trie‑based router for speed.

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

Use it when

  • Building scalable APIs or backend services in Dart
  • Migrating from Shelf to a typed, high‑performance server
  • Needing WebSocket or static file support out of the box
  • Requiring native performance boosts via relic_native

Skip it when

  • You only need a simple client‑side HTTP library
  • Your project targets very old Dart versions (<3.10)
  • You need a full framework with ORM or database integration

Strengths

  • Typed headers and request parsing
  • High performance, especially with relic_native
  • Easy migration from Shelf
  • Built‑in WebSocket and static file support

Weaknesses

  • Requires Dart 3.10 or newer
  • Only server‑side, no client utilities
  • Limited ecosystem compared to Shelf

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
2

Add relic to pubspec, import relic/relic.dart, create RelicApp, define routes, call app.serve() or app.serveNative()

import 'package:relic/relic.dart';

Future<void> main() async {
  final app = RelicApp()
    ..get('/hello', (req) => Response.ok(body: Body.fromString('Hello')));
  await app.serve();
}

Alternatives

Packages that do the same job and could replace relic.

  • shelf

    Same API style, widely used, no native Zig adapter

Works with

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