Compare commits
No commits in common. "v1.70.8" and "v1.70.7" have entirely different histories.
2 changed files with 51 additions and 217 deletions
|
@ -1,137 +1,59 @@
|
||||||
# Casino Gaming Platform - Backend API
|
# Starter für das LF08 Projekt
|
||||||
|
|
||||||
A Spring Boot backend application providing REST APIs for a casino gaming platform with multiple games, user management, authentication, and payment processing.
|
## Requirements
|
||||||
|
* Docker https://docs.docker.com/get-docker/
|
||||||
|
* Docker compose (bei Windows und Mac schon in Docker enthalten) https://docs.docker.com/compose/install/
|
||||||
|
|
||||||
## Features
|
## Endpunkt
|
||||||
|
```
|
||||||
### Games
|
http://localhost:8080
|
||||||
- **Blackjack** - Classic card game with deck management
|
```
|
||||||
- **Coinflip** - Simple heads/tails betting game
|
## Swagger
|
||||||
- **Dice** - Dice rolling game
|
```
|
||||||
- **Slots** - Slot machine with symbols and payouts
|
http://localhost:8080/swagger
|
||||||
- **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
|
|
||||||
```bash
|
|
||||||
# Build the application
|
|
||||||
./gradlew build
|
|
||||||
|
|
||||||
# Clean build
|
|
||||||
./gradlew clean build
|
|
||||||
|
|
||||||
# Run the application
|
|
||||||
./gradlew bootRun
|
|
||||||
|
|
||||||
# Generate JAR file
|
|
||||||
./gradlew bootJar
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Testing
|
|
||||||
|
# Postgres
|
||||||
|
### Terminal öffnen
|
||||||
|
für alles gilt, im Terminal im Ordner docker/local sein
|
||||||
```bash
|
```bash
|
||||||
# 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
|
|
||||||
```bash
|
|
||||||
# Start PostgreSQL container
|
|
||||||
cd docker/local
|
cd docker/local
|
||||||
|
```
|
||||||
|
### Postgres starten
|
||||||
|
```bash
|
||||||
docker compose up
|
docker compose up
|
||||||
|
```
|
||||||
|
Achtung: Der Docker-Container läuft dauerhaft! Wenn er nicht mehr benötigt wird, sollten Sie ihn stoppen.
|
||||||
|
|
||||||
# Stop PostgreSQL container
|
### Postgres stoppen
|
||||||
|
```bash
|
||||||
docker compose down
|
docker compose down
|
||||||
|
```
|
||||||
|
|
||||||
# Reset database (if needed)
|
### Postgres Datenbank wipen, z.B. bei Problemen
|
||||||
|
```bash
|
||||||
docker compose down
|
docker compose down
|
||||||
docker volume rm local_lf8_starter_postgres_data
|
docker volume rm local_lf8_starter_postgres_data
|
||||||
docker compose up
|
docker compose up
|
||||||
```
|
```
|
||||||
|
|
||||||
### Database Configuration
|
### Intellij-Ansicht für Postgres Datenbank einrichten
|
||||||
Database connection settings are configured in `src/main/resources/application.properties`
|
```bash
|
||||||
|
1. Lasse den Docker-Container mit der PostgreSQL-Datenbank laufen
|
||||||
|
2. im Ordner resources die Datei application.properties öffnen und die URL der Datenbank kopieren
|
||||||
|
3. rechts im Fenster den Reiter Database öffnen
|
||||||
|
4. In der Database-Symbolleiste auf das Datenbanksymbol mit dem Schlüssel klicken
|
||||||
|
5. auf das Pluszeichen klicken
|
||||||
|
6. Datasource from URL auswählen
|
||||||
|
7. URL der DB einfügen und PostgreSQL-Treiber auswählen, mit OK bestätigen
|
||||||
|
8. Username lf8_starter und Passwort secret eintragen (siehe application.properties), mit Apply bestätigen
|
||||||
|
9. im Reiter Schemas alle Häkchen entfernen und lediglich vor lf8_starter_db und public Häkchen setzen
|
||||||
|
10. mit Apply und ok bestätigen
|
||||||
|
```
|
||||||
|
# Keycloak
|
||||||
|
|
||||||
### IntelliJ Database Setup
|
### Keycloak Token
|
||||||
1. Start the PostgreSQL Docker container
|
1. Auf der Projektebene [GetBearerToken.http](../GetBearerToken.http) öffnen.
|
||||||
2. Open `application.properties` and copy the database URL
|
2. Neben der Request auf den grünen Pfeil drücken
|
||||||
3. In IntelliJ, open the Database tab (right panel)
|
3. Aus dem Reponse das access_token kopieren
|
||||||
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
|
|
|
@ -1,106 +1,18 @@
|
||||||
# Casino Gaming Platform - Frontend
|
# Casino Gaming Platform - Frontend
|
||||||
|
|
||||||
A modern Angular 20 casino gaming platform featuring multiple games including Blackjack, Coinflip, Dice, Slots, and Lootboxes. Built with Angular 20, TailwindCSS 4, and powered by Bun for fast development.
|
This is the frontend application for the Casino Gaming Platform. It's built with Angular 18 and TailwindCSS, providing a responsive and modern UI for the casino gaming experience.
|
||||||
|
|
||||||
## 🎮 Features
|
## Development
|
||||||
|
|
||||||
- **Multiple Games**: Blackjack, Coinflip, Dice, Slots, Lootboxes
|
### Commands
|
||||||
- **User Authentication**: OAuth2, email verification, password recovery
|
|
||||||
- **Real-time Gaming**: Interactive game mechanics with animations
|
|
||||||
- **Payment Integration**: Stripe integration for deposits
|
|
||||||
- **Responsive Design**: Mobile-first design with TailwindCSS
|
|
||||||
- **Audio Experience**: Game sounds and audio feedback
|
|
||||||
- **Transaction History**: Complete betting and transaction tracking
|
|
||||||
|
|
||||||
## 🚀 Getting Started
|
- **Build**: `bun run build` or `bunx @angular/cli build`
|
||||||
|
- **Start Dev Server**: `bun run start` or `bunx @angular/cli serve --proxy-config src/proxy.conf.json`
|
||||||
### Prerequisites
|
- **Format Code**: `bun run format` or `prettier --write "src/**/*.{ts,html,css,scss}"`
|
||||||
|
- **Lint**: `bun run lint` or `ng lint`
|
||||||
- [Bun](https://bun.sh/) (recommended) or Node.js 18+
|
- **Test**: `bun run test` or `bunx @angular/cli test`
|
||||||
- Angular CLI 20+
|
|
||||||
|
|
||||||
### Installation
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Install dependencies
|
|
||||||
bun install
|
|
||||||
|
|
||||||
# Start development server
|
|
||||||
bun run start
|
|
||||||
```
|
|
||||||
|
|
||||||
The app will be available at `http://localhost:4200`
|
|
||||||
|
|
||||||
## 📋 Commands
|
|
||||||
|
|
||||||
### Development
|
|
||||||
- **Start Dev Server**: `bun run start` - Starts dev server with proxy configuration
|
|
||||||
- **Build**: `bun run build` - Production build
|
|
||||||
- **Watch Build**: `bun run watch` - Development build with file watching
|
|
||||||
|
|
||||||
### Code Quality
|
|
||||||
- **Format**: `bun run format` - Format code with Prettier
|
|
||||||
- **Format Check**: `bun run format:check` - Check code formatting
|
|
||||||
- **Lint**: `bun run lint` - Run ESLint
|
|
||||||
- **OxLint**: `bun run oxlint` - Run OxLint with strict warnings
|
|
||||||
|
|
||||||
### Testing
|
|
||||||
- **Test All**: `bun run test` - Run all tests with Karma/Jasmine
|
|
||||||
- **Test Single File**: `bunx @angular/cli test --include=path/to/test.spec.ts`
|
- **Test Single File**: `bunx @angular/cli test --include=path/to/test.spec.ts`
|
||||||
|
|
||||||
## 🛠️ Technology Stack
|
|
||||||
|
|
||||||
### Core
|
|
||||||
- **Angular 20**: Latest Angular framework with standalone components
|
|
||||||
- **TypeScript 5.8**: Strongly typed JavaScript
|
|
||||||
- **RxJS 7.8**: Reactive programming for HTTP and state management
|
|
||||||
|
|
||||||
### Styling & UI
|
|
||||||
- **TailwindCSS 4**: Utility-first CSS framework
|
|
||||||
- **PostCSS**: CSS processing and optimization
|
|
||||||
- **FontAwesome**: Icon library with Angular integration
|
|
||||||
|
|
||||||
### Animation & Interaction
|
|
||||||
- **GSAP**: High-performance animations
|
|
||||||
- **CountUp.js**: Number animation effects
|
|
||||||
- **Custom Audio Service**: Game sound effects and feedback
|
|
||||||
|
|
||||||
### Development Tools
|
|
||||||
- **Bun**: Fast JavaScript runtime and package manager
|
|
||||||
- **ESLint + Angular ESLint**: Code linting with Angular-specific rules
|
|
||||||
- **OxLint**: Fast Rust-based linter
|
|
||||||
- **Prettier**: Code formatting
|
|
||||||
- **Karma + Jasmine**: Testing framework
|
|
||||||
|
|
||||||
### Payment & APIs
|
|
||||||
- **Stripe**: Payment processing integration
|
|
||||||
- **Custom HTTP Interceptors**: API communication and error handling
|
|
||||||
|
|
||||||
## 🏗️ Architecture
|
|
||||||
|
|
||||||
### Project Structure
|
|
||||||
```
|
|
||||||
src/
|
|
||||||
├── app/
|
|
||||||
│ ├── feature/ # Feature modules
|
|
||||||
│ │ ├── auth/ # Authentication (login, register, OAuth2)
|
|
||||||
│ │ ├── game/ # Game modules (blackjack, coinflip, dice, slots)
|
|
||||||
│ │ ├── lootboxes/ # Lootbox system
|
|
||||||
│ │ └── deposit/ # Payment and deposits
|
|
||||||
│ ├── model/ # Data models and interfaces
|
|
||||||
│ ├── service/ # Core services (auth, user, transaction)
|
|
||||||
│ └── shared/ # Shared components, directives, services
|
|
||||||
├── environments/ # Environment configurations
|
|
||||||
└── public/ # Static assets (images, sounds)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Key Components
|
|
||||||
- **Game Components**: Modular game implementations with services
|
|
||||||
- **Shared Components**: Reusable UI components (navbar, footer, modals)
|
|
||||||
- **Services**: Business logic and API communication
|
|
||||||
- **Guards**: Route protection and authentication
|
|
||||||
- **Interceptors**: HTTP request/response handling
|
|
||||||
|
|
||||||
## Style Guide
|
## Style Guide
|
||||||
|
|
||||||
### Color Palette
|
### Color Palette
|
||||||
|
|
Reference in a new issue