Ultimo is a modern Rust web framework built on Hyper + Tokio:
secure-by-default, fast, and type-safe end to end โ with automatic TypeScript
client generation from your Rust API. REST and JSON-RPC live in one app, and
the framework is 100% safe Rust (#![forbid(unsafe_code)]).
Why Ultimo
- ๐ Automatic TypeScript clients โ define your API in Rust, get a fully typed TS client generated for you.
- ๐ REST + JSON-RPC in one app โ plain HTTP routes and RPC procedures side by side.
- ๐ WebSockets โ RFC 6455 with a built-in pub/sub system (zero extra deps).
- ๐ Auth, built in โ JWT and API-key middleware plus scope-based authorization guards.
- ๐ก๏ธ Secure by default โ 100% safe Rust, secure sessions/cookies, CSRF, security-headers middleware, request body-size limits, and supply-chain CI.
- โก Fast โ native Rust on the Hyper + Tokio core, O(1) constant-time routing, benchmarks regression-guarded in CI (details).
- ๐๏ธ Databases โ first-class SQLx and Diesel integration (PostgreSQL / MySQL / SQLite).
- ๐งช Testing utilities โ in-process
TestClient, response assertions, and fixtures.
Quick start
[]
= "0.5"
= { = "1", = ["full"] }
= { = "1", = ["derive"] }
use *;
async
MSRV: Rust 1.86. Everything beyond the core is opt-in via Cargo features (see below).
Type-safe clients
Ultimo's headline feature: define an API once in Rust and generate a typed TypeScript client โ no hand-written types, no drift.
# Generate a TypeScript client from your RPC definitions
// Generated, fully typed โ autocomplete + compile-time checks
const user = await client.getUser({ id: 1 });
console.log(user.name);
See TypeScript Clients for the full workflow.
Feature flags
Everything is opt-in (default = []):
| Feature | What it enables |
|---|---|
websocket |
RFC 6455 WebSocket support + pub/sub |
session |
Cookie-based session management |
jwt |
JWT authentication middleware (HS256) |
api-key |
API-key authentication with a pluggable store |
csrf |
CSRF protection (double-submit cookie) |
static-files |
Static file serving + SPA fallback (serve_static, serve_spa) |
compression |
Automatic gzip/brotli response compression (pure Rust, no C deps) |
client-gen |
Derive RPC client TypeScript types from Rust types (via ts-rs) |
testing |
In-process TestClient, assertions, fixtures |
test-helpers |
WebSocket test helpers (for integration tests) |
sqlx-postgres ยท sqlx-mysql ยท sqlx-sqlite |
SQLx integration per backend |
diesel-postgres ยท diesel-mysql ยท diesel-sqlite |
Diesel integration per backend |
= { = "0.5", = ["websocket", "jwt", "sqlx-postgres"] }
CLI
ultimo devandultimo buildare not implemented yet โ usecargo runandcargo build --releasefor now. See the roadmap.
Documentation
Full guides at docs.ultimo.dev โ getting started, routing, middleware, RPC + TypeScript clients, OpenAPI, sessions, authentication, WebSockets, database integration, testing, and performance.
Examples
Runnable examples live in examples/
โ including session-auth and jwt-auth full-stack demos. Run one with:
Contributing
Issues and PRs welcome. See CONTRIBUTING.md and the roadmap. Security policy: SECURITY.md.
License
MIT ยฉ Ultimo Contributors. See LICENSE.