百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

microservices-design-patterns

> 前端框架
开源

使用多种语言的微服务架构

186 stars0 点赞6 次浏览
访问官网GitHub

工具介绍

使用多种语言的微服务架构

Microservice Architecture with Multiple Languages

The idea for this project is to show a case for applying Microservice Architecture using multiple languages.

Most of the services are in Java + Spring Boot 4 (JDK 25) + MongoDB but there are others using NodeJS, Kotlin, Python, Go, Rust, C#, Clojure, and Scala.

The web application is using React

Android App using React Native is available.

A native Android App (android-webapp folder, Kotlin/Java) with feature parity to the React Web App - including Passkey/WebAuthn support - is also available.

Docker images are built in multiple platforms(linux/amd64,linux/arm64).

Services are deployed in a Raspberry Pi Cluster to access https://spendingbetter.com and create a user. Deploying a new image to the cluster follows the .claude/skills/pi-k8s-deploy skill (SSH + kubectl rollout restart/status, comparing the running pod's image digest against Docker Hub's :latest).

Feel free to create a new microservice using a different language(Ruby?, PHP?, Scala?), just please following the minimal requirements:

  • Create a new folder on root and put your code
  • Add a minimal documentation
  • Add a Rest API
  • Add JWT Validation
  • Add Tests
  • Add Dockerfile
  • Add MongoDB or some other NoSql
  • Add Consul Client(if possible)

PS: A better approach would be a microservice per repository but for simplicity all microservices are in the same repo.

If you want to contribute please check TODO List.

Inspired by the book Microservices Patterns(Chris Richardson - @crichardson).

Contents

  1. Microservice Patterns
  2. Prerequisites
  3. Microservice Diagram
  4. Installing all services using Docker Compose
  5. Docker Commands
  6. Manual Installation - NOT RECOMMENDED
  7. Accessing React Web App
  8. List of default users
  9. Kubernetes - Google Cloud Platform
  10. Travis CI/CD
  11. Github Actions CI/CD
  12. OS Native App - GRAALVM
  13. TODO List
  14. References
  15. Superpowers SDD Workflow
  16. Postman Collection

Microservice Patterns

The following list of Microservice Patterns was applied so far.

  • Server-side service discovery - Consul

  • API Gateway - Spring Cloud Gateway

  • Externalized configuration - Consul using Spring Cloud Config yaml format(with spring profiles), more details look at docker/spring-cloud-config

  • Exception Tracking - Spring Boot Admin

  • Access token - Spring Oauth2 with JWT

  • Health Check API - Spring Boot Actuator Starter

  • Distributed tracing - Jaeger

  • Application metrics - Spring Micrometer Prometheus

  • Database per service - MongoDB an instance per service

  • Shared database - Redis for sharing http sessions

To know more about each pattern look at Microservice Architecture

Prerequisites

  • JDK 25
  • Maven 3.9+
  • Docker 17.05.0-ce+ - Not necessary but recommended otherwise the services should run by command
  • Docker Compose 1.23.2+ - Not necessary but recommended otherwise the services should run by command

Microservice Diagram

Installing All Services using Docker Compose

The easiest way to run all microservices is using docker-compose, run the following commands:

On root folder first need to generate the docker images.

bash
# at once to compile code
mvn clean install 

# to build the docker images on Linux
mvn clean package -Pnative

# to build the docker images on Mac M1 Apple Silicon
mvn clean package docker:build

PS: Spring Native does not support yet Mac M1 Apple Silicon(Issue)

On docker folder run all microservices

bash
docker-compose up -d

Docker Commands

To see logs for a specific docker container:

bash
docker logs -f SERVICE_NAME

PS: Service names are on docker-compose.yml -> container_name

To execute a command inside the container:

bash
docker exec -it week-menu-api sh

To stop and remove all containers:

bash
docker-compose down -v

To restart/start/stop/remove specific container:

bash
docker-compose restart SERVICE_NAME
docker-compose up SERVICE_NAME
docker-compose stop SERVICE_NAME
docker-compose rm SERVICE_NAME

Manual Installation - NOT RECOMMENDED

If for some reason you cannot install docker/docker-compose you can run all services manually using the following command for Java applications.

mvn spring-boot:run -Dspring-boot.run.arguments="--server.port={PORT}"

To run NodeJS and React applications on folders nodejs-service and react-webapp:

bash
sudo npm install

sudo npm start

Accessing React App

To access React Web App.

Default Users

Following the list of default users:

[email protected]/password - ROLE_ADMIN

[email protected]/password123 - ROLE_PERSON_CREATE, ROLE_PERSON_READ, ROLE_PERSON_SAVE

[email protected]/test - ROLE_PERSON_READ

PS: Moved default users for Integration Tests only.

Kubernetes - Google Cloud Platform

The code in Raspberry Pi Cluster using microk8s.

Following useful commands for kubernetes

Installation

…

Deployment

…

Enable Ingress

Example Ingress Configuration

Install Helm

Kubernetes + Zuul

