A Java/Spring microservices project for patient management with gateway routing, gRPC integration, and event-driven processing.
The repository includes multiple Spring Boot services:
- patient-service: primary patient CRUD API
- billing-service: billing logic + gRPC server
- analytics-service: event consumer/analytics processing
- api-gateway: routing entry point
Supporting infrastructure includes PostgreSQL and Kafka via Docker Compose.
- Java 21, Spring Boot 3.x
- Spring Data JPA + PostgreSQL
- Apache Kafka for async events
- gRPC for inter-service communication
- Maven build
flowchart LR
G[API Gateway] --> P[Patient Service]
P --> B[Billing Service gRPC]
P --> K[(Kafka)]
K --> A[Analytics Service]
P --> DB[(PostgreSQL)]
- Java 21+
- Maven 3.9+
- Docker + Docker Compose
Run from each service module (no single root parent pom):
cd patient-service && ./mvnw clean package
cd ../billing-service && mvn clean package
cd ../analytics-service && mvn clean package
cd ../api-gateway && mvn clean packageService-specific config is mostly in application.yml/application.properties.
Common values include:
SPRING_DATASOURCE_URLSPRING_DATASOURCE_USERNAMESPRING_DATASOURCE_PASSWORDSPRING_KAFKA_BOOTSTRAP_SERVERSBILLING_SERVICE_URL
For containerized local setup, defaults are provided in compose files.
docker compose -f docker-compose.yaml up -dcd patient-service && ./mvnw spring-boot:run
# in separate terminals:
cd billing-service && mvn spring-boot:run
cd analytics-service && mvn spring-boot:run
cd api-gateway && mvn spring-boot:runRun in each module:
# wrapper-based
./mvnw test
# maven-based
mvn test- Dockerfiles are present for services
- Compose stack available for local/integration deployment
- Kubernetes manifests can be added/extended as needed
From patient-service:
GET /api/v1/patientsGET /api/v1/patients/{id}POST /api/v1/patientsPUT /api/v1/patients/{id}DELETE /api/v1/patients/{id}
Example request (POST /api/v1/patients):
{
"firstName": "Jane",
"lastName": "Doe",
"email": "jane.doe@example.com",
"phoneNumber": "+1-555-123-4567",
"birthDate": "1990-01-15",
"registeredDate": "2024-01-15",
"gender": "FEMALE",
"address": "456 Elm Street"
}- Database connection issues
- Ensure PostgreSQL is running and credentials match service config.
- Kafka connectivity errors
- Verify Kafka broker host/port and Docker network readiness.
- gRPC call failures
- Confirm billing service is up and
BILLING_SERVICE_URLis correct.
- Confirm billing service is up and
- Port conflicts
- Update service
server.portvalues in config files.
- Update service
See CHANGELOG.md.
MIT — see LICENSE.