Git Product home page Git Product logo

srayen / ticketing-microservices Goto Github PK

View Code? Open in Web Editor NEW
13.0 1.0 3.0 368 KB

πŸ’³ πŸ’³πŸ’³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.

Dockerfile 0.53% TypeScript 88.11% JavaScript 11.31% CSS 0.05%
docker expressjs jest kubernetes microservices mongodb nextjs13 nodejs redis typescript

ticketing-microservices's Introduction

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.

ticketing-microservices's People

Contributors

ghazouanihichem avatar srayen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ticketing-microservices's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.