🚀 rapid-rs
Zero-config, batteries-included web framework for Rust
FastAPI meets Spring Boot - Build production-ready APIs in minutes, not days
✨ What's New in v0.4.0
🎉 Phase 3 Complete - Enterprise Features!
- ⚡ Background Jobs - Redis-backed async job queue with priorities and scheduling
- 🔌 WebSocket - Full-duplex real-time communication with room management
- 💾 Caching - Multi-backend caching (Memory + Redis) with TTL support
- 🛡️ Rate Limiting - Protect your APIs with configurable rate limits
- 📊 Metrics - Prometheus integration for observability
- 🎛️ Feature Flags - A/B testing and gradual rollouts
- 🏢 Multi-Tenancy - SaaS-ready tenant isolation
🎯 Why rapid-rs?
Stop wasting time on boilerplate. Get a production-ready API with authentication, database, validation, and more - all configured automatically.
use rapid;
async
Visit: http://localhost:8080/swagger-ui for interactive API docs!
🚀 Quick Start
Installation
[]
= "0.4"
= { = "1", = ["full"] }
Your First API
use ;
use ;
async
async
🎨 Features
Core Features (Always Available)
- ✅ REST API - Built on Axum for blazing-fast performance
- ✅ OpenAPI/Swagger - Auto-generated interactive documentation
- ✅ Database - SQLx integration with migrations
- ✅ Validation - Request/response validation with
validator - ✅ Error Handling - Consistent, user-friendly error responses
- ✅ Logging - Structured logging with
tracing - ✅ Configuration - Environment-based config management
Authentication (auth feature)
use ;
async
async
Background Jobs (jobs feature) 🆕
use ;
let queue = new;
// Submit job
queue.enqueue.await?;
// Schedule for later
queue.schedule.await?;
WebSocket (websocket feature) 🆕
use ;
let ws_server = new;
ws_server.set_handler.await;
app.merge;
// WebSocket ready at ws://localhost:8080/ws
Caching (cache feature) 🆕
use ;
let cache = new;
// Cache with TTL
cache.set.await?;
// Get or compute
let user = cache.get_or_compute.await?;
Rate Limiting (rate-limit feature) 🆕
use ;
let limiter = new;
// Apply to routes
app.layer;
Metrics (observability feature) 🆕
use MetricsExporter;
let metrics = new;
// Prometheus metrics at /metrics
app.merge;
Feature Flags (feature-flags feature) 🆕
use ;
let mut flags = new;
flags.add_flag;
if flags.is_enabled
Multi-Tenancy (multi-tenancy feature) 🆕
use ;
async
📦 Feature Flags
Choose the features you need:
[]
= { = "0.4", = ["full"] }
# Or pick specific features:
= { = "0.4", = [
"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
]}
🏗️ Architecture
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)
📚 Documentation
🤝 Contributing
Contributions welcome! Please read our Contributing Guide first.
📜 License
MIT License - see LICENSE-MIT or LICENSE-APACHE file for details
🙏 Credits
Built with:
- Axum - Web framework
- SQLx - Database toolkit
- Tower - Middleware
- Utoipa - OpenAPI generation
- And many more amazing Rust crates!
🎯 Roadmap
Phase 1 ✅ (v0.1.0)
- Core REST API framework
- Database integration
- OpenAPI documentation
Phase 2 ✅ (v0.2.0 - v0.3.0)
- JWT Authentication
- Password hashing
- Role-based access control
- Testing utilities
Phase 3 ✅ (v0.4.0)
- Background jobs
- WebSocket support
- Caching layer
- Rate limiting
- Prometheus metrics
- Feature flags
- Multi-tenancy
Phase 4 🚧 (Planned for v0.5.0)
- GraphQL support
- Email/SMS notifications
- File uploads
- Admin dashboard
- More database backends
Phase 5 📋 (Future)
- Serverless deployment
- CLI code generation
- Plugin system
- Real-time subscriptions
⭐ Star History
If rapid-rs helps you build faster, give us a star! ⭐
Made with ❤️ for the Rust community