- π Introduction
- π Description
- 𧩠Features
- π Environment Variables
- ποΈ Architecture
- βΉοΈ Development
- π¬ Screenshots
This is a web application that allows users to reserve and purchase tickets to events.
The Ticketing App Microservices Backend is a Node.js Typescript-based Backend (a very simple Next.js front-end is made just for demonstration and testing purposes) that leverages microservices architecture to provide a scalable and resilient user experience. It is composed of several microservices, each with a specific responsibility, including:
- β‘οΈ Auth: Handles authentication and authorization.
- β‘οΈ Expiration: Uses the Bull package to set expiration times for tickets and delay events by 15 minutes after order creation.
- β‘οΈ Common: A shared npm package that provides interfaces for events.
- β‘οΈ Order: Handles order creation and cancellation, and fires events to notify other services.
- β‘οΈ Payment: Handles payment processing using Stripe.
- β‘οΈ Ticket: Handles ticket creation and updates.
β To facilitate communication between services, the Ticket App Microservices Backend uses NATS Streaming Server, a lightweight messaging service built on top of NATS.
π The code is written in Typescript, which uses interfaces, classes, and generators to ensure a well-organized and maintainable codebase.
π βΈ Kubernetes is used to create deployments for each service and its database, as well as to build ingress and set up the NATS Streaming service.
π₯ The Ticketing App Microservices Backend is a reliable and efficient solution for ticket app needs. It leverages Mongoose version numbers to resolve concurrency issues between services.
This app has the following functionalities:
- β Sign in/up
- β Add a ticket to the marketplace (seller)
- β Add ticket to cart (buyer) and mark it 'reserved' for 15 min
- β Make an Order
- β Checkout & pay for order
JWT_KEY
: string, JSON web token secret (Example: JwtKey)
STRIPE_KEY
: your stripe API key to handle the payment
To manage all the Docker containers inside the Kubernetes cluster and simplify development workflow the project uses Skaffold.
To run the app in development environment, make sure Docker, Kubernetes and Skaffold are installed on your local machine.
Before running the app environment variables inside the Kubernetes cluster must be set. Execute commands below to set these environment variables:
# kubectl create secret generic stripe-secret --from-literal=STRIPE_KEY=<your_stripe_key>
# kubectl create secret generic jwt-secret --from-literal=JWT_KEY=<your_jwt_key>
Be sure to expose the ingress-nginx-controller with:
# kubectl expose deployment ingress-nginx-contoller --target-port=80 --type=NodePort -n kube-system
π Start the app with skaffold dev
.
π Skaffold handles the workflow for building, pushing and deploying your application, allowing you to focus on what matters most: writing code.
- π I would like to express my deepest gratitude to Stephen Grider , the creator of the Microservices with Node JS and React course on Udemy.
- π It is thanks to Stephen's exceptional expertise and unwavering guidance that this project came to fruition and under his tutelage.
- π This project is a testament to my growth as a Software Engineer and the invaluable lessons I have learned on this incredible learning journey.
- π I am thrilled to share this project with you, and I hope it serves as a tribute to Stephen Grider's incredible teaching and mentorship.