Welcome to Blackjack API
Blackjack API is a production-ready reactive REST API that implements a complete Blackjack card game. Built with Spring Boot WebFlux, it demonstrates advanced architectural patterns including Hexagonal Architecture and Domain-Driven Design while leveraging dual-database persistence with MongoDB and MySQL.Quickstart
Get up and running with your first game in under 5 minutes
API Reference
Explore all available endpoints and data models
Architecture
Learn about the hexagonal architecture and DDD principles
Deploy with Docker
Deploy the application using Docker and Docker Compose
Key Features
Reactive Programming
Built with Spring WebFlux for non-blocking, reactive request handling with high throughput and scalability
Hexagonal Architecture
Clean separation between domain logic and infrastructure using ports and adapters pattern
Dual Database Persistence
MongoDB for game state management and MySQL for player statistics and rankings
Domain-Driven Design
Rich domain models with encapsulated business logic and clear aggregate boundaries
Complete Game Logic
Full Blackjack implementation with HIT, STAND, bust detection, and blackjack scoring
Player Rankings
Persistent player statistics tracking wins, losses, and competitive rankings
OpenAPI Documentation
Interactive Swagger UI for exploring and testing API endpoints
Production Ready
Comprehensive test coverage, Docker support, and cloud deployment configuration
Quick Example
Create a new game and play your first move:Technology Stack
- Java 21 - Modern Java with latest language features
- Spring Boot 3.5 - Enterprise-grade application framework
- Spring WebFlux - Reactive web framework for non-blocking I/O
- MongoDB - Document database for game state persistence
- MySQL with R2DBC - Reactive relational database for player data
- Flyway - Database migration management
- OpenAPI 3 - API documentation and specification
- Docker - Containerization for deployment
What You’ll Learn
This documentation will guide you through:- Getting Started - Installation, configuration, and running your first game
- Architecture - Understanding hexagonal architecture, DDD, and reactive patterns
- Game Operations - Creating games, playing moves, and managing game state
- Player Management - Handling player data and viewing rankings
- Database Configuration - Setting up MongoDB and MySQL persistence layers
- Deployment - Deploying with Docker, Docker Compose, and cloud platforms
- API Reference - Complete endpoint documentation with request/response schemas
This project serves as both a functional Blackjack game API and a reference implementation for reactive Spring Boot applications using hexagonal architecture.
Ready to Start?
Jump into the Quickstart
Follow our step-by-step guide to create and play your first Blackjack game