Tutorial
Interactive Tutorial
Learn Rapina by writing code. Each chapter gives you a task, an editor, and instant feedback — no compilation needed.
The tutorial covers the core framework concepts progressively. Each chapter builds on the previous one, growing your mental model from a simple handler all the way to database queries.
Chapters
- Your First Route — handler basics, route macros,
#[public], returning JSON - Protected Routes — authentication,
CurrentUserextractor, 401 responses - Validation —
Validated<Json<T>>, derive macros, 422 error envelopes - Error Handling — custom error types,
IntoApiError, trace IDs - State and Config —
#[derive(Config)],State<T>, environment variables - Database Basics —
Dbextractor,schema!macro, queries
Each exercise has tests that validate your code as you type. When all tests pass, you'll see the simulated HTTP response your handler would produce.