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.