This microservice handles event seating management for the Ticketly platform.
- Java 21
- Maven
- Docker and Docker Compose
-
Start the required services (PostgreSQL and LocalStack) using Docker Compose:
docker-compose up -d
-
After the first run, initialize the S3 bucket in LocalStack:
aws --endpoint-url=http://localhost:4566 s3 mb s3://ticketly-dev-uploads
-
Run the application with the dev profile:
./mvnw spring-boot:run -Dspring-boot.run.profiles=dev
The project uses Flyway for database migrations:
-
To create a new migration file in IntelliJ:
- Navigate to
src/main/resources/db/migration - Create a new file following the naming convention:
V{version}__{description}.sql - Example:
V3__add_user_preferences.sql
- Navigate to
-
Run migrations manually with Maven:
./mvnw flyway:migrate
-
Migrations run automatically on application startup
The application uses Keycloak for authentication and authorization:
- Default issuer URL: http://localhost:8080/realms/event-ticketing
- JWK Set URI: http://localhost:8080/realms/event-ticketing/protocol/openid-connect/certs
Environment variables can be set in two ways:
- System environment variables
- Using a
.envfile in the project root directory (recommended for development)
-
Copy the
.env.examplefile to create your own.envfile:cp .env.example .env
-
Edit the
.envfile with your specific configuration values:# Example: Configuring database connection DATABASE_URL=jdbc:postgresql://localhost:5432/event_service DATABASE_USERNAME=your_username DATABASE_PASSWORD=your_password -
The application will automatically load these variables on startup
Here are the key environment variables that can be configured:
| Variable | Description | Default Value |
|---|---|---|
| SERVER_PORT | Application port | 8081 |
| JWT_ISSUER_URI | Keycloak issuer URI | https://auth.dpiyumal.me/realms/event-ticketing |
| JWT_JWK_SET_URI | Keycloak JWK set URI | https://auth.dpiyumal.me/realms/event-ticketing/protocol/openid-connect/certs |
| DATABASE_URL | Database URL | jdbc:postgresql://localhost:5432/event_service |
| DATABASE_USERNAME | Database username | ticketly |
| DATABASE_PASSWORD | Database password | ticketly |
| REDIS_HOST | Redis host | localhost |
| REDIS_PORT | Redis port | 6379 |
| KAFKA_BOOTSTRAP_SERVERS | Kafka bootstrap servers | localhost:9092 |
| AWS_REGION | AWS region | ap-south-1 |
| AWS_S3_BUCKET_NAME | AWS S3 bucket name | ticketly-storage |
See .env.example for a complete list of all available environment variables.
The API documentation is available through Swagger UI when the application is running:
- Local development: http://localhost:8081/api/event-seating/swagger-ui.html
- API docs in JSON format: http://localhost:8081/api/event-seating/api-docs
For production, set the appropriate environment variables and use the prod profile:
java -jar ms-event-seating.jar --spring.profiles.active=prod