A redesign of 'WordGrid' in Rust & WebAssembly, featuring both single- & multi- player.
  • Rust 57.1%
  • TypeScript 37.9%
  • Less 2.8%
  • HTML 1.4%
  • Dockerfile 0.8%
Find a file
Joel Therrien 23043fd1cd feat(server): Allow connections for existing player_name to take over
Before, incoming connections for an existing player name were denied.
This caused issues if the websocket connection between the client and
server was glitched, and the server falsely believed that the client
was still connected. When this happened, the player was effectively
locked out of reconnecting.

I still want to add a better heartbeat system where the client can
detect when the connection is glitched and auto-reconnect, but
this is a step in that direction.
2026-06-14 15:00:40 -07:00
resources fix(dictionary): Mark 'Japan(s)' as rare words AI won't use 2025-11-08 19:44:06 -08:00
server feat(server): Allow connections for existing player_name to take over 2026-06-14 15:00:40 -07:00
ui feat(server): Allow connections for existing player_name to take over 2026-06-14 15:00:40 -07:00
wasm fix: End-of-game message appearing twice 2025-12-18 18:10:51 -08:00
wordgrid chore(rust): Fix warnings and update dictionary size test 2025-08-09 20:57:39 -07:00
.gitignore fix: Dockerfile 2024-12-27 12:24:07 -08:00
Cargo.lock build: Update Rust + resolve cargo audit 2026-04-07 17:53:12 -07:00
Cargo.toml build + feat: Updated dependnecies, improved Dockerfile, /room_count 2025-02-16 11:31:40 -08:00
Dockerfile build: Update Rust + resolve cargo audit 2026-04-07 17:53:12 -07:00
LICENSE feat: Bundle in Noto fonts into UI 2026-02-18 17:59:46 -08:00
README.md docs: Update documentation 2024-12-26 10:54:56 -08:00

README

This repository contains the code for 'WordGrid', a browser game where you use letter tiles to form words.

There is support for both multiplayer and singleplayer, where singleplayer runs entirely in the browser through WebAssembly.

Here's the rough layout of the repository:

  1. The core game logic resides in the wordgrid/ folder as Rust code and is a library for either the wasm/ code (if compiled to WebAssembly for singleplayer), or for the server/ code (if used in multiplayer).
  2. The Rust code in wasm/ is a small compatibility layer between the library and the browser. It gets compiled using wasm-pack to a Node package into wasm/pkg/ that gets read by ui/
  3. ui/ is a Node package that uses React & Typescript. Currently it assumes it's being run in an environment that supports both singleplayer & multiplayer. This can't be built until the wasm/ code has been built.
  4. server/ is a Rust program that runs a small web server for multiplayer purposes.

If you want to try it now, I host a version at https://wordgrid.joeltherrien.ca

Setup

I'd suggest just reading through the Dockerfile to precisely see what to do, but it's basically the following steps:

  1. Ensure you have Rust, Node, npm, and wasm-pack installed.
  2. Build wasm by navigating to the wasm/ folder and running wasm-pack build --target=web
  3. Build the ui by navigating to the ui/ folder and running npm run build. You may need to first run npm install.
  4. Build the server by navigating to the server/ folder and running cargo build --release.

If you just want singleplayer, you can stop after step 3 and the static files you'll want are in ui/dist/. You can rename singleplayer.html -> index.html if you want to save a click.