An open API service indexing awesome lists of open source software.

https://github.com/koriebruh/spring-services

A Spring Boot-based microservices architecture featuring authentication, patient management, billing, and analytics services with API Gateway, Kafka, gRPC, and PostgreSQL — all containerized using Docker Compose
https://github.com/koriebruh/spring-services

docker-compose hibernate-jpa mock postgresql spring-boot springcloudgateway springsecurity-jwt

Last synced: about 2 months ago
JSON representation

A Spring Boot-based microservices architecture featuring authentication, patient management, billing, and analytics services with API Gateway, Kafka, gRPC, and PostgreSQL — all containerized using Docker Compose

Awesome Lists containing this project

README

          

# 🚀 Microservice Architecture Overview

This project demonstrates a microservices-based architecture using Spring Boot, Kafka, PostgreSQL, gRPC, and Docker. Each service is containerized and communicates via REST, gRPC, or Kafka events.

---

## 📌 Architecture Flow

The following diagram illustrates the communication flow between services:

![Microservice Flow](./spring-microservice-flow.png)

> Ensure the image `spring-microservice-flow.png` is located at the root of the repository or adjust the path if needed.

---

## 🧩 Microservices Overview

### 🌐 API Gateway
- **Spring Cloud Gateway** – Entry point (`http://localhost:3000`)
- Routes requests to Auth, Patient, and Billing services
- Validates JWT tokens from Auth Service

### 🔐 Auth Service
- Handles user authentication: `/auth/login`, `/auth/register`
- Issues JWTs and verifies them for the gateway
- Connected to a dedicated PostgreSQL instance (`postgres-auth-service`)
- Runs on `http://localhost:8083`

### 🧍 Patient Service
- Exposes patient-related endpoints (`http://localhost:8080`, `http://localhost:5555`)
- Communicates with Billing via gRPC
- Publishes patient-related events to Kafka

### 💰 Billing Service
- gRPC service running at `http://localhost:8081` and `http://localhost:9091`
- Responds to RPC requests from Patient Service

### 📊 Analytics Service
- Kafka consumer service
- Listens to patient events for analytical processing
- Available at `http://localhost:8082`

### 📬 Kafka
- Event broker at `http://localhost:9092`
- Used for asynchronous event streaming between services

### 🔔 Notification Service (Coming Soon)
> This service will be integrated in the future to handle event-based notifications (e.g., email, SMS, push alerts).

---

## 🐳 Running with Docker Compose

This project includes a `docker-compose.yml` file to orchestrate all services.
To start the full environment, run:

```bash
docker-compose up -d