Tickets

๐ŸŽŸ๏ธ ๐ŸŽ›๏ธ 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.

Stars
18

๐Ÿ“‘ Table of Contents

๐Ÿ“˜ Introduction

๐Ÿš€ Getting Started

To get a local copy up and running, follow these steps.

Prerequisites โ—

In order to run this project you need:

Environment Variables ๐Ÿ”‘

To run this project, you will need to add the following environment variables to your secrets.yaml file

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

SALT_FACTORY: number of rounds to create salt for hashing ( Example: 10 )

STRIPE_KEY: your stripe API key to handle the payment

Note: All environment variables must be encoded in base64 format.

Setup โฌ‡๏ธ

  1. Setup Ingress-Nginx Controller, refer to the documentation for instructions. This will guide you through the process of setting it up correctly to handle incoming traffic.

  2. Clone this repository to to your preferred directory:

cd my-folder
git clone https://github.com/ahmedeid6842/Tickets.git

Install โœ”๏ธ

Install this project with kubectl :

kubectl apply -f ./infra/k8s

Usage ๐Ÿคฟ ๐Ÿƒโ€โ™‚๏ธ

After following the above instructions, the Kubernetes cluster should be up and running.

  • To verify the health of all Kubernetes cluster components and ensure that they are in a ready state, you can run the following command in the terminal:
kubectl get all
  • Alright, it's showtime! ๐Ÿ”ฅ Hit ticketing.dev/api/users/currentuser and BOOM! ๐Ÿ’ฅ You should see the microservices working like a charm. โœจ๐Ÿง™โ€โ™‚๏ธ

Note: the reason you are receiving {"currentUser":null} is because you are not currently logged in. However, this indicates that the services are operational and functioning properly.

๐Ÿ” API Refernce

Postman ๐Ÿคฉ

Here is the link to the Postman documentation for Tickets: Postman Docs - Tickets.

๐Ÿ—๏ธ๐Ÿ”จ Architecture

  • Presented here is the general infrastructure diagram for the ticket cluster, illustrating the communication channels utilized by the distinct services to interoperate with one another.

๐Ÿ‘ค Author

Ahmed Eid ๐Ÿ™‹โ€โ™‚๏ธ

๐Ÿค Contributing

We're always looking to improve this project! ๐Ÿ” If you notice any issues or have ideas for new features, please don't hesitate to submit a pull request ๐Ÿ™Œ or create a new issue ๐Ÿ’ก. Your contribution will help make this project even better! โค๏ธ ๐Ÿ’ช

โญ๏ธ Show your support

If you find this project helpful, I would greatly appreciate it if you could leave a star! ๐ŸŒŸ ๐Ÿ’Ÿ

๐Ÿ”ญ Up next

  • Implement validation for incoming requests ๐Ÿšฆ
  • Add automated testing for each microservice ๐Ÿงช
  • Implement "Forgot Password" functionality ๐Ÿ’

๐Ÿ’Ž Lessons Learned

  1. Understanding of concurrency issues and techniques to mitigate them.

  2. Development of a good interface and base classes using TypeScript to enhance code organization and reusability.

  3. Configuration and use of a message broker to facilitate event sharing between microservices.

  4. Creation of a robust architecture for the microservices cluster using Kubernetes.

  5. There is always something new to learn ๐Ÿ‘จโ€๐Ÿ’ป.