1 unstable release
| 0.1.0 | Dec 7, 2025 |
|---|
#381 in Configuration
Used in 2 crates
9KB
246 lines
Oxidite Web Framework
A modern, high-performance web framework for Rust, inspired by FastAPI, Express.js, and Laravel.
Built with ❤️ by Meshack Bahati Ouma
🚀 What is Oxidite?
Oxidite is a batteries-included web framework that combines Rust's performance with developer-friendly APIs. It provides a complete ecosystem for building scalable web applications, from REST APIs to fullstack server-side rendered apps.
✨ Key Features
- ⚡ High Performance: Built on
hyperandtokiofor blazing speed - 🗄️ Advanced ORM: Complete database layer with relationships, soft deletes, validation
- 🛠️ Powerful CLI: Scaffolding, migrations, hot-reload dev server, code generators
- 🔋 Batteries Included: RBAC/PBAC, API Keys, Queues, Caching, Email, Storage
- 🔐 Enterprise Security: Password hashing, JWT, OAuth2, 2FA, rate limiting
- 🎨 Template Engine: Jinja2-style templates with inheritance and auto-escaping
- 🔄 Real-time: WebSockets and Redis pub/sub support
- 📝 Type-Safe: Strong typing for requests, responses, and database queries
- 📊 Auto-Documentation: OpenAPI/Swagger UI generation
Status: See STATUS.md for detailed feature completeness
📦 Installation
Install the Oxidite CLI tool to get started:
# Install from source (recommended for development)
cargo install --path oxidite-cli
🛠️ Usage Guide
1. Create a New Project
Oxidite provides an interactive wizard to set up your project.
oxidite new my-app
2. A Simple Example
Here's a basic "Hello, World!" example:
use oxidite::prelude::*;
use serde_json::json;
async fn hello(_req: OxiditeRequest) -> Result<OxiditeResponse> {
Ok(OxiditeResponse::json(json!({ "message": "Hello, Oxidite!" })))
}
#[tokio::main]
async fn main() -> Result<()> {
let mut router = Router::new();
router.get("/", hello);
let server = Server::new(router);
println!("🚀 Server running on http://127.0.0.1:3000");
server.listen("127.0.0.1:3000".parse()?).await
}
3. Development
Navigate to your project and start the development server.
cd my-app
oxidite dev
4. Serving Static Files
In a Fullstack project, static files in public/ are served from the root URL by default.
use oxidite_template::serve_static;
// Serve static files from "public" directory (fallback route)
// Register this LAST to avoid blocking other routes
router.get("/*", serve_static);
5. Templates
Render templates in your handlers:
use oxidite_template::{TemplateEngine, Context};
async fn index() -> Result<OxiditeResponse> {
let engine = TemplateEngine::new("templates");
let mut context = Context::new();
context.insert("name", "Oxidite");
let html = engine.render("index.html", &context)?;
Ok(OxiditeResponse::html(html))
}
📖 Documentation
🏗️ Architecture
Oxidite is composed of modular crates:
| Crate | Description |
|---|---|
oxidite-core |
HTTP server, routing |
oxidite-cli |
Command-line tools |
oxidite-auth |
Authentication & OAuth2 |
oxidite-db |
Database abstraction |
oxidite-template |
Template engine |
oxidite-realtime |
WebSockets & SSE |
| ...and more |
💬 Community & Support
Have questions or want to connect with other Oxidite developers? Join our community on GitHub Discussions.
🤝 Contributing
Contributions are welcome! Please read our Contributing Guide.
📄 License
MIT License - see LICENSE for details.
Dependencies
~3–15MB
~134K SLoC