Create a reactive Spring Boot API for a Blackjack game.
This API enables multiplayer Blackjack games, bringing the excitement of the casino to your application. Players can:
- Place bets before the croupier deals the cards.
- Interact using classic game actions like hit, stand, double, split, and surrender, following the widely accepted rules of Blackjack.
- Play in a dynamic, real-time environment with other players.
Whether you're simulating a casino or integrating a card game into your platform, this API provides the core mechanics needed to manage and play Blackjack seamlessly.
- Frameworks & Libraries: Spring WebFlux, Swagger, Mockito, JUnit
- Databases: MongoDB, MongoDB Atlas, MySQL
- Tools: Maven, Postman, Docker, Docker Compose
- CI/CD: GitHub Actions
- Docker: Docker Desktop (Windows and macOS) or Docker Engine (Linux).
- Install Docker according to you system features.
To run the project:
- Download the
compose.yamlfile. - Make sure Docker is running in the local machine.
- Open a command prompt window and navigate to the project directory where the
compose.yamlfile is located. - Execute the following command:
docker-compose up --build - Docker will automatically pull the images from docker hub, build them and create and start the containers as specified in the
compose.yamlfile. - The service will be available at
http://localhost:8081. - To stop the running containers press
Ctrl+Cin the terminal were thedocker-composecommand is running or execute the commanddocker-compose down.
Alternatively, you can build the docker image locally instead of pulling it from Docker Hub by following these steps:
- clone the github repository in your local machine running the command
https://github.com/jraporta/Blackjack.git - Build the Docker image locally by executing the command
docker build --tag=jraporta/blackjack:latest . - Start the services as defined in
docker-compose.yamlby executing the commanddocker-compose up --build - Once the containers are up, follow the instructions in the above section to interact with the service.
- Ensure docker is installed and running in your system.
- Pull the image from Docker Hub:
docker pull jraporta/blackjack:latest - Run the docker container:
docker run -e MONGODB_URI="{uri}" -p 8080:8080 jraporta/blackjack:latestReplace {uri} with a valid MongoDB URI to connect to Atlas.
Deployed with Render on https://blackjack-ld1x.onrender.com. Note: When querying for first time, the system might take a couple of minutes to respond due to Render's cold starts.
Personal project.
API documentation is available via Swagger: