Rust

Run at speed of Rust, one crate at a time.

Small, focused crates for HTTP, validation, authentication, databases, queues and storage. Use one on its own, or combine them into a complete API server. Built and maintained by Appwrite, the open-source cloud platform.

$cargo add utopia-http --git https://github.com/appwrite/appwrite
30 SERVICES ยท 35 CRATES
Assembled
Rustmain.rs
use utopia_http::{Bytes, Http, Request, Response};

let mut http = Http::new("UTC");
http.get("/hello")?.inject("response").action(|scope| {
    Box::pin(async move {
        scope.response.text("Hello, World!");
        Ok(())
    })
});

let request = Request::new("GET", "/hello", [], Bytes::new());
let mut response = Response::new();
http.run(&request, &mut response, &http.context()).await?;

assert_eq!(response.status_code(), 200);
A route, a request and its response. Compiled and run in CI, like every example in the guides.
  1. 01

    One problem per crate

    Depend on validators without pulling in a web server. Each crate is small and documents its own API.

  2. 02

    Async end to end

    Servers, database, cache and queue clients are async from the first byte to the last, ready for services under load.

  3. 03

    Examples that run

    Every guide example is a complete program, compiled and run in CI, so what you copy works.

  4. 04

    Proven in production code

    Appwrite's Rust API is built on these crates: HTTP, authentication, databases, caches and queues.

50 of 50 libraries

01Servers#

Serving requests and running work: the HTTP framework and its request and response values, WebSockets, DNS and MQTT brokers, job queues and schedules, and the base for building servers.

About servers โ†’

02Transport#

Reaching other services: HTTP and SMTP clients, NATS, and connection strings.

About transport โ†’

03Data#

Keeping data: databases and the queries over them, caches and file storage.

About data โ†’

04Security#

Who is calling and how often: password hashing, sessions, tokens, OAuth2 and passkeys, and abuse limits.

About security โ†’

05Observability#

Seeing what a service does: audit trails, telemetry, tracing spans and usage metrics.

About observability โ†’

06Platform#

The ground a service runs on: CLIs and consoles, configuration, dependency injection and registries, system information, locks, pools, circuit breakers, events, and the PHP engine semantics the Rust crates share.

Busutopia_bus

A synchronous in-process event bus: typed events, listeners with injected dependencies, failures isolated and recorded on the current span.

34 items8 examples516 lines
Circuit breakerutopia_circuit_breaker

Circuit breakers judged on a rolling failure rate, with half-open probes, state shared through Redis or an in-process table, and telemetry.

46 items8 examples1.3k lines
CLIutopia_cli

Command-line applications: tasks with validated params and injected resources, init, shutdown and error hooks, and adapters that run them.

61 items9 examples776 lines
Configutopia_config

Application configuration: a process-wide parameter registry, and typed configs loaded from env, dotenv, JSON, YAML or PHP files and validated against a schema.

65 items19 examples2.1k lines
Consoleutopia_console

Console helpers: coloured log lines, prompts, process titles, shell-safe commands, and running commands with input, output, progress and a timeout.

62 items9 examples1.1k lines
DIutopia_di

A dependency injection container: factories with declared dependencies, built once, resolved through parent containers.

18 items12 examples427 lines
Lockutopia_lock

Locks: Redis leases across hosts, in-process mutexes and semaphores, and file locks across processes.

45 items8 examples625 lines
PHP standard libraryphp_std

PHP engine semantics (the value model, juggling and comparison, string, number, JSON, serialize, igbinary, sorting, filter and URL functions) for crates that must behave exactly like PHP.

683 items19 examples38k lines
Platformutopia_platform

Modules, services and actions: describe an application's HTTP routes, CLI tasks and queue workers once, and register them on their servers.

99 items10 examples1.5k lines
Poolsutopia_pools

Fixed-capacity pools of lazily created resources (connections), with bounded waits, recovery, upkeep, groups and telemetry.

