- The player who creates the game is always blue
- The player who joins the game is always red
- Any player after the first two who join a game is a spectator (cannot move any pieces)
Create_And_Join.mp4
- Every move is updated on each player/spectator's board without the need to manually refresh
- The blue/red circles above are highlighted (in green) to show which player is meant to move next
- Spectators can ONLY spectate. They cannot move any pieces
Move_Mechanics.mp4
- The player name can be seen as an ID. Once a player creates/joins a match, if they are assigned to that color, the REDIS database will remember which pieces they control
Joining_Feature.mp4
(Latest version = 0.7.0)
-
mvn clean install -DskipTests
-
docker build -t ivorytoast3853/titan-amg:0.7.0 .
-
docker push ivorytoast3853/titan-amg:0.7.0
-
docker run -p 8080:8080 ivorytoast3853/titan-amg:0.7.0
-
docker-compose -f docker-compose.yml up --build -d
-
docker-compose down
A backend service which emulates the game Stratego. All through REST endpoints, one can perform the following:
- Create a new game session
- Join an existing game session
- Spectate an existing game session
- Move pieces that belong to you
- Java Client
- NodeJS Client
- Pub/Sub mechanism which sends out all board updates which the session id as the topic
- Replay existing games
- Have UI cover piece values which do not belong to the user
- Update serialized board string to include when a flag was captured
It is currently running on a Digital Ocean Droplet which is connected to a Digital Ocean managed PostgreSQL database and (in the future) be connected to a Digital Ocean managed Redis cluster. Right now, Redis is run through docker-compose.
Therefore, you can experiment with the game. See what changes you would like to have implemented and go make those changes.
- Java
- Spring
- Docker
- Redis
- ZeroMQ
- PostgreSQL
- /game/v1/board/{id}
- /game/v1/players/{id}
- /game/v1/new
- /game/v1/move
- /game/v1/update
- /game/v1/join
- Has 1 Droplet (Titan)
- Has 1 Managed Database Cluster
- Has 1 Google Domain (titan-backend-nyc.com)
- Firewall Setup:
- SSH on Port 22 only allowed from my IP and titan itself. This was necessary because it is exposed to the internet there were thousands of login attempts per minute on the droplet from global IP addresses
- TCP (Port 81) from my IP address. This is to allow myself to manage the Nginx Proxy Manager application
- TCP (Port 443 -> HTTPS) for all IPv4 and IPv6 addresses to allow any user to interact with the Vercel front end UI
- All requests are proxied through an Nginx proxy to allow a client to hit a HTTPS endpoint even though Titan runs on HTTP