Skip to content

zduny/rust-webapp-template

Repository files navigation

{{project-name}}

Test Status

Rust web application template.

Implements a simple chat application.

Includes:

  • warp server,
  • browser client,
  • Web Worker for client,
  • native client,
  • common library project for sharing code between the above.

Prerequisites

To build the app wasm-pack needs to be installed.

How to use

Use cargo-generate:

cargo generate --git https://github.com/zduny/rust-webapp-template

To template users

Remember to update README.md, LICENSE and Cargo.toml files after creating new project using this template.

Example

Slightly simpler and more colorful example is available here.

Development

Use shell scripts to format code, lint, build, test, run or clean:

./format.sh
./clippy.sh
./build.sh
./test.sh
./run.sh
./build_and_run.sh
./clean.sh

Native client isn't included in run.sh (and build_and_run.sh) script, to run native client (most likely in another terminal window/tab) type:

./app_client

Windows

Above scripts are available in Batch file form in windows directory.

NOTE: They have to be run from said windows directory, don't move them to project root directory before running them.

Dependencies

This template uses following Rust crates developed by me:

  • js-utils - various JavaScript related utilities.

  • mezzenger - message passing infrastructure for Rust.

  • kodec - message encoding/decoding interface.

Please consider donating to support their further development:

ko-fi

See also

wasm-bindgen

web-sys

js_sys