A lightweight, proof-of-concept web framework loosely inspired by The Elm Architecture. It's built using the Rust programming language and compiles to WebAssembly.
A simple web framework that helps you build websites with Rust.
Elmio is like building with LEGO® blocks. You have different pieces that fit together to make a website:
- A place to store information (like a toy box)
- A way to handle actions (like pressing buttons)
- A way to show things on screen (like arranging LEGO® pieces)
- A way to make changes (like following LEGO® instructions)
- Install Prerequisites:
cargo install elmio-cli wasm-pack
- Create your first project:
elmio new my-website
cd my-website
- Start your website:
elmio serve
Every Elmio website has four main parts:
-
State - Information your website remembers
struct Model { count: isize, // Remembers a number }
-
Messages - Things that can happen
enum Msg { Increment, // Add one Decrement, // Subtract one }
-
View - What people see
fn view(model: &Model) -> Markup { html! { button { "−" } span { (model.count) } button { "+" } } }
-
Update - How things change
fn update(msg: &Msg, model: &mut Model) { match msg { Msg::Increment => model.count += 1, Msg::Decrement => model.count -= 1, } }
elmio new my-website # Make a new website
elmio serve # Start your website
elmio watch # Auto-update while you work
elmio build # Make your website ready for the internet
- Look at the examples in the examples folder
- Each example shows you how to build something cool
- Try changing small parts to see what happens
The examples folder has complete projects you can learn from:
- A counting button with tailwindcss
- And more coming soon!
- Fork the repository
- Make your changes
- Share your improvements with elmio!
Just like with LEGO®, start simple:
- Decide what information to remember (State)
- Plan what can happen (Messages)
- Design what people see (View)
- Choose how things change (Update)
This is open source software - you can use it, share it, and learn from it freely under the Apache 2.0 License!