Skip to content
Fede Fernández edited this page Sep 8, 2023 · 15 revisions

ScalaDays 2023 - TicTacToe

For a better experience, use the following link to join to the Slack's workspace

This workshop will guide you in building a 2-player real-time strategy game entirely using Scala 3. By the end of this workshop, you will gain knowledge about:

  • Scala 3
  • Scala.js
  • Functional Domain Modeling
  • Functional Reactive Programming with a style similar to Elm using Tyrian
  • Kafka consumers and producers
  • Docker
  • docker-compose
  • sbt-native-packager
  • sbt tasks
  • Tagless Final
  • http4s with websockets

Prerequisites

To participate in this workshop, you will need:

  1. A computer with a keyboard, monitor, and a wireless internet connection.
  2. A desktop version of Docker, such as Docker Desktop (which is free for open source projects) or Rancher Desktop running the Docker daemon.
  3. Git.
  4. For Windows users only: Windows Subsystem for Linux.
  5. Node.js.
  6. Scala base installation.
  7. Java 11+ (likely installed with SDKMAN!).
  8. Intellij IDEA with the Scala plugin, VSCode with metals, or any other metals-compatible editor.

How to Launch Docker Desktop

For macOS Users

  1. Open the Finder.
  2. Navigate to the "Applications" folder.
  3. Double-click on "Docker.app" to start Docker Desktop.
ℹ️ Note
A whale 🐳 icon in the top status bar signifies Docker Desktop is running and can be accessed from a terminal.

For Windows Users

  1. Click on the Windows start menu.
  2. Begin typing "Docker Desktop".
  3. When Docker Desktop appears in the search results, click on it to launch.
ℹ️ Note
A Docker icon in the Windows system tray signifies Docker Desktop is running and can be accessed from a terminal.

For Linux Users (Using Ubuntu as an Example)

  1. Click on the Ubuntu 'Show Applications' button located at the bottom of the sidebar, or press "Super+A".
  2. Begin typing "Docker Desktop".
  3. When Docker Desktop appears in the search results, click on it to launch.
ℹ️ Note
A Docker icon in the status bar signifies Docker Desktop is running and can be accessed from a terminal.

How to Run the Project

To run the project, follow the steps below:

  1. Make sure the Docker daemon is up and running

  2. Check out the workshop-3 branch. You can use the following command to clone and use the branch directly:

git clone -b workshop-3 [email protected]:xebia-functional/tictactoe.git
  1. Enter in the project folder and run dockerComposeUp in a SBT session:
# Launch sbt
sbt

# Start the instances
dockerComposeUp
  1. Once everything is up, visit the client site in: http://localhost:23000/