Example Spring Boot 2 + Kubernetes + Zuul

Secure Discovery Example

Travis CI/CD

Used travis-ci for building pull requests only.

Github Actions CI/CD

Using GitHub Actions for deploying services for multiple platforms(linux/amd64,linux/arm64).

More details look at .github/workflows/docker-build-push-*.

Configuration(Deployment/Services) for Kubernetes look at .github/workflows/kubernetes.

GRAALVM

First need to compile project

mvn clean package

To run an app native using Spring Native

mvn spring-boot:build-image -pl authentication-service

PS: Valid modules are authentication-service, person-service, user-service, kotlin-service, edge-server, and scala-address-service.

Or to run with GraalVM Plugin. mvn package -Pnative -q -pl authentication-service -am -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -DskipTests

To run the os native app

SPRING_PROFILES_ACTIVE=consul,dev SPRING_CLOUD_KUBERNETES_ENABLED=false CONSUL_URL=localhost:8501 authentication-service/target/authentication-service

Swagger UI

Swagger UI is available for Authentication, Person and User Services

Access it Swagger UI - http://localhost:{SERVICE_PORT}/swagger-ui.html

TODO List

  • Java - Split Person and User in different entities
  • Java - Split back-end and front-end in two different folders
  • Java - Split Java 8 Learning in another folder
  • Java - Add Test for Users Classes
  • Java - Add Spring Cloud Config
  • Java - Add Service Discovery(Eureka)
  • Java - Add Zuul(Gateway)
  • Java - Add Maven Docker Plugin
  • Java - Add Redis for Shared Session between applications
  • Java - Add Authentication for all applications
  • Java - Add Prometheus/Grafana for docker compose
  • Java - Add Oauth2 Security layer
  • Java - Fix Zuul/Edge Server for working with NodeJS Service
  • Kotlin - Add Service using Kotlin Language
  • Quarkus - Add Service using Quarkus framework
  • Scala - Add Service using Scala Language
  • C# - Add Service using C#/.NET Framework - Used Claude Agent
  • Go - Add Service using Go Language
  • Clojure - Add Service using Clojure Language
  • React - Create User List
  • React - Create User Page
  • React - Create User Edit
  • React - Create Categories Edit
  • React - Create Recipes Edit
  • React - Fix User Create/Edit
  • React - Fix Person Create/Edit
  • React - Fix Person List to work with @Tailable and EventSource.
  • React - Fix Docker Web App to use Nginx
  • Kubernetes/Minikube - Add example to use Kubernetes with Minikube
  • Deploy - Google Cloud/GKE
  • CI/CD - Add Travis
  • CI/CD - - Add Herokuy
  • CI/CD - Add GitHub Actions for deploy in GCP
  • Add documentation for libraries used
  • Add documentation/how-to for each language
  • Add tests for Python
  • Add React Legacy
  • Rename /api/persons to /api/people
  • Replace Eureka/Spring Config Server to Consul
  • Add Query DSL
  • Java - Migrate Zuul to Spring Cloud Gateway
  • React - Need to fix new layout
  • Go - Fix call to another service
  • PHP - Add Service using PHP/Laravel
  • Java - Migrate JDK 21 - Spring Boot 3
  • Java - Migrate JDK 21 - Quarkus 3
  • Java - Add Passkeys - Spring Boot 3
  • Java - Add One Time Token - Spring Boot 3
  • Java - Add JWKS Multiple Validation - Spring Boot 3
  • Java - Add Authorization Server - Spring Boot 3
  • Java - Removed Spring Oauth2 - Spring Boot 3
  • BFF - Implement BFF Pattern
  • Java - Spring Boot 4/JDK 25
  • Java - Kotlin/JDK 25
  • Java - Quarkus/JDK 25
  • Java - Add TestContainers
  • Add Open Telemetry
  • Rust - Add Service using Rust/Actix-web - Used Claude Agent
  • C# - Add Service using C#/.NET Framework - Used Claude Agent
  • Clojure - Add Service using Clojure - Used Claude Agent
  • Add Android Client - Used Claude Agent
  • Android - Feature parity with React Web App: Person children view, WeekMenu Category products, Admin Create All wizard, Passkey/WebAuthn registration+login - Used Claude Agent
  • CI - Add Gemini AI PR Review GitHub Action - Used Claude Agent
  • Rust - Parallelize count/find pagination queries - Used Claude Agent
  • Kubernetes - Fix slow-startup liveness/readiness probes with a startupProbe, add pi-k8s-deploy Claude skill for Docker Hub -> Pi cluster deploys - Used Claude Agent

Superpowers SDD Workflow

This project uses the Superpowers agentic skills framework with Subagent-Driven Development (SDD). This framework is located in the .junie folder and provides structured workflows for development tasks.

How to execute the steps

When working with an AI agent (like Junie), the workflow follows these mandatory steps:

  1. Brainstorming: Refine the idea, explore design options, and produce a design doc.
  2. **Using Git Wo

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Javagoogle-cloudjavamicroservice-architecturemicroservice-patterns

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架