Skip to content
←Projects
8 June 20262 min readIn production

Regicide: a card game, from JavaFX to the web.

I migrated a JavaFX card game to the web: Spring Boot resolves every move on the server, Angular presents it and WebSocket syncs it in real time.

Spring Boot 4Angular 22PostgreSQLWebSocketsDocker
Regicide home screen with the face cards
What it is
A browser card game, live at regicide.leosoftware.dev, with every move resolved on a Spring Boot server.
My role
Personal project: from the original JavaFX game to the web version, server, frontend and deployment.
Stack
Spring Boot 4 · Angular 22 · PostgreSQL · WebSockets · Docker
Result
Rules validated on the server, so no cheating from the client · accounts, a leaderboard and games you can resume on another device · over 160 backend tests and over 60 frontend tests.
Status
In production.
Links
Play Regicide (opens in a new tab)View code (opens in a new tab)

Regicide started as my final Programming project: a card game in JavaFX, built in four days, with games saved as JSON and stats as CSV. It only worked on my computer. Now it's on the web, at regicide.leosoftware.dev, with a server that runs the game, user accounts, a leaderboard and a Spanish and English version.

The game lives on the server

The rules are in Spring Boot. The browser shows the state and sends the move; the server validates it, resolves it and returns the new state. The browser never knows the order of the deck, so you can't cheat from it.

Each turn is a state machine with three phases: attack, defend and game over. You attack with one card or several of the same number; if the enemy survives, you defend by discarding until you cover its damage. The enemies are the face cards, and you win by emptying the castle.

Suits have powers

Hearts bring cards back from the discard pile, clubs double the damage, diamonds draw and spades lower the enemy's attack, unless the enemy is of the same suit, so every attack makes you think. Two jokers let you swap your whole hand.

Real-time moves over WebSocket

Moves travel over WebSocket with STOMP: the connection stays open and the new state arrives instantly, only to whoever asked for it. Login and the leaderboard are a REST API.

Accounts and my own deployment

You can play as a guest or with an account. With an account, the game is saved on every move and can be resumed from any device. Passwords use Argon2id and are checked against known breaches, and JWT tokens are invalidated on logout. The PostgreSQL schema only changes through Flyway migrations. Everything runs with Docker Compose on an Oracle Cloud machine, with Caddy for HTTPS.

What I learned: deciding what each part does

In JavaFX everything lived in the same program. Moving it to the web, I had to decide what the server does, what the browser does and where each thing is stored. The tests play whole games with a fixed seed against the running server, and that let me change each part without breaking the others.

Built byIsmael ManzanoJunior AI Engineer · leo/ · ismaelmanzano.com
Play Regicide→ (opens in a new tab)

Does this fit what you are looking for? Write to me →