An online chess platform
Final Course Project UniCT 2022
Advanced Programming Languages
Distributed Systems and Big Data
- Backend written in Go using Gin web framework and Gorilla websockets. This monolithic component has been splitted in the following microservices:
- User Service handles user signup, login and authentication. It also generates JWT Tokens for authorization in other microservices.
- WebSocket Node handles WebSocket connections with clients.
- Dispatcher routes messages from WS Nodes to Game and Challenge Services.
- Challenge Service handles challenge sending and accepting.
- Game Service handles games status, timer, legal moves, etc.
- Frontend written in C# using .NET Blazor WebAssembly
- Engine written in C++ using Pistache HTTP server. Bitboards were adopted for board representation while search logic was inspired by carnatus and sunfish.
-
Monolithic Backend Version
docker-compose -f docker/docker-compose.yml up
-
Microservices w/ Kafka Version
docker-compose -f docker/docker-compose.kafka.yml up
You can try the application at https://localhost/.
Start minikube and install addons
minikube start
minikube addons enable ingress
minikube addons enable metrics-server
Build docker images
eval $(minikube -p minikube docker-env)
docker build -t chess_frontend ./frontend
docker build -t chess_user ./user
docker build -t chess_wsnode ./wsnode
docker build -t chess_game ./game
docker build -t chess_engine ./engine
docker build -t chess_challenge ./challenge
docker build -t chess_dispatcher ./dispatcher
docker build -t chess_forecaster ./forecaster
docker build -t chess_loadgenerator ./load_generator
Add Prometheus, requires Helm
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm install prometheus prometheus-community/kube-prometheus-stack --set "grafana.plugins={grafana-simple-json-datasource,grafana-piechart-panel}"
Add Strimzi
kubectl apply -f 'https://strimzi.io/install/latest?namespace=default' -n default
Deploy
kubectl apply -f k8s
(Optional) Disable the load generator
kubectl delete -f k8s/60-deployment-loadgenerator.yaml
Append entries in /etc/hosts
echo "$(minikube ip) chess.example grafana.chess.example prometheus.chess.example" | sudo tee -a /etc/hosts
You can try the application at https://chess.example/.
The Grafana dashboard will be available at https://grafana.chess.example/d/Iahds4b7k.