nextrs
Next.js-style routing for Rust. File-based routes, streaming page handlers, deploys to Vercel as a single function — no client framework, no htmx.
Why
Server-rendered HTML with the ergonomics of Next.js's app/ directory,
but it's a Rust function. Small, fast, no JS framework at the edge.
File-based routing
Folders under app/ become route segments.
Drop page.{rs,html}, layout.{rs,html},
loading.{rs,html} files; build-time codegen wires them.
HTML streaming
When a route has loading.{rs,html}, the server streams
the loading shell instantly and the page chunk arrives later — chunked transfer encoding,
~200-byte inline swap script. No client framework involved.
.rs or .html — your choice
Every slot accepts a Rust handler (askama template + logic) or a static HTML file.
.rs wins when both exist. Mix freely across the tree.
Vercel · single binary
Deploys to Vercel's Rust runtime as one function plus a catch-all rewrite.
Streaming works through Fluid compute via nextrs::vercel::StreamingVercelLayer.
Quick look
Each folder under app/ is a route segment.
app/
├── page.{rs,html} → /
├── layout.{rs,html} → root layout
└── dashboard/
├── page.{rs,html} → /dashboard
├── layout.{rs,html} → wraps /dashboard*
└── loading.{rs,html} → streamed instantly
Run locally
cargo run -p site
listening on http://localhost:3000
Demos
Three routes that progressively add one more convention file. Click through to see the source listing on each page.