Generust
is a cargo-generate template that provides a Rust web server and WASM client with some interesting features.
It uses actix-web, maud, UIKit, and wasm-bindgen to serve your app as a server or webview, via HTTP and WebSockets.
Rust nightly is required, at least for now
Normally started as a server, Generust also embeds a webview, allowing you to run a standalone instance.
User profile settings allow you to set your name and theme.
UIKit integration and reverse routing make designing attractive pages simple.
I don't get it, but some of you love Dark Mode. Well, here it is.
Custom error pages show detailed traces (or custom error pages)
generust-example-project - Basically just the result of running this template
cargo install cargo-generate
cargo generate --git https://github.com/kyleu/generust.git --name my-project
cd my-project
./bootstrap
This will package the WASM client, compile the UIKit SCSS, and build the main application.
You can execute cargo run
to start the server and open a system webview pointing to it, or run {{project-name}} -h
to see the CLI options.
Scripts are provided in ./bin
that will help you build and publish the app.
Good luck!
After you've created your project, the variables in this file will be replaced with your project's information, just remove this section and the lines above it.
{{project-name}} is a work in progress...
Running as a client application or shared server, {{project-name}}
has a focus on performance, correctness, and developer comfort.
See installing.md for installation guidance. After installing, run {{project-name}} -h
to get started.
See scripts.md for available tools for building, running, and packaging the app.
{{project-name}}
splits its code into several library crates:
{{project-name}}-assets
: Contains embedded static files intended to be served from the web application{{project-name}}-client
: Run in the client's browser as a WebAssembly package, includes templates{{project-name}}-controllers
: Contains actix-web HTTP controllers, usually calling methods from{{project-name}}-service
{{project-name}}-core
: Contains definitions that are shared between server and client{{project-name}}-service
: Contains the primary logic for the application. It receives RequestMessages and emits ResponseMessages{{project-name}}-templates
: Contains Maud templates used by the server to render responses{{project-name}}
: Stored in the root of the project, this is the app's main library and binary
The project currently exclusively uses the filesystem for saved data, no database is involved.
By default, {{project-name}} stores config files in your system's user configuration directory.
- macOS: ~/Library/Application Support/{{project-name}}
- Linux: ~/.config/{{project-name}}
- Windows: %APPDATA%/{{project-name}}/{{project-name}}
profile/*
: User profile information