Ticketing App is a project developed to learn about the operation of Microservices and Event Driven Architectures.
- Users can list a ticket for an event(concert, sport) for sale
- Other users can purchase this ticket
- Any user can list tickets for sale and purchase tickets
- When user attempt to puchase a ticket, the ticket is locked for 15 minutes. The user has 15 minutes to enter their payment info
- While locked, no other user can purchase the ticket. After 15 minutes, the ticket should unlock
- Ticket process can be edited if they are not locked
- What are event-driven architectures and how do they work?
- How communication between microservices is done with an event bus.
- How to handle concurrency problems in event-driven architectures.
- TTD - Test Drive Development in NodeJS World.
- JEST and how configure it with NodeJS (Mocking imports with JEST).
This project was developed in Ubuntu 22.04 with Docker and Kubernets and developed with React and NodeJS.
Option | Description |
---|---|
auth | Everything related to user (signup/signin/signout). |
tickets | Ticket creation/editing. Knows whether a ticket can be updated |
orders | Order creation/editing. |
expiration | Watches for orders to be created, cancel them after 15 minutes. |
payments | Handles credit card payments. Cancel orders if payments fails, completes if payment succeeds |
UserCreated
UserUpdated
OrderCreated
OrderCancelled
OrderExired
TicketCreated
TicketUpdated
PaymentCreated
BackEnd | FrontEnd | Database | CI/CD | Event Bus |
---|---|---|---|---|
NodeJS (Teste with v16.20) | React | Mongo/Redis | Skaffold / Github Actions | Nats-Streaming |
- Docker.
- Kubernets Cluster. I used minikube (https://minikube.sigs.k8s.io/docs/start/).
- Ingress Controller created on kubernets. I used ingress-inginx to minikube (https://kubernetes.github.io/ingress-nginx/deploy/#minikube)
- Skaffold (optional). Skaffold makes it easier develop and deploy the entire app (skaffol dev). You can create all deployments one by one. (https://skaffold.dev/docs/install/)
- Postman. Postman is used to test endpoints.
- At final, execute the following commands to kubernets cluster.
kubectl create secret generic jwt-secret --from-literal=JWT_KEY=asdf
kubectl create secret generic stripe-secret --from-literal=STRIPE_KEY=sk_test...
Value for STRIPE_KEY can be get from STRIPE developer console . Se more info in payments folder.
{
errors: {
message: string,
field?: string // optional
} [] // array
}
You need to execute the following command in order to create necesary secrets
kubectl create secret generic jwt-secret --from-literal=JWT_KEY=asdf
kubectl create secret generic stripe-secret --from-literal=STRIPE_KEY=sk_test...