This is a simple example of the Laplace application. It is a minimalistic local-first web-application that demonstrates how to use the Laplace platform to create and run lapps.
To build this project, you need to have the following tools installed:
- Rust: https://www.rust-lang.org/tools/install
cargo-make
: https://github.com/sagiegurari/cargo-make?tab=readme-ov-file#installationwasm-bindgen-cli
: https://github.com/rustwasm/wasm-bindgen?tab=readme-ov-file#install-wasm-bindgen-cli
For installing these tools, execute the following commands:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
cargo install --force cargo-make wasm-bindgen-cli
In addition, you need to install the required toolchains and compilation targets:
rustup toolchain install stable nightly
rustup target add wasm32-unknown-unknown --toolchain stable
rustup target add wasm32-wasi --toolchain nightly
To run the application, you need to have laplace
installed. If you don't have it, you can install it with the following command:
cargo install --git https://github.com/noogen-projects/laplace laplace_server
Optionally, for the client wasm hot-reloading, you also need to have a cargo-watch
plugin installed:
cargo install cargo-watch
- First, clone the project:
git clone https://github.com/noogen-projects/echo-lapp.git
cd echo-lapp
- Then, build the project with
cargo-make
:
cargo make all
Or for a debug build, use the following command:
cargo make -p debug all
The built lapp will appear in the directory target/dist/echo/
.
- Finally, run the project with
laplace_server
:
laplace_server
And open the browser to http://127.0.0.1:8080/echo
.
Optionally, for hot-reloading wasm-client, you can use the following command in the separate terminal:
cargo make watch