Skip to content

Repository files navigation

Rusty-Framework

Build full-stack web applications in pure Rust.

A direct Rust port of Ivy-Framework.

Quick Start

Add the dependency to your Cargo.toml:

[dependencies]
rusty = { git = "https://github.com/Ivy-Interactive/Rusty-Framework" }

Build a reactive application:

use rusty::prelude::*;structCounterApp;implViewforCounterApp{fnbuild(&self,ctx:&mutBuildContext) -> Element{let count = use_state(ctx,0);let count_display = count.clone();let count_inc = count.clone();Layout::vertical().child(TextBlock::new(&format!("Count: {}", count_display.get()))).child(Button::new("Increment").on_click(move || count_inc.update(|v| v + 1))).into()}}#[tokio::main]asyncfnmain() -> Result<(),Box<dyn std::error::Error>>{RustyServer::new(3000, || CounterApp).serve().await}

Architecture

Rusty-Framework follows the same architecture as Ivy-Framework:

  • Views — Stateful components implementing the View trait with a build() method
  • Widgets — Serializable UI primitives (Button, Text, Layout, Card, etc.) sent as JSON to the frontend
  • Hooks — React-style state management (use_state, use_effect, use_memo, use_callback)
  • Server — WebSocket server (via axum) that communicates with the React frontend using JSON patches
  • Reconciler — Diffs widget trees and sends minimal incremental updates

Crate Structure

CrateDescription
rustyCore framework — views, hooks, widgets, server, shared types
rusty-macrosProc macros for #[derive(Widget)], #[prop], #[event]
rusty-ivymlProc macros for ivyml! / ivyml_file! declarative markup
rusty-filterFilter query lexer/parser/AST and evaluator
rusty-xamlParses XAML markup into widget trees at runtime
rusty-serverStandalone server binary
rusty-docsDocs site binary; build.rs generates src/generated/
rusty-desktopNative shell via wry/tao behind the optional shell feature

Examples

The examples live in rusty/examples/ and each one starts a server on port 3000. Set PORT to run several at once.

# Smallest possible app — layout, text and a button
cargo run --example hello_world
# use_state driving increment / decrement / reset
cargo run --example counter
# One card per widget family
cargo run --example widget_gallery
# Every input widget wired to state, with a submit summary
cargo run --example form
# Every hook, each with a visible readout
cargo run --example hooks_showcase
# Run two at once
PORT=3010 cargo run --example counter

Development

# Build everything
cargo build --workspace
# Run all tests
cargo test --workspace
# Lint
cargo clippy --workspace --all-targets -- -D warnings
# Format
cargo fmt --all

License

MIT

About

Build full-stack web applications in pure Rust — a direct Rust port of Ivy-Framework

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages