Rust Backend Framework

Structure before scale.

A modular backend framework built from scratch in Rust. Custom async runtime, HTTP server, DI container, and module system — zero third-party async runtime dependencies.

~20K Lines of Rust
373 Tests passing
0 Async dependencies
10 Focused crates

The Problem

Building production Rust backends shouldn't require gluing together a dozen unrelated crates.

Runtime Lock-in

Tokio dominates the ecosystem. Your entire dependency tree locks to one runtime with its own opinions on threading, I/O, and scheduling.

No Application Structure

Rust has great language primitives but no standard way to organize modules, manage lifecycles, or wire dependencies at the application level.

Fragmented Stack

HTTP server from one crate, DB from another, config from a third. Different error types, different patterns, different upgrade cycles.

Core Features

Everything you need, nothing you don't. Each layer built from scratch for cohesion.

Async Runtime

Custom executor with epoll/kqueue/IOCP, work-stealing scheduler, timer wheel, and async networking.

HTTP Server

Zero-copy HTTP/1.1 parser, router with path params, keep-alive, chunked transfer encoding.

Type-State DI

Compile-time dependency injection. Missing deps are compile errors, not runtime panics.

Module System

Lifecycle management with dependency graphs, proof-witness pattern, deterministic boot order.

Database

PostgreSQL wire protocol client, connection pool, query builder, migrations — no ORM bloat.

Observability

Structured logging, tracing spans, lock-free metrics (counters, gauges, histograms), health checks.

Config

TOML-based with profile overlays (dev/staging/prod), env var overrides, per-module scoping.

Macros

#[derive(Module)], #[derive(Component)], #[moduvex::main] — less boilerplate.

Quick Start

Get running in under 10 lines.

Cargo.toml
# Cargo.toml
[dependencies]
moduvex-starter-web = "0.1"
main.rs
use moduvex_starter_web::prelude::*;

#[moduvex::main]
async fn main() {
    info!("Starting server");
    Moduvex::new()
        .module::<HelloModule>()
        .run()
        .await;
}

Architecture

A layered workspace where each crate has a clear responsibility.

moduvex
moduvex-starter-web
moduvex-starter-data
moduvex-http
moduvex-db
moduvex-config
moduvex-observe
moduvex-core
moduvex-macros
moduvex-runtime

Workspace Crates

10 focused crates, each with a single responsibility.

Crate Description
moduvex-runtime Custom async runtime — executor, reactor, timers, networking, sync primitives
moduvex-http HTTP/1.1 server — zero-copy parser, router, response builder, keep-alive
moduvex-core Framework core — DI container, module system, lifecycle engine, error types
moduvex-macros Proc macros — #[derive(Module)], #[moduvex::main], and more
moduvex-config Typed TOML config with profiles, env var overrides, per-module scoping
moduvex-db PostgreSQL client — wire protocol, connection pool, query builder, migrations
moduvex-observe Observability — structured logging, tracing, lock-free metrics, health checks
moduvex-starter-web Web starter — bundles runtime + HTTP + core + config + observe
moduvex-starter-data Data starter — bundles runtime + DB + core + config
moduvex Umbrella crate — re-exports everything with feature flags (web, data, full)