The Ticketing System is a robust backend infrastructure designed to support an event ticket marketplace. Users can list tickets for sale (concerts, sports events), purchase tickets, and manage orders seamlessly. The system ensures scalability, fault tolerance, and secure communication between services.
- Microservices Architecture: Independent services for user authentication, ticket management, order processing, payment handling, and expiration management.
- Asynchronous Communication: Uses RabbitMQ for event-driven communication between services.
- Scalability and Deployment: Built with Kubernetes and Docker, enabling efficient scaling and seamless deployment.
- Secure Payments: Integrates with Stripe for secure credit card payments.
- JWT Authentication: Ensures secure user authentication across services.
- Kubernetes: For container orchestration and managing service scaling.
- Docker: For containerizing services, ensuring consistent and portable environments.
- RabbitMQ: For handling asynchronous events in a decoupled system.
- Flask: Lightweight and fast web framework for APIs.
- Redis: Used for caching and handling expiration events.
- JWT (JSON Web Tokens): Secure user authentication and session management.
- Secure Communication: Services interact securely with clearly defined API boundaries.
- MongoDB: NoSQL database for storing tickets, orders, and user data.
- Handles user signup, login, and logout.
- Routes:
POST /api/users/signupPOST /api/users/signinPOST /api/users/signoutGET /api/users/currentuser
- Manages ticket creation, updates, and validation.
- Manages order creation, editing, and tracking status (Created, Cancelled, Awaiting Payment, Completed).
- Monitors pending orders and cancels them if not paid within 15 minutes.
- Handles credit card payments via Stripe.
- Cancels orders if payment fails or completes them upon success.
UserCreated,UserUpdatedTicketCreated,TicketUpdatedOrderCreated,OrderCancelled,OrderExpiredChargeCreated
Each service publishes and subscribes to relevant events via RabbitMQ for decoupled and efficient communication.
- Services are independently scalable using Kubernetes.
- Horizontal pod autoscaling for handling high traffic.
- Each service operates independently to ensure system reliability.
- RabbitMQ ensures message delivery even during service downtimes.
- Code duplication minimized with a shared common library.
- Event properties standardized for easier testing and debugging.
The system is deployed on a Kubernetes cluster with the following workflow:
- Build Docker images for each service.
- Deploy services to the cluster using Kubernetes manifests.
- Use NGINX Ingress for routing traffic to appropriate services.
- Implement AI-based recommendations for ticket purchases.
- Add analytics for user behavior and ticket sales.
- Introduce feature-based service design for more complex business logic.
- Docker and Kubernetes installed.
- Access to a Kubernetes cluster.
- MongoDB and RabbitMQ configured.
- Clone the repository:
git clone https://github.com/madhurachanna/ticketing cd ticketing - Build and run Docker containers:
docker-compose up --build
- Deploy to Kubernetes:
kubectl apply -f k8s/
Madhurachanna H B
This project is licensed under the MIT License.