Rapina is a modern, high-performance web framework for building APIs with Rust, inspired by FastAPI's developer experience. Built on predictable patterns and strong conventions.
Key Features
- Fast: Native Rust performance. No garbage collector, no runtime overhead.
- Type-safe: Typed extractors, typed errors, everything checked at compile time. If it compiles, it works.
- Opinionated: Convention over configuration. 90% of apps need 10% of decisions. We made them for you.
- AI-friendly: Predictable patterns that humans and LLMs understand equally well. Better completions, safer refactoring.
- Secure: Protected by default. All routes require authentication unless explicitly marked public.
- Production-ready: Standardized errors with trace_id, JWT auth, and OpenAPI generation out of the box.
- Standards-based: Built on OpenAPI 3.0 with automatic spec generation and breaking change detection.
Who This Is For
You know Rust and you're tired of boilerplate. You want to ship APIs fast without sacrificing type safety. If you're new to Rust, start with The Rust Book — then come back. HTTP and REST basics help, but Rapina handles the ceremony so you can focus on building.
Philosophy
Rapina is built around three core beliefs:
- Decisions should be made for you, not by you. Most APIs need the same things: JSON handling, authentication, validation, error formatting. Rapina makes these decisions upfront so you can ship faster. When you need to diverge, escape hatches exist.
- If it compiles, it should work. The type system is your first line of defense. Extractors are typed, errors are typed, routes are checked at compile time. Runtime surprises should be rare.
- Code should be readable by humans and machines alike. Predictable patterns make onboarding faster, code reviews easier, and AI assistance more effective. A handler's signature tells you everything: what it expects, what it returns, whether it's protected.
Quick Start
# Install the CLI
cargo install rapina-cli
# Create a new project
rapina new my-app
cd my-app
# Start development server
rapina dev