Skip to content

pranta-barua007/microservices-typescript

Repository files navigation

Mircroservice Typescript

An microservices app created with Express.js, Typescript, MongoDB, BullJS, Docker, Kubernernetes, Ingress-NGINX & NATS.

Getting Started

requirements

Available Commands

To install INGRESS-NGNIX

$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.3.1/deploy/static/provider/cloud/deploy.yaml

To run all services at parallel

$ skaffold dev

To set a JSON web token secret

$ kubectl create secret generic jwt-secret --from-literal=JWT_KEY=yourTokenSecret

To set a STRIPE secret (needed for payments service) Create your STRIPE account and get the secret

$ kubectl create secret generic jwt-secret --from-literal=JWT_KEY=sk_test_4eC39HqLyjWDarjtT1zdp7dc

Check all created secrets

$ kubectl get secrets

Developement setup

We need to edit the host file of our computer to identify our custom route in dev environment.

Find Host file

Add 127.0.0.1 ticketing.dev to the host file

Edit Host file

Troubleshooting

You may face this error in Chrome Browser or Chromium based browsers

Chrome Error

To fix the error ->

  • Click on the active tab of the browser
  • Type thisisunsafe
  • The error should gone by now

Fix Chrome Error

Service's overview

Service overview

Mircroservice Architecture

Service Architecture

Events for communicating between Mircroservice's through NATS

NATS Events

Developement Flow

Dev Flow