A microservices-based event ticket booking platform built with Spring Boot and React.
The system consists of 5 microservices:
- Auth Service (Port 8081): User authentication and authorization
- Event Service (Port 8082): Event creation and management
- Ticket Service (Port 8083): Ticket inventory and generation
- Payment Service (Port 8084): Payment processing and order management
- Notification Service (Port 8085): Email notifications and delivery
- Java 17+
- Maven 3.9+
- Docker and Docker Compose
- PostgreSQL 15+ (for local development without Docker)
- Redis 7+ (for local development without Docker)
-
Clone the repository
git clone <repository-url> cd event-ticket-booking-system
-
Build the applications
mvn clean package -DskipTests
-
Start the infrastructure and services
docker-compose up -d
-
Verify services are running
docker-compose ps
-
Install PostgreSQL and create databases
CREATE DATABASE auth_service; CREATE DATABASE event_service; CREATE DATABASE ticket_service; CREATE DATABASE payment_service; CREATE DATABASE notification_service;
-
Create users and grant permissions
CREATE USER auth_user WITH PASSWORD 'auth_password'; GRANT ALL PRIVILEGES ON DATABASE auth_service TO auth_user; CREATE USER event_user WITH PASSWORD 'event_password'; GRANT ALL PRIVILEGES ON DATABASE event_service TO event_user; CREATE USER ticket_user WITH PASSWORD 'ticket_password'; GRANT ALL PRIVILEGES ON DATABASE ticket_service TO ticket_user; CREATE USER payment_user WITH PASSWORD 'payment_password'; GRANT ALL PRIVILEGES ON DATABASE payment_service TO payment_user; CREATE USER notification_user WITH PASSWORD 'notification_password'; GRANT ALL PRIVILEGES ON DATABASE notification_service TO notification_user;
-
Install and start Redis
# macOS with Homebrew brew install redis brew services start redis # Ubuntu/Debian sudo apt-get install redis-server sudo systemctl start redis-server
-
Build the project
mvn clean install
-
Start each service in separate terminals
# Terminal 1 - Auth Service cd auth-service mvn spring-boot:run # Terminal 2 - Event Service cd event-service mvn spring-boot:run -Dspring-boot.run.arguments=--server.port=8082 # Terminal 3 - Ticket Service cd ticket-service mvn spring-boot:run -Dspring-boot.run.arguments=--server.port=8083 # Terminal 4 - Payment Service cd payment-service mvn spring-boot:run -Dspring-boot.run.arguments=--server.port=8084 # Terminal 5 - Notification Service cd notification-service mvn spring-boot:run -Dspring-boot.run.arguments=--server.port=8085
Auth Service (http://localhost:8081)
POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/verify-email- Email verificationPOST /api/auth/forgot-password- Password reset requestPOST /api/auth/reset-password- Password reset
Event Service (http://localhost:8082)
GET /api/events- List eventsGET /api/events/{id}- Get event detailsPOST /api/events- Create event (organizers only)PUT /api/events/{id}- Update event (organizers only)GET /api/events/search- Search events
Ticket Service (http://localhost:8083)
GET /api/tickets/availability/{eventId}- Check ticket availabilityPOST /api/tickets/reserve- Reserve ticketsPOST /api/tickets/purchase- Purchase ticketsGET /api/tickets/orders/{userId}- Get user orders
Payment Service (http://localhost:8084)
POST /api/payments/process- Process paymentGET /api/payments/orders/{orderId}- Get order detailsPOST /api/payments/refund- Process refund
Notification Service (http://localhost:8085)
POST /api/notifications/send- Send notificationGET /api/notifications/status/{id}- Check delivery status
Create a .env file in the root directory:
# Database Configuration
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
# Redis Configuration
REDIS_HOST=localhost
REDIS_PORT=6379
# JWT Configuration
JWT_SECRET=your-secret-key-here
# Email Configuration
MAIL_USERNAME=your-email@gmail.com
MAIL_PASSWORD=your-app-password
# Stripe Configuration
STRIPE_API_KEY=your-stripe-api-key
STRIPE_WEBHOOK_SECRET=your-stripe-webhook-secret
# AWS Configuration
AWS_ACCESS_KEY_ID=your-aws-access-key
AWS_SECRET_ACCESS_KEY=your-aws-secret-key
AWS_REGION=us-east-1
AWS_S3_BUCKET=your-s3-bucket-name
AWS_SQS_QUEUE_URL=your-sqs-queue-urlmvn testmvn verifycd auth-service
mvn testdocker-compose up -ddocker-compose downdocker-compose logs -f [service-name]docker-compose up -d --build [service-name]Each service exposes health check endpoints:
GET /actuator/health- Service health statusGET /actuator/info- Service information
- Port conflicts: Ensure ports 5432-5436, 6379, and 8081-8085 are available
- Database connection issues: Verify PostgreSQL is running and credentials are correct
- Redis connection issues: Ensure Redis is running on port 6379
- Docker build failures: Run
mvn clean packagebeforedocker-compose up
Check service logs for debugging:
# Docker logs
docker-compose logs -f [service-name]
# Local development logs
tail -f logs/application.log- Code Style: Follow Java coding conventions
- Testing: Maintain 80%+ test coverage
- Documentation: Update API documentation for new endpoints
- Security: Never commit sensitive credentials
- Database: Use migrations for schema changes
- Create a feature branch from
develop - Make your changes with appropriate tests
- Submit a pull request to
develop - Ensure CI/CD pipeline passes
This project is licensed under the MIT License.