Flare Server Core
flare-server-core is the server-side infrastructure toolkit used by Flare IM
services. It packages reusable runtime, transport, messaging, authentication,
context propagation, service discovery, telemetry, and error-handling building
blocks into a small set of composable crates.
The package is business-neutral: it does not own IM product rules, inbox sync policy, moderation, or tenant-specific workflows. Those belong in application services and higher-level domain crates.
API documentation: docs.rs/flare-server-core
Installation
[]
= "1.0.1"
Feature-focused examples:
# HTTP + auth + telemetry
= { = "1.0.1", = ["http", "auth", "telemetry"] }
# gRPC service with discovery
= { = "1.0.1", = ["grpc", "discovery"] }
# Eventing and MQ integrations
= { = "1.0.1", = ["nats", "kafka"] }
# Everything
= { = "1.0.1", = ["full"] }
The workspace also publishes the lower-level crates with the same version:
| Crate | Purpose |
|---|---|
flare-core-base |
Context, errors, configuration, IDs, and shared types. |
flare-core-runtime |
Service lifecycle, task orchestration, health, shutdown, and state tracking. |
flare-core-infra |
KV, token validation, auth helpers, and telemetry setup. |
flare-core-transport |
HTTP, gRPC, service discovery, and transport middleware. |
flare-core-messaging |
Event bus, topic bus, NATS, Kafka, producers, consumers, and retry helpers. |
flare-server-core |
Aggregated re-export crate for server applications. |
All of them use version 1.0.1 so application teams can keep dependency
versions aligned.
Feature Flags
| Feature | Description |
|---|---|
http |
Axum HTTP helpers, response models, and middleware. |
grpc |
Tonic gRPC client/server context utilities and middleware. |
discovery |
Service discovery and client-side service selection. |
nats |
NATS JetStream producer/consumer support. |
kafka |
Kafka producer/consumer support. |
kv |
Infrastructure KV abstractions. |
auth |
Token validation, principal model, and composite validators. |
telemetry |
Tracing subscriber and OpenTelemetry helpers. |
proto |
Optional bridge to flare-proto structured payloads. |
full |
Enables all public server-core capabilities. |
Architecture
Application service
|
flare-server-core re-export layer for service code
|
+-------------------+---------------------+--------------------+
| flare-core-base | flare-core-runtime | flare-core-infra |
| context/errors/id | lifecycle/tasks | auth/kv/telemetry |
+-------------------+---------------------+--------------------+
|
+------------------------+------------------------+
| flare-core-transport | flare-core-messaging |
| HTTP/gRPC/discovery | eventbus/MQ/NATS/Kafka |
+------------------------+------------------------+
Runtime Example
use ServiceRuntime;
async
Context And Errors
use ;
Release Verification
For package-level checks:
RUSTDOCFLAGS="-D warnings"
When publishing the full workspace, publish dependency crates first:
flare-core-baseflare-core-runtimeflare-core-infraflare-core-transportflare-core-messagingflare-server-core
License
Licensed under the Apache License, Version 2.0.