#web-framework #expressive #async

velto

Velto: expressive, async-native, and grounded Rust framework

8 releases (5 stable)

new 1.4.0 Sep 20, 2025
1.3.0 Sep 19, 2025
0.1.2 Aug 17, 2025

#815 in Template engine

Download history 284/week @ 2025-08-13 61/week @ 2025-08-20 4/week @ 2025-08-27 239/week @ 2025-09-03 143/week @ 2025-09-10

475 downloads per month

MIT license

25KB
321 lines

๐Ÿš€ Velto

A minimal async web framework for Rust, built for clarity, speed, and joy.

Crates.io GitHub Actions Workflow Status Docs.rs License: MIT


โœจ Features

  • ๐Ÿงญ Intuitive routing with route!(...) macro
  • ๐Ÿงต Templating with built-in render! macro
  • โšก Fully async, powered by async_tiny
  • ๐Ÿ”„ LiveReload support in development mode
  • ๐Ÿ“ Static file serving with zero config
  • ๐Ÿง  Minimal boilerplate via velto::prelude

๐Ÿ“ฆ Installation

Add Velto to your Cargo.toml:

[dependencies]
velto = "1.0.0"

๐Ÿš€ Quick Start

use velto::prelude::*;

fn homepage(_req: &Request) -> Response {
    render!("index.html", {
        "title" => "Welcome to Velto",
        "message" => "Fast. Clean. Rusty."
    })
}

#[tokio::main]
async fn main() -> std::io::Result<()> {
    let mut app = App::new();
    app.enable_dev_mode(); // Enables LiveReload
    route!(app, "/" => homepage);
    app.serve_static("static");
    app.run("127.0.0.1:8080").await
}

๐Ÿ”„ LiveReload

Velto automatically watches your static/ and templates/ directories in dev mode.
When a file changes, connected browsers reload instantly via WebSocket.

No setup required. Just call:

app.enable_dev_mode();

๐Ÿงฐ Project Structure

Velto is organized into modular components:

velto/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app.rs          # Core application logic
โ”‚   โ”œโ”€โ”€ router.rs       # Routing and handler dispatch
โ”‚   โ”œโ”€โ”€ reload.rs       # LiveReload WebSocket + file watcher
โ”‚   โ”œโ”€โ”€ dev.rs          # Dev mode toggles and helpers
โ”‚   โ”œโ”€โ”€ template.rs     # Templating engine
โ”‚   โ”œโ”€โ”€ macros.rs       # Macros for render! and route!
โ”‚   โ”œโ”€โ”€ prelude.rs      # Public API surface
โ”‚   โ””โ”€โ”€ lib.rs          # Entry point

โ“ Why Velto

Velto is for developers who want:

  • A fast, async-native web framework without the complexity of full-stack giants
  • Clean routing and templating without ceremony
  • Instant LiveReload for a smooth development loop
  • A modular codebase that grows with your project
  • A framework that feels like Rust โ€” not like a port of something else

Whether you're building a personal site, a microservice, or a dev tool, Velto gives you just enough structure to stay productive โ€” and just enough freedom to stay creative.


๐Ÿ” Migration from 0.x

Velto 1.0.0 introduces async support and LiveReload, but keeps the public API familiar. Here's what changed:

Old (0.x) New (1.0.0)
fn main() #[tokio::main] async fn main()
Response<Cursor<Vec<u8>>> Response (no generics)
app.run(...) app.run(...).await
No LiveReload app.enable_dev_mode()

Most route handlers and macros (route!, render!) remain unchanged.
Just update your main() function and remove Cursor<Vec<u8>> from response types.


๐Ÿ“„ License

MIT โ€” free to use, modify, and distribute.


๐Ÿ’ฌ Contributing

Velto is evolving rapidly. If you have ideas, feedback, or want to help shape its future, open an issue or submit a PR.
We welcome clean code, thoughtful design, and good vibes.

Dependencies

~8โ€“19MB
~240K SLoC