All projects

Brawl Code

Full-stack microservice tournament management system with service discovery and distributed architecture

Team, May 2025

Brawl Code screenshot

6

people

7

services deployed

1,189

commits over one term

217

tests

Why

A tournament platform for coding competitions, built by a team of six for a university module. Admins create single-elimination tournaments, players sign up, the bracket is seeded by skill, and every match shows each player's predicted chance of winning.

How it works

A Next.js front end calls a gateway, which finds the service it needs through a registry. Each service owns its own database. When a round starts or a result comes in, the tournament service tells the notification service, which pushes it to every open browser.

Follow a round result

A request reaches the gateway, which locates the tournament service.

finds servicesratingssign-ineventsWeb appNext.jsService registryEurekaGatewaySpring Cloud GatewayTournament serviceBrackets, predictionUser serviceProfiles, ratingsAuth serviceSign-in, tokensNotification serviceLive event streamA database eachFour PostgreSQL instances

Decisions

A rating with its own uncertainty

A win count says little about a new player. Each player has a skill estimate and an uncertainty around it, in the TrueSkill style, and both are updated after every result.

A formula first, nudged by a model

The chance of winning comes from the rating formula. A small learned model adjusts it by a fifth, and only when the formula already gives 60% or more, to keep the model from overfitting close matches. The result is held between 5% and 95%.

Seeded pairing that can still be tested

The stronger half of the field are fixed seeds, paired against a shuffled weaker half. The shuffle can be switched off, so the pairing function can be tested with a known answer.

Notifications without a broker

The tournament service hands each event straight to the notification service, which streams it to browsers. That was simple to build. The cost: if notifications are down the hand-off fails, and open streams live in one instance's memory.

My part

I wrote the prediction service, the rating updates and the first version of the scheduled matchmaking, plus 16 of the project's 30 test files across four services.

The gateway, the registry and the AWS deployment were my teammates'.

Built with

Services
  • Java
  • Spring Boot
Matchmaking
  • TrueSkill
  • Weka
Service routing
  • Spring Cloud Gateway
  • Netflix Eureka
  • OpenFeign
Storage
  • PostgreSQL
Frontend
  • Next.js
  • TypeScript
Deployment
  • Docker
  • AWS ECS Fargate
  • Terraform
Testing
  • JUnit