1. Home
  2. Web development
  3. War of the Generals

Case study ยท Web app

War of the Generals

The classic Filipino game of hidden ranks and bluffing, Salpakan, playable in any browser. Quick-match against other people, send a private room link to a friend, or practice against the computer. No account needed, free to play, and every move is checked on the server.

The job

Salpakan, also called Game of the Generals, is a two-player board game where you never see your opponent's pieces. Every clash is resolved by rank, and the whole thing runs on bluffing and memory. It is popular across the Philippines and among Filipino communities abroad, and it deserved a modern web version that works on a phone, needs no download, and cannot be cheated.

That last part is the hard part. In a hidden-information game, the browser can never be trusted with the other player's pieces. So the server has to hold the true state, resolve every battle, and tell each player only what they are allowed to know.

What we built

Live game rooms

Each match runs inside its own Durable Object on Cloudflare's edge: one small, stateful process per room that owns the board, enforces the rules, runs the clocks, and pushes updates to both players over a live connection. If a player drops and reconnects, the room is still there waiting.

Three ways to play

  • Quick match: a matchmaker pairs you with the next available opponent
  • Private rooms: a shareable link that puts a friend on the other side of the board
  • CPU practice: computer opponents on a difficulty ladder, with different playing styles

Clocks, replays, and formations

Time banks of three, five, ten, and fifteen minutes, or a custom clock up to thirty. Every finished game is saved and can be replayed move by move. Players can save their favorite opening formations and deploy them with one tap.

Accounts, but only if you want one

You can play instantly as a guest. Signing in with Google adds a profile, a history, and saved formations. Nothing about the core game is locked behind an account.

Four visual themes

The board and pieces come in four selectable looks, from a classic wood table to a cleaner modern set, all rendered with the same components.

How it is built

The front end is React with TypeScript, built with Vite and deployed as a static site on Cloudflare Pages. The API is a single Cloudflare Worker at its own subdomain. Game rooms and the matchmaker are Durable Objects, which give each room strongly consistent state without running or paying for a server that sits idle between games. Profiles, game history, and replays live in Cloudflare D1, a small SQL database at the edge.

The rules engine runs only on the server. The client sends intentions and receives a filtered view of the board, so peeking at network traffic reveals nothing about the opponent's pieces. Both the web front end and the worker are deployed with one script each.

What carried over to client work

This is the project we point to when a client asks whether we can build "an app, not just a website." Real-time state, sign-in, per-user data, and a serverless back end that costs almost nothing at rest are exactly the pieces a booking system, a customer portal, or a live dashboard needs. The infrastructure is boring in the best way, and we have already shipped a game on it.

More work

Need a web app, not just a website?

Tell us what it's for and who it's for. We'll reply with an honest read on scope, timeline, and whether we're the right fit.