A multiplayer implementation of Caro's AKQ game in Golang and React; WebSocket, gorilla/socket, REST api. Try it out here!
This game was implemented as a tool during a talk at MathILy 2020. The talk was analyzing the strategies behind this game, and it provides a high-level overview of the mathematics behind poker and its variants. The game was originally introduced to me by Brian in MIT Poker club's new member education program. Some of the analysis can be found here.
The frontend of the game was written in React with most of the styling done with semantic ui. The game includes the following features:
- Create game and join game button on splash
- Help button on top right of page containing rules
- Live score keeping / chip counts
- Intuitive UI + Buttons
This app implements Mike Caro's AKQ game. The app is deployed at https://akq.allenwang314.com/. There, you can create a game room and share the room's code with an opponent anywhere in the world to play against. Everything is done in real time with the help of WebSockets and gorilla/websocket. The backend has a rest api that helps it keep track of rooms and clients. It has a single database to keep track of the updates received via the api. On the frontend, I use axios to make the api calls and WebSocket to establish a connection.
Originally, the app was designed to be sployed in two separate applications. However, later I started serving the frontend pages through the go server. This behavior
can be found on the go-serve
branch.
The important configs that must be changed for development is in config/base.json. There you should set the database settings. (Don't worry the old settings are expired)
To deploy to Heroku use the branch heroku-deploy
. The steps are as follows:
- Make a Heroku app
- Reset localhost:8000 to the deployment link in src/App.js and src/Room.js.
- Configure the database credentials in config/base.json.
- Run
go build .
and./akq-game -reset
to initialize and reset the database - Run
npm install
followed bynpm run-script build
to create the build folder - Push to heroku to deploy!