Work

ChessDefender

Dev
Network
Backend

At this point the most complex game I had created so far. In a team together with 3 friends I implemented a server backend for our online game. This was a perfect opportunity to showcase my skills in backend development.

Motivation

This was again a school project which we had to complete in a group of four. Although we had many great ideas, something that all of us had in common was that we all like Chess. I never really cared about school that much or grades for that matter, but because this was a group project, I knew I couldn’t let my friends down. I put a lot of work into this project, which ended up paying off quite nicely. I was also exclusively working on the backend/server side of this project. Our project ended up scoring the best possible grade.

Features

Among others, these are the most relevant features:

Account - Login/Signup

To save high scores and have a name on a leaderboard, we decided to implement a sign-up and login page for our game. You could simply create an account and then start playing the game. All relevant data was stored in a database to be reused at a later point in time. Sessions were also tracked, in case you accidentally closed your browser, you could easily continue where you left off.

Game Runner

The game itself was run directly in the backend. None of the logic was part of the frontend. Once a game is started, the backend sends updates about 20 times a second to keep a smooth experience. With some interpolation magic, the frontend was able to make it seem like the game was running at a higher frame rate.

API

For the Frontend to communicate with the backend, we used a simple REST-API interface. To “stream” the gameplay from the server to the frontend, we used a one-way websocket. This approach ended up working out very well for us.

Technical Details

From a technical standpoint, we’ve ended up using the VUE.JS for the frontend and Spring Boot together with Java 21 for the backend in this project. As for my IDE, I used JetBrains IntelliJ, finally, for version control I used GIT together with GitLabs. As for additional dependencies, we’ve used an in-memory H2-Database

Learnings

During this project I learned various things about authentication and also networking:

Teamwork

While in other projects I was always the only one interested, here I had several like-minded people around me. We were able to come up with concepts and software really quickly. This was the first time I was part of a team that I could fully focus on my role, which was an amazing experience.

Auth workflows

Although I’ve used them many times before I never implemented a workflow bottom up like this before. I learned a lot about potential caveats and potential security issues that one needs to keep in mind while working with stuff like this.