Four in a Row - Server
An online version of the popular game four in a row, written in Rust on the server side and Flutter + Dart on the client.
Download here: https://play.google.com/store/apps/details?id=ml.fourinarow
Or play online (beta): https://play.fourinarow.ffactory.me/
Related Projects:
-
Clientside: fourinarow-app
-
Serverside: fourinarow-server
-
[WIP] bot / watcher: fourinarow-bot
Features:
- world wide online play
- over 4000 downloads
- account creation, friends system
- beautiful, minimalist design
- subtle animations
- request to battle your friends
- local mode: two players - one device
Under the hood:
- reliable websocket connection
- message delivery guarantee
- message reordering on client and server side
- clean architecture: state and view completely separate
- automatic reconnection
Deployment
Prerequisites
Before getting started, make sure you have Docker with Docker Compose installed on your machine.
Deploy
-
Set up reverse proxy with traefik: https://github.com/ffactory-ofcl/vps-reverse-proxy. Follow instructions there.
-
Create a deploy key using this script and add it to the Github repository.
-
Clone this repository using the command echoed by the script.
-
Copy the
.env_template
file to.env
and fill in the values.cp .env_template .env nano .env
-
Create a systemd service file:
sudo cp fourinarow-server.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable fourinarow-server sudo systemctl start fourinarow-server
-
Check the status:
sudo systemctl status fourinarow-server