A robust, microservices-based application built for managing event registrations, payments, and organizers. Built with Spring Boot 3, Spring Security (JWT), PostgreSQL, and Docker.
- Centralized Gateway: Single entry point with JWT validation.
- Service Discovery: Eureka server for dynamic routing.
- Normalized DBs: 3 separate PostgreSQL databases with 7-table industry-standard schema.
- Razorpay Integration: End-to-end payment flow in registration service.
- Concurrency Control: JPA Optimistic Locking on event capacity and registrations.
| Service | Port | Description |
|---|---|---|
service-registry |
8761 | Eureka Server |
api-gateway |
8080 | Routing & Global JWT Auth |
auth-service |
8081 | User Management & Login |
event-service |
8082 | Event CRUD & Filtering |
registration-service |
8083 | Registration & Payment (Razorpay) |
- Ensure Docker and Docker Compose are installed.
- (Optional) Create a
.envfile in the root directory and add:NGROK_AUTHTOKEN=your_authtoken_here - Run
docker compose up --build -d.- If using ngrok, find your public URL in the logs or at
http://localhost:4040.
- If using ngrok, find your public URL in the logs or at
- Eureka Dashboard:
http://localhost:8761. - API Gateway:
http://localhost:8080.
The system consists of 3 Core Microservices, an API Gateway, and a Service Registry (Eureka):
- Auth + User Service (
:8081) - Handles JWT generation, role-based access, and user profiles. - Event Service (
:8082) - Handles CRUD operations, status management, and event filtering. - Registration Service (
:8083) - Handles user registrations, capacity validations, Razorpay payments, and PDF receipt generation.
- Language: Java 17
- Framework: Spring Boot 3.2.x, Spring Cloud, Spring Security
- Authentication: Stateless JWT (JSON Web Tokens)
- Database: PostgreSQL (Containerized)
- API Documentation: Swagger UI (OpenAPI 3)
- Deployment: Docker & Docker Compose
- Testing: JUnit 5, Mockito
- Payment Gateway: Razorpay Webhooks
- Other Tools: Lombok, Maven, OpenFeign
- ADMIN (
ROLE_ADMIN) - Full privileges. Can create Organizer and Registrant accounts via specific/adminendpoints. - ORGANIZER (
ROLE_ORGANIZER) - Can create, update, delete, and close their own events. - REGISTRANT (
ROLE_REGISTRANT) - Can browse events, register, make payments, and view their receipts.
Ensure you have Docker and Docker Compose installed on your machine.
Navigate to the root directory and run the following command to build the Docker images for all services:
docker-compose buildStart the PostgreSQL databases, Eureka Service Registry, and the API Gateway along with the microservices:
docker-compose up -dOnce the containers are healthy (wait ~40 seconds for Eureka to register the services):
- API Gateway:
http://localhost:8080 - Eureka Dashboard:
http://localhost:8761
All services dynamically generate OpenAPI definitions. You can view the full interactive API documentation automatically deployed with the containers:
- Auth Service Docs:
http://localhost:8081/swagger-ui.html - Event Service Docs:
http://localhost:8082/swagger-ui.html - Registration Service Docs:
http://localhost:8083/swagger-ui.html
- Capacity Enforcement: The registration API checks event
maxCapacity. - Duplicate Prevention: Users cannot register twice for the same event.
- Ownership Checking: Organizers can only edit and delete events they created.
- Event Status Enforcement: Registrations are strictly blocked if an event is set to
CLOSED. - Webhook Resilience: Razorpay
payment.failedwebhooks correctly mark registrations as failed to free up ticket capacity for other users.
- Global Exception Handling: All services return structured JSON error responses.
- Extensible Payments: Supported modes:
RAZORPAY,MANUAL(Mock). - Ownership Validation: Organizers manage only their own events.
- Cross-Service Validation: Feign clients used for inter-service consistency.