Get Started in 5 Minutes
This quickstart guide will walk you through creating your first Blackjack game, playing moves, and checking the results. By the end, you’ll have a complete understanding of the game flow.Before you begin, make sure you have the API running. See the Installation guide if you haven’t set it up yet.
Step 1: Start the API
If you’re using Docker Compose (recommended):http://localhost:8080.
Verify it’s running by accessing the Swagger UI:
Step 2: Create a New Game
Create your first Blackjack game by sending a POST request to/game/new:
Save the
gameId - you’ll need it for all subsequent requests. The playerId is also created if this is your first game.Step 3: Check Your Initial Hand
Retrieve the game state to see your cards and the dealer’s visible card:During active gameplay (
IN_PROGRESS), only one of the dealer’s cards is visible. The dealer’s second card and full score remain hidden until the game ends.Step 4: Play Your Move
Based on your hand, decide whether to HIT (draw another card) or STAND (end your turn).Option A: HIT (Draw Another Card)
IN_PROGRESS.
Option B: STAND (End Your Turn)
When you’re satisfied with your hand, STAND to let the dealer play:- The dealer reveals their hidden card
- The dealer automatically plays (hits until 17 or higher)
- The game determines the winner
Step 5: Check the Rankings
View the leaderboard to see all player rankings:Game Outcomes
After the game ends, the status will be one of:| Status | Description |
|---|---|
PLAYER_WINS | Your score is higher than the dealer’s without busting |
DEALER_WINS | The dealer’s score is higher, or you busted |
PUSH | Both you and the dealer have the same score (tie) |
BLACKJACK_PLAYER | You got 21 with exactly 2 cards (natural blackjack) |
BLACKJACK_DEALER | The dealer got 21 with exactly 2 cards |
Next Steps
Now that you’ve played your first game, explore more features:Game Operations
Learn about all game operations and advanced gameplay
API Reference
Explore all available endpoints and data models
Architecture
Understand the hexagonal architecture and reactive patterns
Deploy to Production
Deploy your own instance using Docker
Troubleshooting
Connection refused error
Connection refused error
Make sure the API is running:Check the logs:
Game not found (404)
Game not found (404)
Verify you’re using the correct
gameId from the create game response. Game IDs are case-sensitive.Invalid move (409)
Invalid move (409)
This error occurs when you try to play a move on a game that has already ended. Create a new game to continue playing.
Validation error (400)
Validation error (400)
Check your request body:
- Player name must not be blank and max 30 characters
- Action must be either “HIT” or “STAND” (case-sensitive)
For interactive API exploration, use the Swagger UI at
http://localhost:8080/swagger-ui.html where you can test all endpoints directly in your browser.