Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

boards-server

The server subproject is responsible for authentication, persistence, and the handling of game sessions.

Libraries

boards-server uses the following libraries, which will be installed automatically by sbt:

Directory Structure

  • scala/controllers/ handlers for HTTP and websocket requests.
  • scala/models/ database actions for querying or updating persistent state.
  • scala/schema/ database table schema, used to represent database tables and rows therein directly in the language.
  • public/ contains all assets (audio and textures) used by the website and games.
  • resources/ contains configuration/routes for the Play framework, as well as database migration scripts.
  • twirl/ contains webpage templates for server-side rendering.

Architecture

This subproject is compiled exclusively to JVM bytecode and only runs on the server.

Models

For most parts of the application, we use standard HTTP GET/POST requests to communicate with the client. The major exception is for the game view itself, where a websocket is the more natural choice. In the controllers directory, classes ending with "___Controller.scala" are for handling GET/POST requests, whereas classes ending with "___Actor.scala" are for handling websocket messages.

Database

We use an embdedded H2 database. No special setup is required. All data is stored locally in the repository for testing.

Rendering

Boards only uses client-side rendering. Thus, the twirl directory is almost empty - we need only a single template.