Ulo Framework
Ulo is a Rust backend framework designed for building modular and scalable applications inspired by the Nest.js architecture. It provides a structured approach to organizing your code with controllers, services, and modules, while remaining decoupled from the HTTP server (Axum adapted and used by default).
Features
- Modular Architecture: Organize your application into reusable modules.
- HTTP Server Flexibility: Use Axum or integrate your preferred server.
- Dependency Injection: Manage dependencies cleanly with module providers.
- Macro-Driven Syntax: Reduce boilerplate with intuitive procedural macros.
Installation
Prerequisites
- Rust & Cargo: Ensure Rust is installed.
- Ulo CLI: Install the CLI tool globally:
Quickstart: Build a CRUD App
Use the Ulo CLI to create a new project:
Project Structure
src/
├── app/
│ ├── app.controller.rs
│ ├── app.module.rs
│ ├── app.service.rs
│ └── mod.rs
└── main.rs
Run the Server
Test your endpoints at http://localhost:3000/app.
Key Concepts
Project Structure
| File | Role |
|---|---|
app.controller.rs |
Defines routes and handles HTTP requests. |
app.module.rs |
Configures dependencies and module setup. |
app.service.rs |
Implements core business logic. |
Decoupled HTTP Server
Ulo is decoupled from the HTTP server. Adapters exist for Axum (ulo-http-axum), Actix-web (ulo-http-actix), Poem (ulo-http-poem), Salvo (ulo-http-salvo), and Rocket (ulo-http-rocket); any other server can be integrated by implementing the HttpAdapter trait.
Code Example
main.rs
use UloFactory;
use AxumAdapter;
async
app/app.module.rs (Root Module)
;
app/app.controller.rs (HTTP Routes)
app/app.service.rs (Business Logic)
;
License
- License: MIT.