andersevenrud / microservice-rnd

Microservice architecture demonstration with Node.js (TypeScript) and Kafka

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

microservice-rnd

Microservice architecture demonstration with Node.js (TypeScript) and Kafka.

About

This is a personal research project used for learning more about microservice architectures, structuring and good practices related to development on Docker and deployment onto a Kubernetes Cluster.

Kafka is used to connect all services using event streams.

Provides a basic dashboard interface in React and REST API that interacts with a runner service that handles processes to demonstrate event streams, etc. Keycloak handles for authentication and authorization.

Uses Github Actions for CI and CD, Pulumi for deployments. Tilt & minikube for local development and Husky for git hooks.

ESLint, Prettier and Jest for code style guidelines and testing.

An alternative docker compose setup is provided that mirrors the k8s cluster, albeit without the scaling.

Please note that the out-of-the-box configurations are not safe for a production environment.

Vite-App

Requirements

One of the following configurations:

Note that the docker compose environment does not scale and is mainly for development purposes, while the kubernetes cluster is configured for scaling.

  1. Local Kubernetes Cluster
    • docker
    • minikube
    • tilt
    • pulumi (optional)
  2. Local Docker Compose
    • docker
    • compose docker plugin

Installation

Kubernetes

Runs on https://rnd.lvh.me (and <admin-service>.rnd.lvh.me)

See docs/k8s.md for more information about setting up a local Kubernetes cluster.

tilt up

Docker Compose

Runs on http://localhost:8080 (and /<admin-service>/)

docker compose run --rm cli sh scripts/migrations.sh
docker compose up

Dashboard

When you open the app you will be redirected to the authentication client.

The default username is admin and password admin.

Admin Services

You can access the following administration interfaces with the URL patterns noted above:

  • kowl - Kafka inspection
  • mailhog - Mail preview
  • adminer - Database administration
  • auth - Keycloak administration

Development

See docs/development.md for more information.

Deployment

If you want to deploy this into the cloud, see docs/deploy.md.

It's also possible to do a deployment with git and docker compose by simply cloning this repository, then use deploy/compose/docker-compose.yaml directly or as a template and run it from the root directory.

License

Unlicense

About

Microservice architecture demonstration with Node.js (TypeScript) and Kafka

License:The Unlicense


Languages

Language:TypeScript 92.1%Language:Dockerfile 4.3%Language:Starlark 1.9%Language:Shell 1.0%Language:HTML 0.3%Language:JavaScript 0.2%Language:CSS 0.2%