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.
The following diagram illustrates the communication flow between services:
Ensure the image
spring-microservice-flow.png
is located at the root of the repository or adjust the path if needed.
- Spring Cloud Gateway – Entry point (
http://localhost:3000
) - Routes requests to Auth, Patient, and Billing services
- Validates JWT tokens from 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
- Exposes patient-related endpoints (
http://localhost:8080
,http://localhost:5555
) - Communicates with Billing via gRPC
- Publishes patient-related events to Kafka
- gRPC service running at
http://localhost:8081
andhttp://localhost:9091
- Responds to RPC requests from Patient Service
- Kafka consumer service
- Listens to patient events for analytical processing
- Available at
http://localhost:8082
- Event broker at
http://localhost:9092
- Used for asynchronous event streaming between services
This service will be integrated in the future to handle event-based notifications (e.g., email, SMS, push alerts).
This project includes a docker-compose.yml
file to orchestrate all services.
To start the full environment, run:
docker-compose up -d