Skip to content
←Projects
8 June 20262 min readIn development

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 BootAngular 18PostgreSQLWebSockets
What it is
An online card game with user accounts and a player leaderboard.
My role
Personal project: from the original JavaFX game to the web version, server and frontend.
Stack
Spring Boot · Angular 18 · PostgreSQL · WebSockets
Result
Rules validated on the server, so no cheating from the client · real-time games with STOMP · backend on Railway and frontend on Vercel.
Status
In development.
Links
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. I brought it to the web with a server that runs the game, user accounts and a leaderboard.

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 rules live in one place and you can't cheat from the browser.

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

Clubs double the damage, diamonds draw cards 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. Login and the leaderboard are a REST API.

Accounts with JWT and a leaderboard in PostgreSQL

Authentication with JWT and Spring Security. Every finished game is stored in PostgreSQL with JPA, and the leaderboard by wins comes from there. The frontend is Angular 18, with GSAP for the cards; the server runs on Railway and the site on Vercel.

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 game is the same, but each part can change without breaking the others.

Built byIsmael Manzano LeónFull Stack Developer · leo/ · leosoftware.dev
View on GitHub→ (opens in a new tab)

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