RoyalAfg - Online Casino
The released version of this project is found in the release_01 branch
To run individual Services review the build and run guide of your choosing.
For a complete deployment see this.
While this is a project for a special learning achievement, it also serves as a full example of a Kubernetes and microservice oriented application.
A online casino is a perfect example for a microservice architecture, because many services need to communicate with each other, which is the main problem of this pattern.
This project is build with Bazel tools, which create a sandbox to compile the source code. The authentication service would be build using the following output
#Builds the authentication service bazel build //services/auth:auth #Run the authentication service (does not require the previous step) bazel run //services/auth:auth
if you want to specify the configuration used by the service you can set the
--config Flag like this
bazel run //services/auth:auth --config=./pathToYourConfig
Bazel is able to build directly to containers from the source code. This can be done using the
bazel build //services/auth:image --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64
Notice that the
--platform is important to tell Bazel that the go code should be compiled for the Linux runtime, since the Container is run in Linux.
Standard Go Compiler
Apart from the Bazel build tool every service can be build using the standard go tools
#Build authentication service go build ./services/auth/main.go #Run the service go run ./serivces/auth/main.go --config=./pathToConfig
Build the docker image
The Docker file in the root directory can accommodate every go service of the system. To specify a service to be build to an Docker image use the following command
docker build -t royalafg_auth --build-arg service=./services/auth/main.go .
This will create the Docker image with the tag of
docker run royalafg_auth to run the application
I publish each service as a docker container in my docker hub page. This is used by the deployment scripts aswell.
To deploy the application please refer to the DEPLOY.md under /deployments
The following script is not ready yet.
To deploy the application on linux simply run
which should deploy each service configured with default configuration. Keep in mind this also includes encryption keys and other private keys. Only use it for testing purposes
This script has the follwing requirements:
- access to a terminal
- docker installed
- minikube installed. (On Linux the
noneoptions are available to prevent the extra virutal machine)
- kubectl installed (comes with minikube)
- Helm installed
It will fire of a new minikube instance, which will configure kubectl and helm and the deploy the deployments described in
/deployments in the correct order. In addition to that it will add the required helm repositories and install them. This includes Agones .
Following services are integrated into the system:
The authentication service is responsible to generate authentication tokens (jwt) and verify and extend these tokens.
The user service is the governing body on the users data. It uses mongodb to persist this data and has grpc and http endpoint to enable communication.
The bank service creates a bank account for every user. It tracks every transaction and uses a event sourced system to ensure the safety and reliability of the system.
The search service uses elasticsearch to provide search functionality for the front end.
The front end of the casino.
The Matchmaker for the poker game. It is responsible to verify the buy in and to generate tickets to individual gameservers.
The Poker Gameserver provides a websocket connection to the poker game functionality.
A swagger generate documentation page.
This code is licensed under an MIT license. Ⓒ Jonas Schneider
Package classification github.com/JohnnyS318/RoyalAfgInGo API Documentation for github.com/JohnnyS318/RoyalAfgInGo API Schemes:http, https BasePath: / Version: 0.0.1 Host: royalafg.games Contact: email@example.com License: MIT http://opensource.org/license/MIT Consumes: - application/json - application/x-www-form-urlencoded Produces: - application/json Security: - api_key: SecurityDefinitions: api_key: type: apiKey name: identity in: cookie swagger:meta
|Package classification github.com/JohnnyS318/RoyalAfgInGo API Documentation for github.com/JohnnyS318/RoyalAfgInGo API Schemes:http, https BasePath: / Version: 0.0.1 Host: royalafg.games Contact: firstname.lastname@example.org License: MIT http://opensource.org/license/MIT Consumes: - application/json - application/x-www-form-urlencoded Produces: - application/json Security: - api_key: SecurityDefinitions: api_key: type: apiKey name: identity in: cookie swagger:meta|