heart 0.1.15

Hypermedia-based web development of the 1990 future!
Documentation

Heart

A Rust-based web stack combining powerful libraries for building modern, efficient web applications.

Components

  • Warp: High-performance HTTP server with filter-based routing
  • Maud: Compile-time HTML templating
  • HTMX: Modern web interactions without complex JavaScript
  • TiKV: Distributed, strongly consistent key-value store

Installation

Add to your Cargo.toml:

[dependencies]
heart = "0.1.9"

Example

use tokio;
use heart::prelude::*;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    tracing_subscriber::fmt::init();

    let route = warp::path("hello")
        .map(|| {
            let markup = html! {
                h1 { "Hello, Heart Stack!" }
                p { "This is a tiny example." }
            };

            info!("Serving hello route");

            Response::builder()
                .header("Content-Type", "text/html")
                .body(markup.into_string())
        });

    info!("Starting server on http://localhost:3030");
    warp::serve(route)
        .run(([127, 0, 0, 1], 3030))
        .await;
    Ok(())
}

Contributions

Contributions are welcome! Please follow Kant's categorical imperative.

License

Fair License (2024)

Copyright (c) 2024 Lukáš Hozda

Usage of the software is PERMITTED, modification and redistribution are PERMITTED, 
however all versions of the derived code MUST be clearly marked as such 
and NOT represented as the original software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.