Vexara
Sci-fi strategy MMO
A browser-based strategy MMO where players build up a nexus, form alliances and fight over a shared galaxy in real time. I designed it, built it and I run it, on my own.
Play Vexara- Role
- Everything. Design, frontend, backend, infrastructure
- Timeline
- 2024 to present
- Stack
- Next.js, React 19, Express, Socket.IO, PostgreSQL, Prisma, Docker
- Live
- vexara.world ↗
- Unit types
- 16
- Buildings
- 12
- Peak players
- 150
- Account wipes
- 0
The nexus overview: resources, buildings and live queues.
01The game
Players start with a nexus and three resources, build it up, train an army and send it across the galaxy map. Marches take real time, resources tick up continuously, and alliances, factions and a player market make it as much a social game as a strategy one.
Seasons reset the map so new players aren't hopelessly behind, while accounts and cross-season progress carry over. There's no pay-to-win.
02The server decides everything
Every march, battle, raid and resource tick is resolved on the server. The client predicts and displays, it never decides. That rules out a whole class of cheating, but it means combat, travel and the economy all live in server code that has to be right, and every countdown on screen is anchored to server time rather than the player's clock.
03Two codebases, one set of rules
The Next.js client and the Express server are separate TypeScript projects with no shared package, so the economy numbers, combat maths and game constants are mirrored by hand. The rule is that a number changes on both sides in the same commit, along with any text that shows it to players. It's the easiest way for a bug to sneak in, so it's the first thing I check.
04Jobs that can't run twice
Arriving armies, production and season events run as background jobs. Each one takes a Postgres advisory lock and claims its work before processing it, with idempotency keys, so a crash or a second server can't resolve the same battle twice.
Combat, loot and trades never create or destroy troops or resources, and concurrent credits to the same row use atomic increments.
05Running it
Four Docker images, for the game server, the player client, the admin server and the admin client, built by GitHub Actions and deployed to a VPS behind nginx and Cloudflare. Game art is served from a Cloudflare R2 CDN, Grafana, Prometheus and Loki show me what's going on, and the database is backed up every night to off-site storage.
The admin panel is a separate service with two-factor login behind an IP allowlist. Every release gets patch notes, and the rules live in an in-game codex.