Skip to content

axyut/ticket_booking_app

Repository files navigation

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

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.

Built With

This project is build with following languages and framework

Getting Started

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.

Prerequisites

  • Text editor
  • Docker
  • Kubernetes
  • minikube
  • skaffold

Installation

  1. Clone the repo to your machine

  2. Make sure you're at master branch.

  3. Move toward the Root directory .

   cd ticket_booking_app

without Skaffold

  1. Dockerize each service
   docker build . -t <username>/<servicename>
  1. start minikube
   minikube start --driver=docker
  1. Apply deployment configs
   cd /infra/k8s
   kubectl apply -f .

with Skaffold

   minikube start --driver=docker --addons ingress

Start skaffold developemnt environment and track file changes automatically.

   skaffold dev

Local Server

Visit http://<minikube_ip>:Nodeport/

   minikube ip  (shows minikube_ip)
   kubectl get svc (shows Nodeport of posts-srv)

Without Docker (Everything in local)

  1. 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
  1. 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 library node-nats-streaming.
  2. Start Redis Server redis-server
  3. Start MongoDB mongod
  4. Install dependencies npm i
  5. Start each service npm start

Working

  1. Go to Website

Overview of how the services interact with eachother.

  1. Post any ticket

  2. Buy any ticket

About

Micro-service architecture Tickets Marketplace. Book/Sell film, concert, events tickets immediately. Node, Docker, Kubernetes, Redis, MongoDB, Skafold

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published