Skip to content

πŸ’³ πŸ’³πŸ’³The Ticket App Microservices Backend is an efficient Node.js and Typescript-based solution that uses microservices, NATS streaming, and Kubernetes deployment for ticketing apps.

Notifications You must be signed in to change notification settings

SRayen/Ticketing-Microservices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Ticketing Project

TypeScript Express Next.js Bootstrap Jest redis mongoDB Docker Kubernetes CI/CD Logo

Status

tests-auth tests-payments

πŸ“‘ Table of Contents

πŸ“˜ Introduction

This is a web application that allows users to reserve and purchase tickets to events.

πŸ“˜ Description

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.

Features 🧩

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

Environment Variables πŸ”‘

JWT_KEY : string, JSON web token secret (Example: JwtKey)

STRIPE_KEY: your stripe API key to handle the payment

Development

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.

Architecture πŸ—οΈπŸ”¨

architecture

Screenshots 🎬

Deployments:

deployments

SignUp:

SignUp

Tickets:

Tickets

Purchase Ticket:

Purchase Ticket

Orders:

orders

Microservices logs:

logs

Stripe Payments:

stripe_payments

Dedication

  • πŸ“Œ 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.

About

πŸ’³ πŸ’³πŸ’³The Ticket App Microservices Backend is an efficient Node.js and Typescript-based solution that uses microservices, NATS streaming, and Kubernetes deployment for ticketing apps.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published