Skip to content

A Microservice Architecture utilizing NodeJS, Docker & Kubernetes

Notifications You must be signed in to change notification settings

jaggehns/NodeJs-Microservices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A NodeJS Microservice based Application


🛠  Tech Stack

  • Front-End: NextJS
  • Backend: NodeJS
  • Database: MongoDB
  • Tools: RabbitMQ, Ingress Nginx, Docker, Kubernetes

🧑🏼‍🔬 Overview

  • The application is a simple message app which allows users to key in a message and a sub-message.

  • It utilizes a microservice architecture that breaks down the 3 services.

    • Message service - the service that allows a message to be created
    • Peep service - the service that allows a sub-message to be created
    • Query service - the service from which display data is pulled from
  • All services follow a database per service architecture, with the database of choice being MongoDB

  • Each service is Dockerized and deployed to a Kubernetes Cluster

  • Kubernetes ClusterIP Services are setup for communication

Screenshot 2023-02-20 at 2 10 59 AM


🌐 High-Level Architecture

  • The application allows for asynchronous event handling via RabbitMQ
  • This allows for data changes in any service to be normalized across the other services and databases
  • Ingress Nginx acts as a load balancer and external router for HTTP requests from outside the Kubernetes Cluster
  • RabbitMQ topics allow for a pub-sub model where a multi-subscriber pattern is utilized

Screenshot 2023-02-20 at 2 38 15 AM

Set-up Environment

You will need Docker, Kubernetes, Skaffold and Ingress Nginx installed in your development environment.

Install Docker Desktop on Windows or MacOS. Install Docker on Linux.

Install Kubernetes on Linux

Install Skaffold

Install Ingress Nginx

Customize local hosts file

You will also need to customize your local hosts file to point message-app.dev to your localhost IP address.

Windows: c:\Windows\System32\Drivers\etc\hosts

macOS and Linux: /etc/hosts

Open your hosts file and add the following line at the bottom: 127.0.0.1 message-app.dev

Running the Microservices

From a terminal in the root directory of NodeJS-Microservices, run the following command: skaffold dev

Allow time for all of the services to start and connect. Stop any pods which fail to connect via Docker Desktop. They will restart automatically.

Open your browser and navigate to http://message-app.dev/. You may get a security warning. To bypass this in chrome, type "thisisunsafe" directly in the browser window.

About

A Microservice Architecture utilizing NodeJS, Docker & Kubernetes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published