A full-stack web application for creating, managing, and selling tickets for events, featuring QR code generation and validation for attendees. Built with Spring Boot (Java) for the backend and React (TypeScript) for the frontend, using Keycloak for authentication.
This platform allows event organizers to set up events and define ticket types. Attendees can browse published events, purchase tickets, and view their purchased tickets along with a unique QR code. Staff members can then use a dedicated interface to validate these QR codes for event entry.
- For Organizers:
- Create, Read, Update, Delete (CRUD) events.
- Define multiple ticket types per event (name, price, description, quantity).
- Set event status (Draft, Published).
- Dashboard to view managed events.
- For Attendees:
- Browse and search published events.
- View event details and available ticket types.
- Purchase tickets (requires login).
- View purchased tickets in a personal dashboard.
- View ticket details including a unique QR code.
- For Staff:
- Validate attendee tickets using a QR code scanner or manual ID entry.
- Receive immediate visual feedback (Valid/Invalid).
- QR codes are marked as used after successful validation.
- Authentication: Secure login and role-based access control handled by Keycloak (OAuth 2.0 / OpenID Connect).
- User Provisioning: Users from Keycloak are automatically added to the application database on first login.
- Backend:
- Java 17+
- Spring Boot 3.2+
- Spring Data JPA (Hibernate)
- Spring Security (OAuth2 Resource Server)
- MapStruct
- ZXing (for QR Codes)
- Springdoc OpenAPI (Swagger UI)
- Maven
- Frontend:
- React 19
- TypeScript
- Vite
- Tailwind CSS
- shadcn/ui component library
- react-router
- react-oidc-context (Keycloak integration)
- Lucide Icons
@yudiel/react-qr-scanner
- Database:
- MySQL 8
- Authentication:
- Keycloak
- Development Environment:
- Docker & Docker Compose
- Adminer (DB Management)
- Java JDK (Version specified in
pom.xml, likely 17+) - Maven (
mvnwwrapper included) - Node.js and npm/yarn
- Docker and Docker Compose
-
Clone the Repository:
git clone https://github.com/shivam-616/Event-Ticket-platform.git
-
Start Infrastructure (Database & Keycloak):
docker-compose up -d
Wait a minute for services to initialize.
-
Configure Keycloak:
- Access Keycloak Admin Console:
http://localhost:9090(Login withadmin/admin). - Ensure the realm
event-ticket-platformexists (or create it). - Ensure the client
event-ticket-platformexists within the realm (or create it).- Client ID:
event-ticket-platform - Client Protocol:
openid-connect - Access Type:
public(Client authentication OFF) - Valid redirect URIs:
http://localhost:5173/callback(for frontend app)http://localhost:8080/swagger-ui/oauth2-redirect.html(for Swagger UI)- (Add others as needed)
- Web origins:
http://localhost:5173(for frontend app)http://localhost:8080(for Swagger UI)- (Add others as needed)
- Client ID:
- Enable User Registration: Go to
Realm Settings->Logintab -> ToggleUser registrationON -> Save. - Create Roles: Go to
Realm Roles-> Add roles:ROLE_ORGANISER,ROLE_ATTENDEE,ROLE_STAFF. - Create Users: Go to
Users-> Create test users (e.g.,organizer,attendee,staff). Assign appropriate credentials and map the corresponding Realm Role under theRole Mappingstab for each user.
- Access Keycloak Admin Console:
-
Run Backend (Spring Boot):
- Open the project in your IDE.
- Ensure
src/main/resources/application.propertiespoints tolocalhost:3306for the database andlocalhost:9090for Keycloak. - Run the
TicketsApplication.javamain class. - (Alternatively, run from root directory:
./mvnw spring-boot:run)
-
Run Frontend (React):
- Navigate to the
frontenddirectory:cd frontend - Install dependencies:
npm install(oryarn) - Ensure
src/main.tsxhas the correct Keycloakauthority(http://localhost:9090/...) andclient_id(event-ticket-platform). - Ensure
vite.config.tsproxies/apitohttp://localhost:8080. - Start the development server:
npm run dev(oryarn dev).
- Navigate to the
-
Access Application:
- Frontend:
http://localhost:5173 - Swagger UI (API Docs):
http://localhost:8080/swagger-ui.html
- Frontend:
API documentation is available via Swagger UI when the backend application is running:
http://localhost:8080/swagger-ui.html
You can authorize using the Keycloak OIDC flow directly from Swagger UI to test protected endpoints.
This project includes code under the MIT License (see frontend/LICENSE file for details). Backend code license may vary based on dependencies.