{"id":17520389,"url":"https://github.com/ahmedeid6842/tickets","last_synced_at":"2025-04-23T15:25:07.137Z","repository":{"id":181646652,"uuid":"654355606","full_name":"ahmedeid6842/Tickets","owner":"ahmedeid6842","description":"🎟️ 🎛️ 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.","archived":false,"fork":false,"pushed_at":"2023-07-16T14:43:13.000Z","size":276,"stargazers_count":18,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-06T14:31:54.649Z","etag":null,"topics":["docker","kubernetes","message-broker","microservices","mongodb","nats-streaming","node-js","object-oriented-programming","redis","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahmedeid6842.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-06-16T00:36:39.000Z","updated_at":"2024-02-16T03:25:10.000Z","dependencies_parsed_at":"2023-07-17T00:33:38.303Z","dependency_job_id":null,"html_url":"https://github.com/ahmedeid6842/Tickets","commit_stats":null,"previous_names":["ahmedeid6842/tickets"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedeid6842%2FTickets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedeid6842%2FTickets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedeid6842%2FTickets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedeid6842%2FTickets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmedeid6842","download_url":"https://codeload.github.com/ahmedeid6842/Tickets/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250458634,"owners_count":21433911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","kubernetes","message-broker","microservices","mongodb","nats-streaming","node-js","object-oriented-programming","redis","typescript"],"created_at":"2024-10-20T11:04:44.558Z","updated_at":"2025-04-23T15:25:07.119Z","avatar_url":"https://github.com/ahmedeid6842.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n![logo-no-background](https://github.com/ahmedeid6842/Code-Base/assets/57197702/8898f229-8118-4c1c-8a0b-89a84c60f949)\n\n\n\u003ch1 align=\"center\"\u003eTickets Microservices\u003c/h1\u003e\n\n### 📑 Table of Contents\n- [📘 Introduction](#introduction)\n- [🚀 Getting Started](#getting-started)\n  - [Prerequisites ❗](#prerequisites)\n  - [Environment Variables :key:](#environment-variables)\n  - [Setup ⬇️](#setup)\n  - [Install :heavy_check_mark: ](#install)\n  - [Usage 🤿 🏃‍♂️](#usage)\n- [🔍 API Reference](#api-reference)\n- [🏗️🔨 Architecture](#architecture)\n- [👥 Authors](#authors)\n- [🤝 Contributing](#contributing)\n- [⭐️ Show Your Support](#show-your-support)\n- [🔭 Up Next](#up-next)\n- [💎 Lessons Learned](#lessons-learned)\n\n## 📘 Introduction \u003ca name=\"introduction\"\u003e\u003c/a\u003e\n\u003cp align=\"center\"\u003e\nThe Ticket App Microservices Backend is a Node.js Typescript-based backend that utilizes microservices architecture to provide a seamless user experience. This backend is composed of several microservices including Auth, Expiration, Common, Order, Payment, and Ticket. Auth handles authentication and authorization, while Expiration uses the Bull package to set expiration time for tickets and delay events for 15 minutes after order creation. Common is an npm package that shares the code of events interfaces. Order handles order creation and cancellation with firing events, Payment handles payment using Stripe, and Ticket handles ticket creation and updates. To handle message streaming between services, this backend uses NATS streaming service built on top of NATS-streaming. \n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\nThe code is written in Typescript, making use of interfaces, classes, and generators to ensure a well-organized and easily maintainable codebase. Kubernetes service and deployment were used to create a deployment for each service and its database and to build ingress and set up the NATS streaming service. This Ticket App Microservices Backend provides a reliable and efficient backend for your ticket app needs. The Ticket App Microservices Backend is a reliable and efficient solution for ticket app needs, with Mongoose version numbers utilized to solve concurrency issues between services.\n\u003c/p\u003e\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## 🚀 Getting Started \u003ca name=\"getting-started\"\u003e\u003c/a\u003e\n\nTo get a local copy up and running, follow these steps.\n\n### Prerequisites ❗\u003ca name=\"prerequisites\"\u003e\u003c/a\u003e\n\nIn order to run this project you need:\n\n \u003ca href=\"https://skillicons.dev\"\u003e\n        \u003cimg src=\"https://skillicons.dev/icons?i=docker,kubernetes\u0026theme=light\"/\u003e\n    \u003c/a\u003e\n \u003c/p\u003e\n\n### Environment Variables :key: \u003ca name=\"environment-variables\"\u003e\u003c/a\u003e\n\nTo run this project, you will need to add the following environment variables to your [secrets.yaml](./infra/k8s/secrets.yaml) file\n\n `JWT_KEY` : string, JSON web token secret \u003cstring\u003e (Example: JwtKey)\n\n`SALT_FACTORY`:  number of rounds to create salt for hashing\u003cnumber\u003e ( Example: 10 )\n\n`STRIPE_KEY`: your stripe API key to handle the payment \n\n_Note: All environment variables must be encoded in [base64 format](https://www.base64encode.org/)._\n\n### Setup ⬇️ \u003ca name=\"setup\"\u003e\u003c/a\u003e\n1. Setup Ingress-Nginx Controller, refer to the [documentation](https://kubernetes.github.io/ingress-nginx/deploy/) for instructions. This will guide you through the process of setting it up correctly to handle incoming traffic.\n\n2. Clone this repository to to your preferred directory:\n\n```bash\ncd my-folder\ngit clone https://github.com/ahmedeid6842/Tickets.git\n```\n\n### Install :heavy_check_mark: \u003ca name=\"install\"\u003e\u003c/a\u003e\n\nInstall this project with **[kubectl](https://kubernetes.io/docs/tasks/tools/)** :\n\n```bash\nkubectl apply -f ./infra/k8s\n```\n### Usage 🤿 🏃‍♂️ \u003ca name=\"usage\"\u003e\u003c/a\u003e\n\n\u003e After following the above instructions, the Kubernetes cluster should be up and running.\n\n- 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: \n\n```bash\nkubectl get all\n```\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://github.com/ahmedeid6842/Vending/assets/57197702/2b7aa64e-8c0c-4724-aa91-83d264694ce8\" alt=\"cluster-health\"/\u003e \u003c/p\u003e\n\n- Alright, it's showtime! 🔥 Hit `ticketing.dev/api/users/currentuser` and BOOM! 💥 You should see the microservices working like a charm. ✨🧙‍♂️\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://github.com/ahmedeid6842/Vending/assets/57197702/c3d957c3-da45-4405-add9-3f4abcd20a2e\" alt=\"Postman_Docs_GIF\"/\u003e \u003c/p\u003e\n\n\n\u003e _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._ \n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## 🔍 API Refernce \u003ca name=\"api-reference\"\u003e\u003c/a\u003e\n\n### Postman 🤩 \nHere is the link to the Postman documentation for Tickets: **[Postman Docs - Tickets](https://documenter.getpostman.com/view/10444163/2s946feY8x)**.\n\n \u003cp align=\"center\"\u003e\u003cimg src=\"https://github.com/ahmedeid6842/Vending/assets/57197702/c1b1c78d-b5cb-4c73-96ef-36e75e4c4966\" alt=\"Postman_Docs_GIF\"/\u003e \u003c/p\u003e\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## 🏗️🔨 Architecture \u003ca name=\"architecture\"\u003e\u003c/a\u003e\n\n- 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.\n\n \u003cp align=\"center\"\u003e\u003cimg src=\"https://github.com/ahmedeid6842/Code-Base/assets/57197702/9d3c0317-6115-42bb-bb39-0733573e36d1\" alt=\"Infrastructure\"/\u003e \u003c/p\u003e\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## 👤 Author \u003ca name=\"author\"\u003e\u003c/a\u003e\n**Ahmed Eid 🙋‍♂️**\n- Github: [@ahmedeid6842](https://github.com/ahmedeid6842/)\n- LinkedIn : [Ahmed Eid](https://www.linkedin.com/in/ahmed-eid-0018571b1/)\n- Twitter: [@ahmedeid2684](https://twitter.com/ahmedeid2684)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## 🤝 Contributing \u003ca name=\"contribution\"\u003e\u003c/a\u003e\n\nWe'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](https://github.com/ahmedeid6842/Tickets/pulls) 🙌 or create a [new issue](https://github.com/ahmedeid6842/Tickets/issues/new) 💡. Your contribution will help make this project even better! ❤️ 💪\n\n## ⭐️ Show your support \u003ca name=\"support\"\u003e\u003c/a\u003e\n\nIf you find this project helpful, I would greatly appreciate it if you could leave a star! 🌟 💟 \n\n## 🔭 **Up next**\n\n- [ ] Implement validation for incoming requests 🚦\n- [ ] Add automated testing for each microservice 🧪\n- [ ] Implement \"Forgot Password\" functionality 💁\n\n\n## 💎 Lessons Learned\n\n1. Understanding of concurrency issues and techniques to mitigate them.\n\n2. Development of a good interface and base classes using TypeScript to enhance code organization and reusability.\n\n3. Configuration and use of a message broker to facilitate event sharing between microservices.\n\n4. Creation of a robust architecture for the microservices cluster using Kubernetes.\n\n5. There is always something new to learn 👨‍💻.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedeid6842%2Ftickets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmedeid6842%2Ftickets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedeid6842%2Ftickets/lists"}