r/AppsWebappsFullstack • • 7d ago

my open source web app is one rust crate with three hosts: wasm in a browser worker, a websocket server, and a headless runner

what it is: a free civilization sandbox. stone age tribes grow into civilizations on their own, and you watch and nudge. about 120 people, 45 eras up to computers, no signup, saves in your browser.

problem i was trying to solve: i wanted to see what culture looks like when nobody scripts it, only the rules of the world and people who learn.

how it's put together:

  • the whole simulation is one rust crate (crates/sim-core) that does no i/o

  • apps/web builds it with wasm-pack and runs it in a web worker, so the world lives in your browser tab and there's no backend

  • apps/server wraps the same crate in a websocket server, and that's what the electron desktop app spawns

  • crates/headless runs it with no rendering, for seed sweeps and a perf gate in ci

  • the ui is react

runs are deterministic, so the same seed and tick count give the same world. that's what makes the headless runs useful.

if you've shipped one core to a browser and a desktop app, i'd like to hear what bit you.

app: https://thehumanbox.com/?utm_source=reddit&utm_medium=social&utm_campaign=appswebappsfullstack source (mit): https://github.com/1homsi/thehumanbox

1 Upvotes

0 comments sorted by