Zugzwang Game
Actix Rust + SSR + React + Wasm
What is that?
A web fullstack strategy game project made of:
zzg
, a Rust library which aims to implement game logic and AIweb/client
, a web frontend for the game- Typescript React app bundled with Webpack
- amazing styles with Tailwindcss V3
- can be server-side rendered by running
web/client/src/ssr.tsx
and serving the string result - the server-side rendered page is then hydrated in the browser by calling
web/client/src/index.tsx
- Webpack can also run a no-ssr dev version with fast hot-reload
- the web app can call
zzg_wasm
a rust wasm library which consists of wasm bindings ofzzg
. It is currently injected inweb/client/src/index.tsx
to avoid using it in SSR becauserust_ssr
does not support WASM
web
, anactix-rs
http server- does server-side rendering of
web/client
usingssr_rs
which internally usesrusty_V8
a Rust implementation of the V8 Javascript engine - serves static assets and bundled wasm from
web/build
- aims to be the backend of the game (player accounts, leaderboards, multiplayer...)
- does server-side rendering of
Instructions
- Install
./scripts/install.sh
- Watch and serve w/o ssr (fast reload)
./scripts/dev_front.sh
- Watch and serve w/ ssr (slow reload)
./scripts/dev_ssr.sh
- Run in production
./scripts/run.sh
Todo
- Replace Webpack with Parcel once Tailwind v3 works properly with it again
- Dig
rust_ssr
andrusty_V8
to find ways of calling WASM in the server-side rendered page
Credits
The web
and web/client
parts are heavily based on the Reactix repository by Valerio Ageno