{"id":29440030,"url":"https://github.com/furkanerd1/event-ticket","last_synced_at":"2026-04-14T03:32:43.367Z","repository":{"id":303449719,"uuid":"1003779842","full_name":"furkanerd1/event-ticket","owner":"furkanerd1","description":"Event ticket API","archived":false,"fork":false,"pushed_at":"2025-07-07T17:02:36.000Z","size":85,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-07T18:16:26.333Z","etag":null,"topics":["docker-compose","hibernate","keycloak","mapstruct","postman","spring-boot","spring-security-oauth2","swagger-ui"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/furkanerd1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-17T16:49:58.000Z","updated_at":"2025-07-07T17:02:40.000Z","dependencies_parsed_at":"2025-07-07T18:16:49.951Z","dependency_job_id":"45dd8c65-e590-4d80-a8d3-36c563c4540c","html_url":"https://github.com/furkanerd1/event-ticket","commit_stats":null,"previous_names":["furkanerd1/event-ticket"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/furkanerd1/event-ticket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkanerd1%2Fevent-ticket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkanerd1%2Fevent-ticket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkanerd1%2Fevent-ticket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkanerd1%2Fevent-ticket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/furkanerd1","download_url":"https://codeload.github.com/furkanerd1/event-ticket/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furkanerd1%2Fevent-ticket/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31781292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-compose","hibernate","keycloak","mapstruct","postman","spring-boot","spring-security-oauth2","swagger-ui"],"created_at":"2025-07-13T10:01:57.156Z","updated_at":"2026-04-14T03:32:43.337Z","avatar_url":"https://github.com/furkanerd1.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎫 Event Ticket Platform API\n\nA comprehensive REST API for event management and ticket sales, built with Spring Boot and secured with Keycloak authentication. This platform enables event organizers to create, manage events, and handle ticket sales while providing users with a seamless ticket purchasing experience.\n\n---\n\n## ✨ Features\n\n- **Event Management**: Create, update, delete, and list events with detailed information\n- **Ticket System**: Purchase tickets, validate tickets with QR codes, and track ticket status\n- **Published Events**: Public access to published events for ticket purchasing\n- **Ticket Types**: Multiple ticket types per event with different pricing and availability\n- **Ticket Validation**: QR code and manual validation methods for event entry\n- **User Authentication**: Keycloak-based JWT authentication and authorization\n- **RESTful API**: Clean and intuitive API design following REST principles\n- **Pagination**: Efficient data retrieval with pagination support\n- **API Documentation**: Comprehensive OpenAPI 3.1 documentation with Swagger UI\n\n---\n\n## 🛠️ Tech Stack\n\n### Backend\n- **Java 17+**\n- **Spring Boot 3.x**\n- **Spring Security**\n- **Spring Data JPA**\n- **Spring Web**\n- **Spring Validation**\n\n### Security \u0026 Authentication\n- **Keycloak**: Identity and Access Management\n- **JWT (JSON Web Tokens)**: Stateless authentication\n- **Bearer Token Authentication**: Secure API access\n\n### Database\n- **PostgreSQL**: Production database\n- **JPA/Hibernate**: ORM framework\n\n### Documentation\n- **OpenAPI 3.1**: API specification\n- **Swagger UI**: Interactive API documentation\n\n### Build Tool\n- **Maven**: Dependency management and build automation\n\n---\n\n## 🚀 Installation\n\n### Prerequisites\n- Java 17 or higher\n- Maven 3.8+\n- PostgreSQL 13+\n- Keycloak 18+\n\n### 1. Clone the Repository\n```bash\ngit clone https://github.com/furkanerd1/event-ticket.git\ncd event-ticket\n```\n\n### 2. Database Setup\nThe application uses PostgreSQL with default settings:\n- **Database**: `postgres` (default database)\n- **Username**: `your_username`\n- **Password**: `your_password`\n- **Port**: `5432`\n\nFor local development, you can use the provided Docker Compose setup or install PostgreSQL manually.\n\n### 3. Configure Application Properties\nUpdate `application.yml`:\n```yaml\nserver:\n  port: 8082\n\nspring:\n  datasource:\n    url: jdbc:postgresql://localhost:5432/postgres\n    username: your_username\n    password: your_password\n  jpa:\n    hibernate:\n      ddl-auto: update\n    show-sql: true\n\nkeycloak:\n  auth-server-url: http://localhost:9090\n  realm: event-ticket\n  resource: event-ticket-api\n```\n\n### 4. Setup Keycloak\n1. Keycloak will be available at `http://localhost:9090`\n2. Login with admin credentials (username/password)\n3. Create a new realm: `event-ticket`\n4. Create a client: `event-ticket-api`\n5. Configure client settings and obtain credentials\n\n### 5. Access Services\nAfter running Docker Compose, you can access:\n- **API**: `http://localhost:8082`\n- **Keycloak**: `http://localhost:9090`\n- **Adminer (Database UI)**: `http://localhost:8888`\n- **PostgreSQL**: `localhost:5432`\n\n### 6. Build and Run\n```bash\nmvn clean install\nmvn spring-boot:run\n```\n\nThe application will start on `http://localhost:8082`\n\n---\n\n## 🐳 Docker Usage\n\n### Using Docker Compose\n```bash\n# Clone the repository\ngit clone https://github.com/furkanerd1/event-ticket.git\ncd event-ticket\n\n# Start all services\ndocker-compose up -d\n```\n\n\n### Docker Compose Services\n```yaml\nservices:\n  app:\n    build: .\n    ports:\n      - \"8082:8082\"\n    depends_on:\n      - db\n      - keycloak\n    environment:\n      - SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/postgres\n      - SPRING_DATASOURCE_USERNAME=your_username\n      - SPRING_DATASOURCE_PASSWORD=your_password\n      - KEYCLOAK_AUTH_SERVER_URL=http://keycloak:8080\n    restart: always\n\n  db:\n    image: postgres:latest\n    ports:\n      - \"5432:5432\"\n    restart: always\n    environment:\n      POSTGRES_PASSWORD: your_password\n\n  adminer:\n    image: adminer:latest\n    restart: always\n    ports:\n      - 8888:8080\n\n  keycloak:\n    image: quay.io/keycloak/keycloak:latest\n    ports:\n      - \"9090:8080\"\n    environment:\n      KEYCLOAK_ADMIN: admin\n      KEYCLOAK_ADMIN_PASSWORD: admin\n      KC_HOSTNAME: localhost\n      KC_HOSTNAME_STRICT: false\n      KC_HOSTNAME_PORT: 9090\n    volumes:\n      - keycloak-data:/opt/keycloak/data\n    command: \u003e\n      start-dev --db=dev-file\n\nvolumes:\n  keycloak-data:\n    driver: local\n```\n\n---\n\n## 🔌 API Endpoints Summary\n\n### Authentication\nAll endpoints require JWT Bearer token authentication except for published events listing.\n\n###  Events Management\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| GET | `/api/v1/events` | List all events (paginated) |\n| POST | `/api/v1/events` | Create a new event |\n| GET | `/api/v1/events/{eventId}` | Get event details |\n| PUT | `/api/v1/events/{eventId}` | Update event |\n| DELETE | `/api/v1/events/{eventId}` | Delete event |\n\n###  Published Events (Public Access)\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| GET | `/api/v1/published-events` | List published events with search |\n| GET | `/api/v1/published-events/{eventId}` | Get published event details |\n\n### Ticket Operations\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| GET | `/api/v1/tickets` | List user's tickets (paginated) |\n| GET | `/api/v1/tickets/{ticketId}` | Get ticket details |\n| POST | `/api/v1/events/{eventId}/ticket-types/{ticketTypeId}/tickets` | Purchase ticket |\n| GET | `/api/v1/tickets/{ticketId}/qr-codes` | Get ticket QR code |\n\n###  Ticket Validation\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| POST | `/api/v1/ticket-validations` | Validate ticket (QR scan or manual) |\n\n\n## 📮 Postman Collection\n\nImport the Postman collection to test all API endpoints:\n\n1. Download the collection: [Event Ticket API.postman_collection.json](postman/event-ticket.postman_collection.json)\n)\n2. Import into Postman\n3. Set up environment variables:\n   - `baseUrl`: `http://localhost:8082`\n   - `bearerToken`: Your JWT token from Keycloak\n\n---\n\n## 📚 API Documentation\n\nAccess the interactive API documentation:\n- **Swagger UI**: `http://localhost:8082/swagger-ui/index.html`\n- **OpenAPI Spec**: `http://localhost:8082/v3/api-docs`\n\n---\n\n## 🔄 Status Flows\n\n### Event Status Flow\n- **DRAFT**: Event is being created/edited\n- **PUBLISHED**: Event is live and tickets can be purchased\n- **CANCELLED**: Event has been cancelled\n- **COMPLETED**: Event has finished\n\n### Ticket Status Flow\n- **PURCHASED**: Ticket successfully purchased\n- **CANCELLED**: Ticket has been cancelled/refunded\n\n### QrCode Status Flow\n- **ACTİVE**: Qr Code is active\n- **EXPIRED**: Qr Code is expired\n\n### Ticket Validation Method Status Flow\n- **QR_SCAN**:  Ticket validation with QR Code scan\n- **MANUAL**: Ticket validation with manual (id)\n\n### Ticket Validation Status Flow\n- **VALID**: Ticket exists in the system  \n- **INVALID**: Ticket ID not found in the system  \n- **EXPIRED**: Valid ticket exists but:  \n  - Event has already ended  \n  - Ticket's validity period has passed  \n  - Sales end date/time has elapsed  \n\n---\n\n## 🏗️ UML Diagram\n\n![UMLDiagram](https://github.com/user-attachments/assets/df0e3510-2ad2-44e1-89f2-4cbe48de5be3)\n\n## SWAGGER UI\n![swaggerui](https://github.com/user-attachments/assets/24d433ef-6266-4ce7-b842-84c9f45739a3)\n\n\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffurkanerd1%2Fevent-ticket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffurkanerd1%2Fevent-ticket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffurkanerd1%2Fevent-ticket/lists"}