All checks were successful
CI / Get Changed Files (pull_request) Successful in 10s
Label PRs based on size / Check PR size (pull_request) Successful in 24s
Pull Request Labeler / labeler (pull_request_target) Successful in 10s
CI / oxlint (pull_request) Successful in 40s
CI / prettier (pull_request) Successful in 46s
CI / eslint (pull_request) Successful in 50s
CI / test-build (pull_request) Successful in 1m17s
Claude PR Review / claude-code (pull_request) Successful in 1m29s
CI / Docker frontend validation (pull_request) Successful in 15s
CI / Docker backend validation (pull_request) Successful in 14s
CI / Backend Tests (pull_request) Successful in 2m21s
CI / Checkstyle Main (pull_request) Successful in 1m49s
3.6 KiB
3.6 KiB
Casino Gaming Platform - Backend API
A Spring Boot backend application providing REST APIs for a casino gaming platform with multiple games, user management, authentication, and payment processing.
Features
Games
- Blackjack - Classic card game with deck management
- Coinflip - Simple heads/tails betting game
- Dice - Dice rolling game
- Slots - Slot machine with symbols and payouts
- Lootboxes - Reward system with configurable prizes
User Management
- User registration and authentication
- OAuth2 integration (Google, GitHub)
- Email verification and password reset
- Balance management and transaction history
Payment System
- Deposit functionality with webhook support
- Transaction tracking and status management
- Balance updates and fund validation
Tech Stack
- Java 17 with Spring Boot
- Spring Security with JWT authentication
- Spring Data JPA with PostgreSQL
- OAuth2 for social login
- Email service for notifications
- OpenAPI/Swagger for API documentation
Build & Run
Prerequisites
- Java 17+
- Gradle
- Docker & Docker Compose (for PostgreSQL)
Build Commands
# Build the application
./gradlew build
# Clean build
./gradlew clean build
# Run the application
./gradlew bootRun
# Generate JAR file
./gradlew bootJar
Testing
# Run all tests
./gradlew test
# Run specific test class
./gradlew test --tests "FullyQualifiedClassName"
# Run checkstyle
./gradlew checkstyleMain checkstyleTest
API Endpoints
The application runs on http://localhost:8080
API Documentation
- Swagger UI:
http://localhost:8080/swagger-ui.html
- OpenAPI Spec:
http://localhost:8080/v3/api-docs
Main Endpoints
/api/auth/**
- Authentication and user management/api/games/blackjack/**
- Blackjack game operations/api/games/coinflip/**
- Coinflip game operations/api/games/dice/**
- Dice game operations/api/games/slots/**
- Slot machine operations/api/lootboxes/**
- Lootbox management/api/deposits/**
- Payment and deposit handling/api/users/**
- User profile management/api/health
- Health check endpoint
Database Setup
PostgreSQL with Docker
# Start PostgreSQL container
cd docker/local
docker compose up
# Stop PostgreSQL container
docker compose down
# Reset database (if needed)
docker compose down
docker volume rm local_lf8_starter_postgres_data
docker compose up
Database Configuration
Database connection settings are configured in src/main/resources/application.properties
IntelliJ Database Setup
- Start the PostgreSQL Docker container
- Open
application.properties
and copy the database URL - In IntelliJ, open the Database tab (right panel)
- Click the database icon with key in the toolbar
- Click the plus (+) icon
- Select "Datasource from URL"
- Paste the database URL and select PostgreSQL driver
- Enter credentials (username:
lf8_starter
, password:secret
) - In Schemas tab, uncheck all except
lf8_starter_db
andpublic
- Apply and confirm
Authentication
The application supports multiple authentication methods:
- JWT-based authentication
- OAuth2 (Google, GitHub)
- Email/password with verification
Getting Bearer Token
For API testing, use the provided HTTP client file:
- Open
GetBearerToken.http
at project root - Execute the request
- Copy the
access_token
from the response - Use in Authorization header:
Bearer <token>
Configuration
Key configuration files:
application.properties
- Main application configurationSecurityConfig.java
- Security and CORS settingsOpenAPIConfiguration.java
- API documentation setup