Table of Contents
Development Environment Setup
This guide will help you set up your development environment for the Casino Gaming Platform.
Prerequisites
Before you begin, make sure you have the following tools installed:
-
Docker & Docker Compose
- Docker installation guide
- Docker Compose is included with Docker Desktop for Windows and Mac
-
Java Development Kit (JDK) 17+
- AdoptOpenJDK or Oracle JDK
- Verify installation with:
java -version
-
Node.js 18+
- Node.js download
- Verify installation with:
node --version
-
Bun (Alternative to npm for faster package management)
- Bun installation
- Verify installation with:
bun --version
- Required for the frontend build and package management
-
IDE/Code Editor
- Backend: IntelliJ IDEA (recommended) or Eclipse
- Frontend: Visual Studio Code (recommended)
Setting Up the Backend
-
Clone the repository
git clone <repository-url> cd casino
-
Import the project into your IDE
- For IntelliJ IDEA:
- Go to File > Open
- Navigate to the
backend
directory and click Open - Wait for the Gradle import to complete
- For IntelliJ IDEA:
-
Configure IntelliJ Database View (Optional)
- Start Docker services (see Infrastructure Setup below)
- Open
application.properties
in the resources folder - Copy the database URL
- Open the Database tab in IntelliJ
- Click on the database icon with key in the Database toolbar
- Click the plus sign and select "Datasource from URL"
- Paste the DB URL and select PostgreSQL driver
- Enter username
postgres_user
and passwordpostgres_pass
- In the Schemas tab, uncheck all options and only check
postgresdb
andpublic
Setting Up the Frontend
-
Navigate to the frontend directory
cd frontend
-
Install dependencies
bun install
or
npm install
-
Configure your IDE/Editor (for VS Code)
- Install recommended extensions:
- Angular Language Service
- ESLint
- Prettier
- Tailwind CSS IntelliSense
- Install recommended extensions:
-
Import project settings
- VS Code workspace settings are included in the repository
Setting Up Infrastructure
-
Start Docker services
cd docker docker-compose up -d
This will start:
- PostgreSQL database (port 5432)
- PostgreSQL for Keycloak (port 9433)
- Keycloak authentication server (port 9090)
-
Verify services are running
docker-compose ps
All services should show as "running"
-
Access Keycloak Admin Console
- Open http://localhost:9090 in your browser
- Login with username
admin
and passwordadmin
- Verify the
lf12-realm
is imported
Configuring IDE for Java Development
IntelliJ IDEA Setup
-
Install Checkstyle Plugin
- Go to Settings > Plugins
- Search for "Checkstyle-IDEA"
- Install and restart IntelliJ
-
Configure Checkstyle
- Go to Settings > Tools > Checkstyle
- Set Checkstyle version to 8.42
- Add a new configuration file
- Select the
checkstyle.xml
from theconfig/checkstyle
directory - Name it "Casino Checkstyle"
- Set it as active
-
Configure Code Style
- Go to Settings > Editor > Code Style
- Import scheme from
config/codestyles/Casino.xml
(if available)
Running the Components
Backend
-
From the IDE
- Find the
CasinoApplication.java
file - Right-click and select "Run CasinoApplication"
- Find the
-
From the command line
cd backend ./gradlew bootRun
-
Verify the backend is running
- Open http://localhost:8080/swagger in your browser
- You should see the Swagger UI with available API endpoints
Frontend
-
Start the development server
cd frontend bun run start
or
bunx @angular/cli serve --proxy-config src/proxy.conf.json
-
Verify the frontend is running
- Open http://localhost:4200 in your browser
- You should see the landing page of the Casino Gaming Platform
Troubleshooting
PostgreSQL Issues
If you encounter PostgreSQL connection issues:
- Reset the database
cd docker docker-compose down docker volume rm local_lf8_starter_postgres_data docker-compose up -d
Keycloak Issues
If you have problems with Keycloak:
-
Reset Keycloak
cd docker docker-compose down docker volume rm casino_keycloak_data docker-compose up -d
-
Manual Realm Import
- Open http://localhost:9090/admin
- Create a new realm named "lf12-realm"
- Import the realm configuration from
docker/imports/lf12-realm.json
Frontend Build Issues
If you encounter build or dependency issues:
-
Clear node_modules and reinstall
cd frontend rm -rf node_modules bun install
-
Clear Angular cache
rm -rf .angular
Getting Help
If you encounter any issues not covered in this guide:
- Check the project's GitHub Issues
- Consult the documentation
- Reach out to the development team