This repository has been archived on 2025-06-18. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
casino/backend
Renovate Bot eee1d7376e
All checks were successful
CI / Get Changed Files (pull_request) Successful in 8s
CI / eslint (pull_request) Has been skipped
Pull Request Labeler / labeler (pull_request_target) Successful in 5s
CI / oxlint (pull_request) Has been skipped
CI / prettier (pull_request) Has been skipped
CI / test-build (pull_request) Has been skipped
Label PRs based on size / Check PR size (pull_request) Successful in 13s
Claude PR Review / claude-code (pull_request) Successful in 22s
CI / Docker frontend validation (pull_request) Has been skipped
CI / Playwright (pull_request) Has been skipped
CI / Checkstyle Main (pull_request) Successful in 2m5s
CI / Backend Tests (pull_request) Successful in 4m14s
CI / Docker backend validation (pull_request) Successful in 4m19s
chore(deps): update dependency gradle to v8.14.2
2025-06-06 12:03:08 +00:00
..
.docker feat(ci): add deployment workflow and update Dockerfile 2025-04-23 14:29:36 +02:00
config/checkstyle style(checkstyle): remove unused SuppressionFilter module 2025-02-13 12:18:13 +01:00
gradle/wrapper chore(deps): update dependency gradle to v8.14.2 2025-06-06 12:03:08 +00:00
src Merge pull request 'chore: Add some tests' (!283) from playwright into main 2025-06-06 11:59:11 +00:00
.dockerignore chore(deployment): add deployment for backend 2025-02-12 11:13:24 +01:00
.gitignore first 2024-09-11 10:40:00 +02:00
build.gradle.kts chore: Add some tests 2025-06-05 13:16:53 +02:00
gradlew chore(deps): update dependency gradle to v8.14 2025-04-25 18:19:18 +00:00
gradlew.bat chore(deps): update dependency gradle to v8.14 2025-04-25 18:19:18 +00:00
Readme.md chore: Update some README's 2025-06-04 09:53:29 +02:00
settings.gradle.kts chore(setup): setup java backend 2025-02-05 09:53:26 +00:00

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

  1. Start the PostgreSQL Docker container
  2. Open application.properties and copy the database URL
  3. In IntelliJ, open the Database tab (right panel)
  4. Click the database icon with key in the toolbar
  5. Click the plus (+) icon
  6. Select "Datasource from URL"
  7. Paste the database URL and select PostgreSQL driver
  8. Enter credentials (username: lf8_starter, password: secret)
  9. In Schemas tab, uncheck all except lf8_starter_db and public
  10. 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:

  1. Open GetBearerToken.http at project root
  2. Execute the request
  3. Copy the access_token from the response
  4. Use in Authorization header: Bearer <token>

Configuration

Key configuration files:

  • application.properties - Main application configuration
  • SecurityConfig.java - Security and CORS settings
  • OpenAPIConfiguration.java - API documentation setup