Chess App

This engineering thesis project delivers a full mobile application and backend ecosystem enabling real-time online gameplay for chess, checkers, and fully custom rule-based board games. The system supports dynamic board sizes, non-standard shapes, multiple players, and user-defined rules-all backed by a reactive cloud-based architecture.

  • University
  • Thesis
  • Java
  • Kotlin
  • Android
  • Spring
  • OAuth 2.0
  • RabbitMQ
  • CI/CD
  • OVH Cloud
  • Spring WebFlux
  • Spring Boot
  • Spring Data
  • Spring Security
  • AndroidX
  • PostgreSQL
  • MongoDB
2025-12-27 19:25
5 min read

Overview#

This project implements a multi-layer mobile application (Android, Kotlin) with a cloud backend (Java, Spring WebFlux) that allows users to play classic and custom logic games on a chessboard grid. Beyond standard chess and checkers, the platform enables players to design and play entirely new board-based games by modifying rules, board shapes, and piece behaviors.

Chess
Chess
Chess - in the middle of the gameplay
Chess - in the middle of the gameplay
Checkers
Checkers
Four player chess
Four player chess

Key Features#

  • Online and local gameplay for chess, checkers, and custom games.
  • Configurable rules, including piece movement, special effects, or custom constraints.
  • Board customization: arbitrary sizes, rectangular boards, cross-shaped boards.
  • 2–4 player support.
  • Time controls: Bullet, Blitz, Rapid variants.
  • User accounts, authentication (OAuth2), and match history.
  • Reactive real-time communication using Server-Sent Events (SSE).
  • Cloud-hosted backend using Spring WebFlux, NoSQL/SQL, and RabbitMQ.
  • CI/CD deployment to Ubuntu servers on OVH.

Game Customization#

The application exposes a full configuration panel that allows users to design their own variants before the match begins.

1. Piece Sets#

The game uses custom-designed SVG icons, allowing dynamic recoloring to match the selected theme. Out of the box, it supports:

  • Chess: pawn, king, queen, bishop, knight, rook
  • Checkers: man, king

The system is prepared for future extension-adding new icons automatically integrates them into customization menus.

Piece customization
Piece customization

2. Board Configuration#

Users can set:

  • Custom board dimensions (4×4 to 14×14 for each axis).
  • Board shapes: rectangle or Greek cross.

Example Sizes#

8x8 board
8x8 board
8x12 board
8x12 board
10x10 board
10x10 board

Example Shapes#

9x9 cross board
9x9 cross board
14x14 cross board
14x14 cross board

3. Player Count#

Games can involve 2 to 4 players, enabling non-standard multiplayer variants.

Cross board for 4 players
Cross board for 4 players

4. Time Controls#

Available presets:

  • Bullet: 1+2 (1 minute + 2s increment)
  • Bullet: 2+1
  • Blitz: 3+2
  • Rapid: 10+10

Core Application Functionality#

The goal of the thesis was to build a complete online gaming system with:

  • Accounts and authentication
  • Matchmaking and session management
  • Real-time move synchronization
  • Configurable rule engine for designing new game types

Built-in games include:

  • Chess
  • Checkers
  • Atomic Chess
  • Mini Chess
  • Progressive Chess
  • Anti Chess
  • Four Player Chess

But players can also define entirely new variants using the rules interface:

Piece placement customization
Piece placement customization
Move customization
Move customization
Piece promotion customization
Piece promotion customization
Rule customization
Rule customization
Piece customization
Piece customization

Supported customizations include:

  • Altered movement rules
  • Special effects
  • Non-standard board sizes and shapes
  • Additional players

This system effectively becomes a board-game creation platform.

Real-Time Architecture & Concurrency#

A critical part of the system is real-time synchronization between players. Events flow through:

  1. User sends an action (move event).
  2. Stateless backend retrieves the current session state from the database.
  3. The move is validated.
  4. A transactional update ensures no conflicting writes occur.
  5. The event is published to RabbitMQ.
  6. Clients subscribe to a dedicated SSE channel.
  7. All new events are pushed live to connected players.

This guarantees consistency even when multiple users send simultaneous actions.

Session events
Session events

SSE (Server-Sent Events) enables lightweight, real-time push communication. The backend emits both move events and keep-alive signals to maintain connection stability.

Checkers gameplay
Checkers gameplay
Chess gameplay
Chess gameplay

Example Backend SSE Endpoint#

@GetMapping(path = "{sessionId}", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<ServerSentEvent<EventDto>> listenForEvents(@PathVariable long sessionId) {
var moves = sessionService.listenForEvents(sessionId)
.map(eventMappers::map)
.map(it -> ServerSentEvent.<EventDto>builder().data(it).build());
var keepAlive = Flux.interval(Duration.of(15, ChronoUnit.SECONDS))
.map(it -> ServerSentEvent.<EventDto>builder().event("keep-alive").build());
return Flux.merge(moves, keepAlive);
}

Example Android Client Listener#

override fun listenForEvents(sessionId: Long): Flow<Event> = flow {
coroutineScope {
sessionApi.listenForEvents(sessionId)
.byteStream()
.bufferedReader()
.useLines { sequence ->
sequence.filter { it.startsWith("data:") }
.filter { isActive }
.map { it.removePrefix("data:").trim() }
.map { objectMapper.readValue(it, EventDto::class.java) }
.map { eventMapper.map(it) }
.forEach { emit(it) }
}
}
}.flowOn(ioDispatcher)

Settings & Personalization#

Settings screen
Settings screen

A key part of the application is its extensive customization module, allowing players to tailor the entire experience to their preferences. Users can switch between interface languages, enable or disable sound effects, and choose from multiple visual themes that completely change the look and feel of the board. The app also supports dynamic board scaling—regardless of device or orientation, the layout automatically adjusts tile sizes, piece proportions, and UI elements to maintain clarity and comfort during gameplay.

Language settings - English
Language settings - English
Language settings - Polish
Language settings - Polish
Sound settings
Sound settings
Theme example 1
Theme example 1
Theme example 2
Theme example 2
Theme example 3
Theme example 3
Theme example 4
Theme example 4

Summary#

The final product is a complete, cloud-driven mobile system for online board games. It supports:

  • Standard chess & checkers
  • Fully custom rule-based games
  • Custom boards and shapes
  • Multiplayer beyond two players
  • Real-time gameplay via SSE

The combination of reactive programming, scalable architecture, and flexible gameplay design makes the system a strong foundation for future extensions.

Future Work#

Planned or possible expansions:

  • Publishing the Android app to Google Play.
  • Vertical or horizontal scaling in Cloud environment.
  • Additional languages and themes.
  • More game types and rule sets.
  • Social features and tournaments.
  • AI-driven opponents.

This architecture allows seamless extension with new game mechanics, cloud capabilities, or interface improvements.