| Crates.io | rapid-rs |
| lib.rs | rapid-rs |
| version | 0.4.1 |
| created_at | 2025-11-19 03:45:53.984477+00 |
| updated_at | 2026-01-19 15:36:52.653333+00 |
| description | Zero-config, batteries-included web framework for Rust - FastAPI meets Spring Boot |
| homepage | https://github.com/ashishjsharda/rapid-rs |
| repository | https://github.com/ashishjsharda/rapid-rs |
| max_upload_size | |
| id | 1939377 |
| size | 311,805 |
Zero-config, batteries-included web framework for Rust
FastAPI meets Spring Boot - Build production-ready APIs in minutes, not days
🎉 Phase 3 Complete - Enterprise Features!
Stop wasting time on boilerplate. Get a production-ready API with authentication, database, validation, and more - all configured automatically.
use rapid_rs::rapid;
#[rapid]
async fn main() {
// That's it! You now have:
// ✅ REST API with OpenAPI docs
// ✅ Database migrations
// ✅ JWT authentication
// ✅ Request validation
// ✅ Error handling
// ✅ Logging & tracing
// And much more...
}
Visit: http://localhost:8080/swagger-ui for interactive API docs!
[dependencies]
rapid-rs = "0.4"
tokio = { version = "1", features = ["full"] }
use rapid_rs::{rapid, web, rapid_web::Json};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
struct User {
name: String,
email: String,
}
#[web::get("/users/{id}")]
async fn get_user(id: web::Path<i32>) -> Json<User> {
// Auto-validated, auto-serialized, auto-documented!
Json(User {
name: "John Doe".to_string(),
email: "john@example.com".to_string(),
})
}
#[rapid]
async fn main() {
// Your API is live at http://localhost:8080 🎉
}
validatortracingauth feature)use rapid_rs::auth::{AuthUser, hash_password, create_token};
#[web::post("/login")]
async fn login(credentials: Json<LoginRequest>) -> Json<LoginResponse> {
// Built-in JWT + password hashing
let token = create_token(&user)?;
Json(LoginResponse { token })
}
#[web::get("/profile")]
async fn profile(user: AuthUser) -> Json<User> {
// Automatic auth validation!
Json(user.into())
}
jobs feature) 🆕use rapid_rs::jobs::{JobQueue, JobPriority};
let queue = JobQueue::new(storage, config);
// Submit job
queue.enqueue(
SendEmailJob { to: "user@example.com" },
"send_email"
).await?;
// Schedule for later
queue.schedule(
job,
"job_type",
chrono::Utc::now() + Duration::hours(1)
).await?;
websocket feature) 🆕use rapid_rs::websocket::{WebSocketServer, WebSocketHandler};
let ws_server = WebSocketServer::new();
ws_server.set_handler(MyHandler).await;
app.merge(ws_server.routes());
// WebSocket ready at ws://localhost:8080/ws
cache feature) 🆕use rapid_rs::cache::{Cache, CacheConfig};
let cache = Cache::new(CacheConfig::default());
// Cache with TTL
cache.set("user:123", &user, Duration::from_secs(300)).await?;
// Get or compute
let user = cache.get_or_compute(
"user:123",
Duration::from_secs(300),
|| fetch_user_from_db(123)
).await?;
rate-limit feature) 🆕use rapid_rs::rate_limit::{RateLimiter, RateLimitConfig};
let limiter = RateLimiter::new(RateLimitConfig {
requests_per_period: 100,
period: Duration::from_secs(60),
burst_size: 10,
});
// Apply to routes
app.layer(axum::middleware::from_fn_with_state(
limiter,
rate_limit_middleware
));
observability feature) 🆕use rapid_rs::metrics::MetricsExporter;
let metrics = MetricsExporter::new();
// Prometheus metrics at /metrics
app.merge(metrics.routes());
feature-flags feature) 🆕use rapid_rs::feature_flags::{FeatureFlags, FeatureConfig};
let mut flags = FeatureFlags::new();
flags.add_flag("dark_mode", FeatureConfig {
enabled: true,
rollout_percentage: 50,
allowed_users: vec!["beta_testers".to_string()],
});
if flags.is_enabled("dark_mode", Some(&user_id)) {
// Show dark mode UI
}
multi-tenancy feature) 🆕use rapid_rs::multi_tenancy::{TenantContext, TenantExtractor};
#[web::get("/data")]
async fn get_data(tenant: TenantExtractor) -> Json<Data> {
let tenant_id = tenant.0.tenant_id();
// Data automatically scoped to tenant!
fetch_tenant_data(tenant_id).await
}
Choose the features you need:
[dependencies]
rapid-rs = { version = "0.4", features = ["full"] }
# Or pick specific features:
rapid-rs = { version = "0.4", features = [
"auth", # JWT authentication
"jobs", # Background jobs
"websocket", # WebSocket support
"cache", # In-memory caching
"cache-redis", # Redis caching
"rate-limit", # Rate limiting
"observability", # Prometheus metrics
"feature-flags", # Feature flags
"multi-tenancy", # Multi-tenant support
]}
rapid-rs
├── Core Framework (Axum + Tower)
├── Database (SQLx + Migrations)
├── Auth (JWT + Argon2)
├── Validation (validator crate)
├── Jobs (Async Queue + Scheduler)
├── WebSocket (Real-time Communication)
├── Cache (Memory + Redis)
├── Rate Limiting (Token Bucket)
├── Metrics (Prometheus)
├── Feature Flags (A/B Testing)
└── Multi-Tenancy (SaaS Ready)
Contributions welcome! Please read our Contributing Guide first.
MIT License - see LICENSE-MIT or LICENSE-APACHE file for details
Built with:
If rapid-rs helps you build faster, give us a star! ⭐
Made with ❤️ for the Rust community