Rad Survival
A persistent browser-based idle RPG with a deterministic simulation that runs on both the server and the client.
A solo project built in TypeScript as a pnpm monorepo, currently live in closed alpha. Players fight and gather around the clock, including while the game is closed, on desktop and mobile web from one codebase, with a Steam release planned. All game rules live in one pure simulation package: the server runs it as the authority and the browser runs the same code to predict the screen between syncs. About 45,000 lines of TypeScript and more than 1,700 automated tests.
What I Built:
-I designed an event-stepped simulation engine with coordinate-addressed seeded randomness and integer-only math, so 72 hours of offline progress replays exactly in tens of milliseconds and matches online play to the last unit, verified by property tests over random split points.
-I built a server-authoritative Fastify API where every write goes through one read, integrate, compare-and-swap path on PostgreSQL, so two devices syncing at once never lose progress. Commands are idempotent and validated against strict Zod schemas, so a modified client can send intent but never claim an outcome.
-I implemented client-side prediction in React with a server clock offset taken from the fastest round trip, and reconciliation as an exact state comparison that surfaces any drift instead of hiding it.
-I own the persistence layer and the release pipeline: forward-only Drizzle migrations against live accounts, hand-rolled session auth with argon2id, and a CI pipeline that typechecks, tests, builds the Docker image, boots it against real Postgres and drives a browser with Playwright before Railway deploys.
Screenshots