This is a word game that was built using Rust and Yew. It also include the ability to export the underlying logic as WASM.
These are the steps needed to get the application running once you have cloned it to your local:
- Install (rust)[https://www.rust-lang.org/tools/install]
- Double check that Rust is in the environment variable, if missing add it
- Ensure Cargo is installed
- Run
rustup target add wasm32-unknown-unknownto add the wasm target - Run
cargo install trunkto install the trunk dependencies
This program uses a dictionary that was pulled from here. There is a process that will export that into a generated rust compatible data structure for you. to build it, run:
rustc src/generateDictionary- Run the executable, which expects a file in the directory called
dictionary.txt - Check that
src/games/words.rshas an array with values in it
- Run
trunk buildto build the application (this will download dependencies) - Run
trunk serve --opento launch the application, and open the browser window
- Run
cargo buildto install dependencies - Run
cargo testto verify WASM is functioning properly - Run
wasm-pack build --target webto build the binaries - Copy the binaries from
pkginto a folder in your site's source code - Call the methods exposed in the JS to get a suggestion, validate a guess, or generate a word
- run
trunk build --releaseto build the application for production. (You might want to add --public-url={path} to the command line if you are deploying to a location other than root on your web server) - copy the contents of the dist folder to your web server (ensure that the path matches the one specified in the public-url option)
- Open the browser to your server's URL