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.
