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
- ๐ง Enhanced Extractors: Form, Cookies, Body extractors for comprehensive request handling
- ๐ API Versioning: Support for URL, header, and query parameter versioning
- ๐ Comprehensive Error Handling: Specific HTTP status codes and detailed error messages
Status: See STATUS.md for detailed feature completeness
๐ฆ Installation
Install the Oxidite CLI tool to get started:
# Install from source (recommended for development)
# Or install from crates.io (when published)
๐ Getting Started
Quick Start
Create a new Oxidite project in seconds:
Then run your application:
# Navigate to your project
# Start the development server
Your application will be available at http://127.0.0.1:8080.
Hello World Example
Here's a simple "Hello World" example:
use *;
async
async
Using Extractors
Oxidite provides powerful type-safe extractors for handling different types of requests:
use *;
use Deserialize;
// Handle JSON requests
async
// Handle form data
async
// Handle query parameters
async
// Handle path parameters
async
// Access cookies
async
// Access raw body
async
๐ ๏ธ Core Concepts
Routers and Handlers
Oxidite uses a clean routing system with async handlers:
use *;
async
async
async
Request Handling
Oxidite provides several extractors to handle different types of requests:
- Json: Extracts and deserializes JSON from request body
- Form: Extracts and deserializes form data
- Query: Extracts and deserializes query parameters
- Path: Extracts and deserializes path parameters
- Cookies: Extracts cookies as HashMap
- Body: Extracts raw request body as String
- State: Extracts application state from request extensions
API Versioning
Oxidite supports multiple API versioning strategies:
use *;
// URL-based versioning
async
async
// Version-specific routes
router.get;
router.get;
Error Handling
Oxidite provides comprehensive error handling with appropriate HTTP status codes:
use *;
async
async
async
๐ Documentation
Complete documentation is available in the docs/ directory:
- Getting Started - Your first Oxidite application
- Core Concepts - Fundamental architecture and concepts
- API Documentation - Complete API reference
- Framework Features - Framework features and capabilities
- Added Features - Recently added features and improvements
- Database Guide - ORM and database operations
- Authentication Guide - Authentication and authorization
- Templating Guide - Server-side rendering
- Middleware Guide - Adding functionality with middleware
- CLI Tools - Command-line interface
๐๏ธ Architecture
Oxidite is composed of modular crates that can be used independently:
| Crate | Description |
|---|---|
oxidite |
Main crate with prelude and convenience exports |
oxidite-core |
Core HTTP server, routing, and extractors |
oxidite-db |
Database ORM with migrations and relationships |
oxidite-auth |
Authentication and authorization |
oxidite-template |
Template engine for server-side rendering |
oxidite-middleware |
Common middleware implementations |
oxidite-cli |
Command-line tools for project management |
oxidite-config |
Configuration management |
oxidite-cache |
Caching utilities |
oxidite-queue |
Background job processing |
oxidite-realtime |
Real-time features (WebSockets, SSE) |
oxidite-mail |
Email sending capabilities |
oxidite-storage |
File storage (local and S3) |
oxidite-openapi |
OpenAPI/Swagger integration |
oxidite-macros |
Procedural macros |
oxidite-security |
Security utilities |
oxidite-testing |
Testing utilities |
oxidite-utils |
Common utilities |
๐งช Testing
Oxidite provides comprehensive testing utilities:
use *;
use TestClient;
๐ Deployment
Deploy your Oxidite application with any Rust-compatible hosting provider:
# Build for release
# Run the application
For containerized deployment:
FROM rust:latest
WORKDIR /app
COPY . .
RUN cargo build --release
CMD ["./target/release/my-app"]
๐ค Contributing
Contributions are welcome! Please read our Contributing Guide.
๐ License
MIT License - see LICENSE for details.