All Projects → yewstack → facade

yewstack / facade

Licence: other
Facade Framework - autogenerated embedded live dashboards for Rust apps

Programming Languages

rust
11053 projects
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to facade

material-yew
Yew wrapper for Material Web Components
Stars: ✭ 116 (+22.11%)
Mutual labels:  wasm, yew
wasi-worker
WASM / WASI interface for browser service workers
Stars: ✭ 31 (-67.37%)
Mutual labels:  wasm, yew
rust-electron-demo
rust electron demo using yew
Stars: ✭ 15 (-84.21%)
Mutual labels:  wasm, yew
bounce
The uncomplicated Yew State management library
Stars: ✭ 43 (-54.74%)
Mutual labels:  wasm, yew
rocket-yew-starter-pack
Example boilerplate for websites in pure Rust
Stars: ✭ 77 (-18.95%)
Mutual labels:  wasm, yew
fullstack-rust
Reference implementation of a full-stack Rust application
Stars: ✭ 39 (-58.95%)
Mutual labels:  wasm, yew
ybc
A Yew component library based on the Bulma CSS framework.
Stars: ✭ 131 (+37.89%)
Mutual labels:  wasm, yew
yew-router
Router extension to yew
Stars: ✭ 27 (-71.58%)
Mutual labels:  yew
blazor-ui
A collection of examples related to Telerik UI for Blazor Components: https://www.telerik.com/blazor-ui
Stars: ✭ 182 (+91.58%)
Mutual labels:  wasm
wasm-extension-template
An easy-to-use template for Rust web extensions. The Rust code is compiled to WASM and ran as a content script.
Stars: ✭ 78 (-17.89%)
Mutual labels:  wasm
interactive-pixelator
🌇 🌃 upload image and make interactive pixel art 🕹
Stars: ✭ 22 (-76.84%)
Mutual labels:  interactive
Warp
Warp is a blazingly-fast modern Rust based GPU-accelerated terminal built to make you and your team more productive.
Stars: ✭ 1,319 (+1288.42%)
Mutual labels:  wasm
wasm-nginx-module
Run Wasm in OpenResty/Nginx
Stars: ✭ 55 (-42.11%)
Mutual labels:  wasm
tarmac
Framework for building distributed services with Web Assembly
Stars: ✭ 55 (-42.11%)
Mutual labels:  wasm
newrelic-quickstarts
New Relic One quickstarts help accelerate your New Relic journey by providing immediate value for your specific use cases.
Stars: ✭ 46 (-51.58%)
Mutual labels:  dashboards
livestream-gatsby-themes
Source code to demonstrate how to build Gatsby themes, child themes, and sites using themes.
Stars: ✭ 24 (-74.74%)
Mutual labels:  livestream
marcizhu
An interactive chess game in a README file!
Stars: ✭ 37 (-61.05%)
Mutual labels:  interactive
rustwasmc
Tool for building Rust functions for Node.js. Combine the performance of Rust, safety and portability of WebAssembly, and ease of use of JavaScript.
Stars: ✭ 97 (+2.11%)
Mutual labels:  wasm
stingray-plugin
Autodesk Interactive Plugin. Fork it, Build it, Ship it!
Stars: ✭ 28 (-70.53%)
Mutual labels:  interactive
interp
Interpreter experiment. Testing dispatch methods: Switching, Direct/Indirect Threaded Code, Tail-Calls and Inlining
Stars: ✭ 32 (-66.32%)
Mutual labels:  wasm

Facade

Facade is a framework to rapidly add web-UI to any Rust program. It let enrich your console or server app with an awesome UI just in a matter of seconds.

Facade fuses web-server and WASM-based web-app into Rust program. No external files. No external dependencies. Just your binary.

To achieve that effect Facade uses Yew framework to build a universal UI and use WebSocket connection to interact with your app that supply live updates to UI that renders them reactively.

Vuetify relations

We reuse CSS components' styles from Vuetify project: https://github.com/vuetifyjs/vuetify

You can read the license of Vuetify here: https://github.com/vuetifyjs/vuetify/blob/master/LICENSE.md

Use-cases

Uses-cases of this framework are unlimited and include but are not limited to the following cases (checkbox list used to show layouts that implemented to make these cases possible):

  • Dashboards
  • Admin panels for server
  • Installation wizards
  • Logs explorers
  • Business-intelligence panels
  • Swagger-compatible API playgrounds
  • Blockchain explorers
  • Presentations (yeah, you can create presentations for Rust conferences with Rust soon)
  • Polls and quizes
  • Interactive docs

EXTRA: Mobile compatibility! It already works, but need flexible layouts.

You know that very hard to keep maintainance of the projects without external supports. Become a sponsor on Patreon to help us bring these cases faster.

How to use

Add dependency

Add a dependency to your Cargo.toml file:

[dependencies]
facade = { git = "https://github.com/DenisKolodin/facade" }

We used git here since the framework is very fast changed yet.

Spawn a server

Spawn a server in your main function and take a control object to declare UI and supply live updates to it.

let mut control = facade::main()?;

Declare UI

Create a scene and put it to Control instance:

let page_one = Page(
    "Page One",
    "Live information",
    Row(vec![
        TitledPanel("Server Status", Dynamic("status")),
    ]),
);
let scene = Dashboard(
    "My Dashboard",
    vec![page_one],
);
control.scene(scene);

Send live data

Now you can use Control instance to send live updates to UI using unique IDs you used in UI declaration:

let mut counter = 0;
loop {
    counter += 1;
    control.assign("status", format!("Counter is {}", counter));
    thread::sleep(Duration::from_millis(300));
}

And yeah, you supplied updates too fast in this example, but that's not a problem, because Facade accumulate updates before send them, overwrites changed values and send the latest update only.

Start and enjoy live updates by connecting to: http://localhost:12400 port (by default) with your favorite browser. If you want to check it with your smartphone than set bind address to FACADE_ADDRESS=0.0.0.0 and connect to the same port, but to IP address of your PC/Mac (both to avoid sexism).

You can also check ready to use example here.

Tuning

You can use FACADE_ prefixed variables to control parameters of the Facade in your app. For example, to change address or port you can use FACADE_ADDRESS and FACADE_PORT environment variables respectively.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].