Laravel's completeness,NestJS's structure,Rust's speed and footprint.
Navree is a web application framework for Rust. Routing, validation, an ORM, auth, queues, mail, real time and testing come in the box, organised into modules like NestJS, running on Tokio and Axum.
cargo install --git https://github.com/NavreeHQ/navree navree-clinavree new blogStructured like NestJS, checked by Rust
Modules, providers, controllers and guards work the way you know from NestJS. The difference is underneath: one binary, no garbage collector, and types the compiler checks.
An app is a set of modules
As in NestJS, each module declares what it imports, the services it provides, its controllers and what it exports. The container wires them by type when the app boots, and refuses to start if a dependency is missing or private, naming the module and the type.
Read about modulesuse navree::prelude::*;
/// The sales pipeline: its routes, its service, and what
/// other modules may use.
#[module(
imports = [CrmCoreModule],
providers = [DealService],
controllers = [DealsController],
exports = [DealService],
register = Self::wire,
)]
pub struct DealsModule;
impl DealsModule {
fn wire(&self, m: &mut ModuleBuilder) {
// A queue worker tells owners about their deals.
m.listen::<DealAssigned, NotifyDealOwner>()
.on::<DealWon, NotifyDealOwner>();
}
}fn main() -> Result<(), BoxError> {
Navree::app()
.module(ConfigModule::for_root(ConfigSources::defaults()))
.module(HttpModule::from_config())
.module(DatabaseModule::from_config())
.module(QueueModule::from_config())
.module(AuthModule::from_config())
// ... mail, access and the rest of the platform
.module(DealsModule)
.run()
}Everything a backend needs
Like Laravel, Navree ships the whole stack: auth, an ORM, queues, mail, real time, testing and a CLI, designed to work together and documented in one place.
Architecture
The basics
- Controllers and routingAttribute routes with prefixes and API versions.
- Deny by defaultEvery route declares who may call it.
- Validationgarde rules with field-level messages.
- Errors and resourcesNestJS-style JSON errors and stable response shapes.
- Safe defaultsRate limits, security headers and body limits, on by default.
Security
- AuthenticationJWT access tokens with rotating refresh tokens.
- Account flowsRegistration, password reset, email verification and 2FA.
- AuthorizationRoles, permissions and CASL-compatible abilities.
- Encryption and hashingAES-256-GCM with key rotation, Argon2id passwords.
- Audit logData changes, sign-ins and denials, recorded by default.
Database
Digging deeper
- Queues and schedulingDatabase-backed jobs with retries, and cron-style tasks.
- EventsA typed event bus with queued listeners.
- Mail and notificationsTemplated mail, database and real-time notifications.
- Real timeA Pusher-protocol WebSocket server that Laravel Echo connects to.
- Cache and storageAn in-memory cache with tags and locks; disks with signed URLs.
- OpenAPIAn OpenAPI 3.1 document generated from your routes.
- Health and metricsReadiness checks and Prometheus metrics.
- The CLInavree new, generators, and a dev server that restarts on save.
Testing
Measured against 14 other frameworks
The same API on the same machine, after the same 170-check conformance test. Navree lands mid-field where requests do real work and stays tiny in memory. Its own per-request overhead is high, and the benchmarks page says why.
Navree in every test
| JSON | 214k | 10th of 15 |
|---|---|---|
| Single query | 46.5k | 10th of 15 |
| 20 queries | 6.1k | 9th of 15 |
| Auth + paginated list | 15.5k | 8th of 15 |
| Auth + validated insert | 20.3k | 8th of 15 |
| Peak memory | 38 MB | 3rd lowest |
| Ready after | 23 ms | 5th fastest |
JSON is where Navree ranks lowest: with little database work, the framework's own per-request cost is most of what is measured.
See every result, the method and the caveatsEverything in the box
28 crates in 7 layers. A crate’s dependencies all sit in lower layers, and a test checks every edge. Depend on the navree facade to get every module, or turn its features off to compile less.
- navree-sessionEncrypted session cookies, memory and database stores, CSRF protection.
- navree-validationValid<T> extractors on garde, NestJS (class-validator) style messages, async unique/exists rules.
- navree-auditAudit trail of data changes, sign-ins and permission changes.
- navree-queueDatabase and memory job queues, workers, retries with backoff, unique and delayed jobs.
- navree-scheduleCron-style schedules, overlap prevention and single-node runs.
- navree-accessRoles, permissions and CASL-compatible abilities with record checks and SQL list filters.
- navree-notifyMulti-channel notifications (mail, database, broadcast) with read state.
- navree-dbSeaORM integration, unit of work, module migrations, seeders, factories and pagination.
- navree-testingTestApp, in-process TestClient with cookies and XSRF helpers, fakes.
- navree-observeHealth checks, readiness aggregation and Prometheus metrics.
- navree-apiOpenAPI 3.1 generation from route metadata, docs UI and API resource helpers.
- navree-mailMailables rendered from templates, SMTP/log/array/failover transports, queued sending.
- navree-realtimePusher-protocol WebSocket server with public, private and presence channels.
- navree-storageNamed disks on object_store, streaming, signed temporary URLs and upload checks.
- navree-httpAxum integration, default Tower layers, NestJS-format errors, controllers and route metadata.
- navree-logTracing subscriber, JSON or pretty output, redaction, rotating files and runtime level control.
- navree-cryptoAES-256-GCM Encrypter with key rotation, Argon2id Hasher and token helpers.
- navree-eventsTyped event bus with sync and queued listeners.
- navree-viewMiniJinja templates for mail and other text rendering.
- navree-cacheCache stores (memory on moka), remember, tags, stale-while-revalidate and atomic locks.
- navree-http-clientOutgoing HTTP with retries, timeouts, SSRF policy and fakes.