Baccaratio is a comprehensive web application that combines a backend built with Spring Boot 3.2.4 and a front-end developed using Angular 20.2.1. The primary purpose of Baccaratio is to provide a simulated environment for the popular casino game Baccarat, allowing players to place bets, participate in rounds, and monitor their chip balances. The backend is RESTful, ensuring seamless integration with various front-end applications.
- Java JDK 11 or later (the backend was written in Java 17)
- Maven 3.9.6.
- Angular 20.2.1 (upgrade from 17.3.1)
- Clone the repository.
- Navigate to the project directory.
To build the project, execute the following Maven command:
mvn clean install- Run the application using Maven:
mvn spring-boot:runThe service will start and be available at http://localhost:8080.
Ensure JDK 17 and Maven are installed and properly configured in your development environment.
Before setting up the Angular frontend for Baccaratio, ensure you have the following prerequisites installed on your system:
- Node.js (version 14.x or later)
- npm (Node Package Manager, typically installed with Node.js)
Follow these steps to set up and run the Angular frontend for Baccaratio:
-
Clone the Repository:
git clone <repository-url>Replace
<repository-url>with the URL of the Baccaratio repository. -
Navigate to the Frontend Directory:
cd <repository-directory>/frontendReplace
<repository-directory>with the directory where you cloned the repository. -
Install Dependencies:
npm installThis command will install all the necessary dependencies for the Angular frontend.
-
Run the Application:
npm startThis command compiles the application and starts a development server. After successful compilation, the frontend will be available at
http://localhost:4200. -
Access the Application: Open your web browser and navigate to
http://localhost:4200to access the Baccaratio frontend.
- The Angular frontend provides a modern and responsive user interface for the Baccaratio application.
- For further customization or development, refer to the Angular documentation and guides.
- Ensure that the backend server is running locally or is accessible via the specified URL (
http://localhost:8080by default) to enable full functionality of the Baccaratio application.
By following these installation instructions, you can set up and run the Angular frontend for Baccaratio on your local development environment.
All URLs referenced in the documentation have the base path /baccarat.
The API supports cross-origin requests from http://localhost:4200.
- Endpoint:
/baccarat/bet/{type}/{amount} - Method:
POST - URL Params:
type=[string](Options: "player", "banker", "tie")amount=[integer](The amount of chips to bet)
- Success Response:
- Code: 200
- Content:
"Bet placed on: {type} with amount: {amount}"
- Error Response:
- Code: 400 BAD REQUEST
- Content:
"Invalid bet type."or"Insufficient chips."
- Endpoint:
/baccarat/play - Method:
GET - Success Response:
- Code: 200
- Content:
"Round result: {result}. Your bet was: {betType}. Remaining chips: {chips}."
- Notes:
- Initiates a round of Baccarat based on the current bet.
- Endpoint:
/baccarat/result - Method:
GET - Success Response:
- Code: 200
- Content:
"Last result: {lastResult}. Your bet was: {betType}. Remaining chips: {chips}."
In the game of Baccarat, players engage in the following gameplay mechanics:
-
Betting Options:
- Players can place bets on three outcomes: "player," "banker," or a "tie." Additionally, special betting options may be available for more diverse gameplay.
-
Card Dealing:
- After players place their bets, the virtual "croupier" initiates the card dealing process.
- Cards are dealt to both the player and the banker according to standard Baccarat rules.
-
Outcome Determination:
- The outcome of the game is determined by comparing the total points of the player's and banker's hands.
- The goal is to achieve a total as close to 9 as possible without exceeding it.
-
Result Display:
- After the cards are dealt, the winning outcome is displayed to the player through an alert within a 5-second window.
-
Payouts:
- Winning bets are collected at the end of the round and added to the player's chip count.
- The amount won depends on the type of bet placed and the corresponding payout ratio.
By following these gameplay mechanics, players can enjoy the excitement and anticipation of Baccarat as they strategize their bets and await the outcome of each round.
Players start with an initial chip count. Bets are deducted at the start of a round, and winnings are added to the player's chip count at the end of the round, according to the outcome and type of bet placed. The maximum bet that one can bet is 100 dollars.
Baccarat is a popular card game played at casinos worldwide. The game is simple to learn and offers exciting betting opportunities. Here are the basic rules of Baccarat:
-
Objective: The objective of Baccarat is to bet on the hand that will have a total value closest to 9.
-
Card Values:
- Aces count as 1 point.
- Cards 2 through 9 retain their face value.
- 10s and face cards (King, Queen, Jack) count as 0 points.
-
Game Setup:
- Baccarat is typically played with 6 to 8 decks of cards.
- Each round begins with players placing their bets on either the "Player," "Banker," or "Tie" outcome.
-
Dealing Cards:
- The dealer deals two cards each to the "Player" and "Banker" hands.
- If either hand has a total value of 8 or 9 from the first two cards (known as a "natural"), no further cards are drawn.
-
Drawing Additional Cards:
- If the total value of either hand is less than 8 or 9, additional cards may be drawn according to specific rules:
- If the Player's total is 5 or less, the Player draws another card. Otherwise, the Player stands.
- If the Player stands, the Banker draws a card if their total is 5 or less.
- If the Banker's total is 2 or less, they always draw a card.
- If the Banker's total is 3, they draw a third card unless the Player's third card is an 8.
- If the Banker's total is 4, they draw a third card unless the Player's third card is a 0, 1, 8, or 9.
- If the Banker's total is 5, they draw a third card if the Player's third card is a 4, 5, 6, or 7.
- If the Banker's total is 6, they draw a third card if the Player's third card is a 6 or 7.
- If the total value of either hand is less than 8 or 9, additional cards may be drawn according to specific rules:
-
Determining the Winner:
- The hand with a total value closest to 9 wins.
- If both hands have the same total, it's a tie.
-
Payouts:
- Bets on the "Player" hand win even money (1:1).
- Bets on the "Banker" hand win even money, but a 5% commission is typically charged on winning bets.
- Bets on a "Tie" typically offer higher payouts (usually 8:1 or 9:1), but it's less common due to the higher house edge.
These are the fundamental rules of Baccarat, providing players with an enjoyable and straightforward gaming experience.
The Baccarat Game API is continuously evolving to meet the growing demands of players and industry standards. The following features are planned for future development:
Enhancing the responsiveness of the API for mobile devices, ensuring optimal user experience across different screen sizes.
Implementation of CI/CD pipelines to automate the testing, building, and deployment processes, ensuring the reliability and efficiency of updates to the API.
Integration of additional security measures such as JWT authentication and request validation to safeguard player information and prevent unauthorized access.
Expansion of the API to support multiplayer functionality, enabling multiple players to participate in the game simultaneously and interact with each other.
Introduction of advanced betting options such as side bets and progressive jackpots to add depth and excitement to the gameplay experience.
This work by Ádám Dr. Porkoláb is licensed under a Creative Commons Attribution 4.0 International License.
Based on a work at https://github.com/APorkolab/.
