This repository contains a microservice-based web application called "Ticketing." The application enables users to buy and sell tickets for various events. The application is designed with a microservice architecture, consisting of multiple services that work together to provide a seamless experience. Below you will find an overview of the application's features, the services it comprises, and the technologies used.
-
Ticket Listing: Users can create listings for tickets they want to sell. They can provide details such as the event name, ticket price, and quantity available.
-
Ticket Purchase: Any user can browse the available tickets and make purchases. Once a ticket is purchased, it is marked as sold and no longer available for others to buy.
-
Ticket Locking: When a user begins the purchase process for a ticket, it gets locked for a certain amount of time. This prevents other users from purchasing the same ticket concurrently. If the purchase is not completed within the specified time, the ticket lock expires, and the ticket becomes available again.
-
Ticket Price Editing: Sellers have the ability to edit the price of their tickets as long as they are not locked by an ongoing transaction. This feature allows sellers to adjust prices based on market demand.
The Ticketing application consists of the following five services:
-
Auth Service:
- Responsible for user authentication and authorization.
- Handles user registration, login, and authentication.
- Generates and validates JSON Web Tokens (JWT) for secure communication between services.
-
Tickets Service:
- Handles CRUD (Create, Read, Update, Delete) operations on tickets.
- Allows users to list tickets for sale.
- Provides endpoints for fetching and updating ticket information.
- Implements ticket locking mechanism for a certain period.
-
Orders Service:
- Manages the lifecycle of orders in the system.
- Allows users to create new orders, view existing orders, and complete payments.
- Handles events related to orders, such as cancellation or expiration.
-
Payments Service:
- Handles credit card transactions and payment processing.
- Integrates with external payment gateways to securely process payments.
- Ensures the completion of payments for successful orders.
-
Expiration Service:
- Handles all the expiration tasks
The Ticketing application utilizes the following technologies:
- Typescript: A typed superset of JavaScript, providing enhanced development capabilities and improved code quality.
- Next.js: A React framework for server-side rendering and building scalable applications.
- React: A JavaScript library for building user interfaces.
- Docker: A containerization platform that allows for easy deployment and scalability of the application.
- Redis: An in-memory data store used for caching and session management.
- NATS: A lightweight and high-performance messaging system for inter-service communication.
- JavaScript: The primary programming language used in combination with TypeScript for application development.
To set up the Ticketing application locally, please follow these steps:
- Clone this repository:
git clone https://github.com/chrismatgit/ticketing.git
- Install dependencies for each service by navigating to their respective directories (e.g.,
auth
,tickets
,orders
,payments
) and runningnpm install
. - Ensure you have Docker installed on your local machine.
- Start the required infrastructure components (e.g., NATS, Redis) using Docker.
- Build each service using
skaffold run dev
.
We welcome contributions to the Ticketing application! If you would like to contribute, please follow these guidelines:
- Fork the repository and create a new branch for your contribution.
- Make your changes and ensure the code passes all tests.
- Submit a pull request detailing the changes you made and explaining their purpose.
I appreciate your contributions and value the time and effort you put into making this project better!
The Ticketing application is open-source and licensed under the MIT License. Feel free to use, modify, and distribute the application as permitted by the license.
If you have any questions, feedback, or suggestions regarding the Ticketing application, please reach out to me at @chris_matabaro or chris-matabaro. I appreciate your interest and would be happy