68 items8 examples1.1k lines
Registryutopia_registry

Named resources created on first use by registered factories, cached per context.

13 items12 examples412 lines
Systemutopia_system

Environment variables and machine facts: OS, architecture, CPU, memory, disk, IO and network.

63 items8 examples1.1k lines
About platform โ†’

07Utilities#

Focused helpers: input validation, translations, domain and email parsing, user-agent and device detection, OpenAPI documents, compression, load balancing and image processing.

Balancerutopia_balancer

Choosing between endpoints: options with state, filters, the First, Last, Random and RoundRobin algorithms, and groups of balancers tried in order.

56 items12 examples808 lines
Compressionutopia_compression

Compression algorithms (Brotli, Deflate, GZIP, LZ4, Snappy, XZ, Zstd) and Accept-Encoding negotiation, byte for byte as PHP's extensions.

83 items16 examples1.9k lines
Detectorutopia_detector

Detects a project's packager, runtime, framework and rendering from its file names, languages and manifests.

94 items10 examples1.6k lines
Domainsutopia_domains

Domain names split against the Public Suffix List, domain validators, and registrar clients for availability, prices, purchases, renewals and transfers.

218 items22 examples5.1k lines
Emailsutopia_emails

Email address parsing, canonical forms per provider, free, disposable and corporate classification, and validators.

94 items9 examples1.7k lines
Imageutopia_image

Image previews: decode, crop by gravity or focal point, borders, rounded corners, opacity, rotation and background, then encode to JPEG, PNG, GIF, WebP or AVIF.

37 items14 examples2.1k lines
Localeutopia_locale

Translations: languages, default and fallback locales, and placeholders.

24 items7 examples427 lines
OpenAPIutopia_openapi

OpenAPI 2.0, 3.0 and 3.1 documents read into one version-independent, immutable model.

109 items20 examples4.2k lines
User agentutopia_user_agent

User-agent parsing: operating system, client, device and bot.

23 items8 examples1.5k lines
Validatorsutopia_validators

Request parameter validators with their user-facing messages.

221 items10 examples3.1k lines
About utilities โ†’

08Integrations#

Third-party services: AI agents, version control, orchestration, CDNs, messaging providers for email, SMS and push, and moving data between backends.

Agentsutopia_agents

AI agents on LLM providers: conversations, messages with image attachments, structured output schemas, streamed responses, token accounting, embeddings, and diff checks.

416 items22 examples5.7k lines
CDNutopia_cdn

CDN cache purges (Cloudflare, Fastly, and a fan-out over several) and certificate providers (Cloudflare custom hostnames, Fastly domains and TLS subscriptions, and a proxy routing between them).

132 items19 examples3.2k lines
Messagingutopia_messaging

Email, SMS, push and chat messages sent through provider adapters (SMTP, SES, Mailgun, Sendgrid, Resend; Twilio, Vonage, Bird, WhatsApp and a dozen more SMS gateways with routing by calling code; FCM and APNs; Discord), with per-recipient results and send telemetry.

580 items7 examples8.0k lines
Migrationutopia_migration

Moves resources between services: sources (Appwrite, Supabase, NHost, Firebase, CSV, JSON) and destinations (Appwrite, CSV, JSON, a local backup), with the transfer, its cache and status counters.

721 items4 examples28k lines
Orchestrationutopia_orchestration

Container orchestration on Docker, through the Docker CLI or the Engine API on its Unix socket: images, containers, executions, networks and usage statistics.

108 items11 examples2.1k lines
VCSutopia_vcs

Version control system adapters: GitHub, GitLab, Gitea, Forgejo, Gogs, Bitbucket and Origin: repositories, branches, tags, files, commits, pull requests, comments, statuses and check runs, webhook parsing and signature validation, app installation tokens, and shallow sparse clone commands.

405 items5 examples9.6k lines
About integrations โ†’