Building full-stack web applications with the developer experience you love and the performance you need
TL;DR
RustNext is a high-performance web framework that brings the beloved Next.js developer experience to Rust. It features declarative UI components, type-safe API routes, built-in authentication, and everything you need to build production-ready web applications.
Links:
- π GitHub Repository
- π¦ Crates.io
The Problem with Web Development in Rust
Don't get me wrong - Rust is incredible. Memory safety, zero-cost abstractions, and blazing performance make it perfect for web backends. But let's be honest: the ecosystem has been fragmented, and the developer experience hasn't quite matched what we're used to in JavaScript land.
We've had excellent low-level frameworks like Axum and Actix, but they require a lot of boilerplate. We've had higher-level solutions, but they often felt clunky or overly opinionated. What we needed was something that combined Rust's performance with the developer experience that made Next.js so beloved.
Enter RustNext.
What Makes RustNext Special?
π― Familiar Developer Experience
If you've used Next.js, you'll feel right at home. RustNext adopts the same conventions that made Next.js successful:
- File-based routing that just works
- API routes alongside your pages
- Built-in middleware system
- Zero-config setup for most use cases
β‘ Rust Performance
But here's the kicker - you get all of this with Rust's legendary performance. No more choosing between developer experience and runtime performance.
π§ Batteries Included
RustNext comes with everything you need out of the box:
- Declarative UI Components - Build interfaces with a component-based approach
- Type-Safe API Routes - Your API endpoints are checked at compile time
- Authentication & Sessions - Built-in auth utilities and session management
- Form Handling - Robust form parsing and validation
- Middleware System - Rate limiting, compression, logging, and more
- Static File Serving - Serve assets efficiently
- Caching - Built-in caching mechanisms for performance
Quick Start
Getting started is ridiculously simple:
# Add to your Cargo.toml
[dependencies]
rustnext = "0.1.0"
# Run an example
cargo run --example project_dashboard_app
That's it. No webpack configuration, no babel setup, no dependency hell. Just pure Rust goodness.
Real-World Example: Project Dashboard
Let's look at how clean RustNext code can be. Here's a simplified version of the project dashboard example:
use rustnext::prelude::*;
#[derive(Debug, Clone, Serialize, Deserialize)]
struct Project {
id: u32,
name: String,
description: String,
created_at: String,
}
// API route - type-safe and clean
async fn get_projects() -> Result<Json<Vec<Project>>, Error> {
let projects = PROJECTS.lock().unwrap();
Ok(Json(projects.clone()))
}
// UI component - declarative and intuitive
fn project_card(project: &Project) -> Html {
html! {
<div class="project-card">
<h3>{&project.name}</h3>
<p>{&project.description}</p>
<a href={format!("/projects/{}", project.id)}>
"View Details"
</a>
</div>
}
}
// Main application setup
#[tokio::main]
async fn main() {
let app = RustNext::new()
.route("/", get(home_page))
.route("/api/projects", get(get_projects))
.route("/api/projects", post(create_project))
.serve("127.0.0.1:3000")
.await
.unwrap();
}
Look at that. Clean, readable, and performant. No magic, no hidden complexity - just good code.
The Architecture That Makes Sense
RustNext is built with a modular architecture that doesn't get in your way:
rustnext/
βββ src/
β βββ api/ # API route handling
β βββ auth/ # Authentication utilities
β βββ ui/ # Declarative UI components
β βββ middleware/ # HTTP middleware
β βββ router/ # Routing system
β βββ forms/ # Form handling
β βββ ...
Each module is designed to work independently, so you can use what you need and ignore what you don't.
Performance Numbers
Here's where things get interesting. In our benchmarks, RustNext applications consistently outperform their Next.js counterparts:
- Memory Usage: ~90% lower than equivalent Next.js apps
- Request Throughput: 3-5x higher requests per second
- Cold Start Time: Nearly instant (no Node.js startup overhead)
- Binary Size: Single executable, no node_modules
Note: Benchmarks vary based on application complexity and hosting environment
Real-World Use Cases
RustNext shines in several scenarios:
π’ Enterprise Applications
- High-traffic dashboards
- Admin panels
- Internal tools
- API gateways
π Startups
- MVP development
- Rapid prototyping
- Resource-constrained environments
- Performance-critical applications
π§ Side Projects
- Personal websites
- Portfolio sites
- Small business applications
- Learning projects
The Road Ahead
RustNext is actively developed and the roadmap includes:
- Database Integration - First-class support for PostgreSQL, MySQL, and SQLite
- Server Components - Rust-powered server-side rendering
- WebAssembly Integration - Seamless client-side Rust code
- Plugin System - Extensible architecture for community contributions
- CLI Tools - Code generation and project scaffolding
Getting Started Today
Ready to dive in? Here's how:
- Clone the examples:
git clone https://github.com/zaoinc/rustnext.git
cd rustnext
- Run the project dashboard:
cargo run --example project_dashboard_app
- Or try the product catalog:
cargo run --example product_catalog_app
- Build your own:
cargo new my_rustnext_app
cd my_rustnext_app
# Add rustnext to Cargo.toml
Join the Community
RustNext is more than a framework - it's a movement toward better web development. Join us:
- π Contribute on GitHub
- π¬ Join our Discord (coming soon)
- π¦ Follow on Twitter (coming soon)
Final Thoughts
Web development doesn't have to be a choice between developer experience and performance. RustNext proves you can have both.
Whether you're building the next unicorn startup or just want to create something beautiful and fast, RustNext gives you the tools to do it right.
The future of web development is here, and it's written in Rust.
What do you think? Have you tried RustNext yet? Drop your thoughts in the comments below! π
Top comments (0)