Giter Site home page Giter Site logo

microservices-ticketing's Introduction

microservices-ticketing


Logo

Ticketing

Table of Contents
  1. About The Project
  2. Getting Started
  3. Contact

About The Project

UI

This project is created from scratch to evaluate the possibility of microservices architecture.

Features:

  • Authentication
  • Product management (Create and Sell ticket)
  • View and purchase product
  • Stripe integration for payment

(back to top)

Techniques

  • Event-Driven Architecture using NATS Streaming Server as Event bus
  • Optimistic Concurrency Control (OCC) for handling concurrency issues
  • Implement worker service using Bull Queue
  • JWT Authentication
  • Server side rendering with Next.js

(back to top)

Built With

List of major frameworks/libraries used to bootstrap the project.

(back to top)

Project structure

Folder Detail
auth Service to handle authentication (signup/signin/signout)
client The client application (Next.js)
common The commmon service that used in every service and it's uploaded to npmjs.com
infra Kubernetes infrastucture for this application
nats-test Testing to NATS Streaming Server
orders Order service
tickets Ticket service
payments Service for handling payment processes
expiration Expiration worker for locking ticket during payment waiting
skaffold.yml Skaffold configuration for this project

(back to top)

Presentation

For more information, please refer

(back to top)

Getting Started

This is an instruction on setting up the project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

  • Docker
  • Kubernetes
  • Skaffold

Installation

  1. Get a free Stripe API Key at https://stripe.com

  2. Clone the repo

    git clone https://github.com/dragonxsx/microservices-ticketing.git
  3. Install NGINX Ingress Controller

    kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.5.1/deploy/static/provider/cloud/deploy.yaml
  4. Generate ssl certificate and create tls secret

    openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ssl-key.key -out ssl-cert.cert -subj "/CN=ticketing.dev/O=ticketing.dev"
    kubectl create secret tls ticketing --key ssl-key.key --cert ssl-cert.cert
  5. Create secret environment variables

    kubectl create secret generic jwt-secret --from-literal=JWT_KEY=${YOUR_JWT_KEY}
    kubectl create secret generic stripe-secret --from-literal STRIPE_KEY=${YOUR_STRIPE_KEY}
  6. Change local environment hosts file

    Edit hosts file

    • For Windows: C:\Windows\System32\drivers\etc\hosts
    • For Mac/Linux: /etc/hosts

    Add new line

    127.0.0.1 ticketing.dev
    
  7. Bootstrap the application

    skaffold dev

Common issues

Error: mongo can't be pulled

Try pulling the image manually from outside of Skaffold:

docker pull mongo

If this is successful, it should cache it locally and the problem will no longer persist.

secret "jwt-secret" not found
kubectl create secret generic jwt-secret --from-literal=JWT_KEY=${YOUR_JWT_KEY}
503 service temporarily unavailable

Delete and re-install ingress controller

  1. Get the namespace which your ingress controller installed in
    kubectl get ns
    for example : ingress-nginx
  2. Remove all resources in this namespace
    kubectl delete all  --all -n ingress-nginx
    If your ingress controller is not installed in a dedicated namespace so you will have to remove resources one by one.
    kubectl delete ingress ingress-nginx
    kubectl delete deployment ingress-nginx
    kubectl delete service ingress-nginx
  3. Install ingress controller
    kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.5.1/deploy/static/provider/cloud/deploy.yaml

(back to top)

Contact

Nguyen Thanh Long - @dragonxsx

Project Links:

(back to top)

microservices-ticketing's People

Contributors

dragonxsx avatar

Stargazers

 avatar

Watchers

 avatar

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.