An Implementation of a Ticket Booking app as a microservice for each feature. Services communicate in Async Architecture. Use cases: Events, Concerts, Sport, Cinema hall
- Table of Contents
- About The Project
- Getting Started
- without Skaffold
- with Skaffold
- Local Server
- Working
Users can list a ticket for an event (concert, sports) for sale. Other users can purchase this event ticket. The user who is posting can buy his own ticket as well. When a user attempts to purchase a ticket, the ticket is "locked" for 15 minutes. The user has 15 minutes to enter their payment info. While locked no other users can pruchase that particular ticket. Ticket price can be edited if not locked. After 15 minutes, the ticket will either be unlocked or sold right after payment verification.
This project is build with following languages and framework
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps. If this all is overwhelming you can try NOdockerNOkuber branch and follow the guidelines from that readme file.
- Text editor
- Docker
- Kubernetes
- minikube
- skaffold
-
Clone the repo to your machine
-
Make sure you're at master branch.
-
Move toward the Root directory .
cd ticket_booking_app
- Dockerize each service
docker build . -t <username>/<servicename>
- start minikube
minikube start --driver=docker
- Apply deployment configs
cd /infra/k8s
kubectl apply -f .
minikube start --driver=docker --addons ingress
Start skaffold developemnt environment and track file changes automatically.
skaffold dev
Visit http://<minikube_ip>:Nodeport/
minikube ip (shows minikube_ip)
kubectl get svc (shows Nodeport of posts-srv)
- Install NATS Streaming Server
// install from source, deb packages, or docker or go install
❯ go install github.com/nats-io/nats-streaming-server@latest
❯ nats-streaming-server
- Start NATS Server
❯ nats-streaming-server -cid ticketing -hbi 5s -hbt 5s -hbf 2 -SD -m 8222
. It is officially deprecated but still works. Use Jetstream instead. Connect to server with npm librarynode-nats-streaming
. - Start Redis Server
redis-server
- Start MongoDB
mongod
- Install dependencies
npm i
- Start each service
npm start
Overview of how the services interact with eachother.
-
Post any ticket
-
Buy any ticket