Skip to content
Eduardo Serrano
All work

Case study

API Arena

A platform that grades REST APIs built by students, automatically and for real. I designed it, built it alone and run it in production.

role
Sole architect and developer
period
01/2026 - now
core
Java 21, Spring Boot, Kafka
API Arena landing page with the live submission panel and test scores

What it does

A student picks a challenge and submits a Spring Boot project. API Arena builds it, runs it in its own isolated container, fires real HTTP requests at it, measures how it performs, reviews the code and puts the score on a live leaderboard.

No mocked answers: the API under test is real, and so are the requests.

How a submission is scored

  • 300 Functional HTTP tests
  • 300 Performance
  • 200 REST design
  • 200 Code review

Maximum score: 1,000 points.

One service, one job

Java 21 and Spring Boot 3.5 behind an nginx gateway, a React 19 frontend, and Kafka between the parts that should never wait on each other.

edge
  • nginx gateway
    Single entry point with rate limiting
  • frontend
    React 19 and Vite, served by nginx
core
  • auth-service :8081
    Registration, login, JWT, email verification, profiles
  • challenge-service :8082
    Challenges and their evaluation rules
pipeline
  • submission-service :8083
    Orchestrates each run, status, logs and replay timeline
  • sandbox-service :8084
    Isolated build and run: Docker-in-Docker or fallback runner
  • testing-service :8085
    Functional, performance and REST design checks
  • ai-review-service :8086
    Configurable code review: heuristic or AI
results
  • leaderboard-service :8087
    Global and per-challenge rankings
  • notification-service :8090
    In-app notifications over WebSocket, email mirror
  • metrics-service :8089
    Product and pipeline KPIs
data and ops
  • PostgreSQL 16
  • Redis 7
  • Kafka
  • Docker Compose
  • Prometheus
  • Grafana
  • Alertmanager
  • GitHub Actions

Follow a submission

Pick what happens. The diagram shows the path the event takes.

called in order by submission-service
submission-serviceAccepts the project
sandbox-serviceBuilds and runs it in Docker-in-Docker
testing-serviceReal HTTP functional and performance tests
ai-review-serviceCode review and final score
kafka
notifications
leaderboard

Every hop succeeds. Switch the scenario to see how failures are handled.

submission-serviceAccepts the project
called in order by submission-service
sandbox-serviceBuilds and runs it in Docker-in-Docker
testing-serviceReal HTTP functional and performance tests
ai-review-serviceCode review and final score
kafka
notifications
leaderboard

Everything works

submission-service builds and runs the project in a fresh Docker-in-Docker sandbox, tests it over real HTTP, gets a code review and publishes the result. Kafka fans it out to the leaderboard and to the student's live notifications.

delivery
at least once
duplicates
idempotent consumers
failures
backoff, then DLT per group

Two bugs I found and fixed

Events were disappearing

symptom
Some Kafka events never got processed, and nothing reported it.
cause
Consumers caught exceptions and swallowed them, so a failed event looked handled.
fix
Failures now surface: retries with exponential backoff (1, 2, 4, 8 s), then a dead-letter topic per consumer group. Malformed JSON goes straight to the DLT. Every failed event is kept and can be inspected.
lesson
Failures have to be visible and kept, never silently dropped.

The sandbox could stop grading

symptom
When the Docker-in-Docker sandbox failed, submissions could not be graded.
cause
Grading depended on a single execution path.
fix
An automatic fallback runner takes over when DinD fails, so the pipeline keeps grading.
lesson
A critical dependency needs a fallback before it breaks.

Secure, tested, watched

Security and privacy

  • Spring Security with JWT authentication
  • nginx gateway with rate limiting
  • TOTP two-factor authentication for admins
  • Audit trail of admin actions
  • GDPR data export and account deletion

Quality and operations

  • JUnit 5, Mockito and Spring Boot test slices
  • GitHub Actions: end-to-end smoke tests, then production deploy
  • Actuator metrics into Prometheus and Grafana
  • Alertmanager for alerts
  • Runs on my own server with Docker Compose

Final project of my web development diploma. Awarded Matrícula de Honor, the highest distinction, limited per cohort.

Want to talk about how it works?

Email me