Skip to content
pubscout

relic_core

2.0.0, released 8 days ago by serverpod.dev

Core framework for Relic web server

$ flutter pub add relic_core
Source repository

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.

  • bones_api

    A powerful API backend framework for Dart with HTTP server, routing, SQL translator, and DB adapters.

  • vania

    A fast backend framework for Dart with routing, ORM, migrations, and middleware.

  • dart_frog_cli

    Official command-line interface for the Dart Frog backend framework.

Works with

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