A comprehensive, production-grade Spring Boot microservices project demonstrating modern distributed system design patterns, featuring multiple services working together through REST APIs, gRPC, Kafka, and event-driven messaging.
This is a complete microservices ecosystem built with Spring Boot 3.3.5+ / 4.0.0, Java 17, and showcasing real-world patterns like API Gateway routing, JWT authentication, inter-service communication via gRPC, and event-driven architecture using Kafka. Perfect for learning enterprise-grade backend development.
SpringbootMicroServicesProject/
βββ api-gateway/ # API Gateway (HTTP Port: 4004)
β βββ Spring Boot: 3.3.5
β βββ Routes: /auth/** β auth-service:4005
β β /api/patients/** β patient-service:4000
β βββ src/main/resources/application.yml
β
βββ patient-service/ # Patient CRUD (HTTP Port: 4000)
β βββ Spring Boot: 3.3.5
β βββ Java: 17
β βββ gRPC Client: calls billing-service:9001
β βββ Kafka Producer: publishes patient events
β βββ src/main/resources/application.properties
β
βββ auth-service/ # JWT Auth Service (HTTP Port: 4005)
β βββ Spring Boot: 3.3.5
β βββ Java: 17
β βββ Endpoints: /auth/login, /auth/validate
β βββ src/main/resources/application.properties
β
βββ billing-service/ # Billing via gRPC
β βββ Spring Boot: 4.0.0
β βββ Java: 17
β βββ HTTP Port: 4001
β βββ gRPC Port: 9001
β βββ gRPC Server: handles billing requests
β βββ src/main/resources/application.properties
β
βββ analytics-service/ # Kafka Consumer (HTTP Port: 4002)
β βββ Spring Boot: 3.3.5
β βββ Java: 17
β βββ Kafka Consumer: processes patient events
β βββ src/main/resources/application.properties
β
βββ api-requests/ # API Testing Collection
β βββ *.http files for IntelliJ/VS Code
β
βββ grpc-requests/ # gRPC Testing
β βββ *.proto files for testing
β
βββ docker-compose.yml # Infrastructure Setup
- Java 17 - Main programming language (JDK 17) - Verified
- Spring Boot 3.3.5 - Patient, Auth, Analytics, API Gateway services
- Spring Boot 4.0.0 - Billing Service
- Spring Web - REST API development
- Spring Data JPA - Object-relational mapping
- Spring Validation - Request validation
- PostgreSQL - Primary relational database
- Spring Data JPA - ORM layer
- gRPC 1.69.0 - Binary RPC protocol
- Patient Service β Billing Service (Port 9001)
- Protocol Buffers 3.25.5 - Service contracts
- Apache Kafka - Event streaming platform
- Kafka Producer - Patient Service publishes events
- Kafka Consumer - Analytics Service consumes events
- Spring Security - Security framework
- JWT - Stateless authentication
- BCrypt - Password hashing
- Docker - Container images for each service
- Docker Compose - Multi-container orchestration
- PostgreSQL (Containerized) - Database container
- Kafka (Containerized) - Message broker
- Maven 3 - Build automation
- Spring Boot DevTools - Hot reload
- Springdoc OpenAPI 2.6.0 - Swagger/OpenAPI documentation
| Service | HTTP Port | gRPC Port | Tech | Spring Boot |
|---|---|---|---|---|
| API Gateway | 4004 | - | Spring Cloud Gateway | 3.3.5 |
| Patient Service | 4000 | - | REST + gRPC Client | 3.3.5 |
| Auth Service | 4005 | - | JWT Auth | 3.3.5 |
| Billing Service | 4001 | 9001 | gRPC Server | 4.0.0 |
| Analytics Service | 4002 | - | Kafka Consumer | 3.3.5 |
Note: All services use Java 17 as configured in pom.xml files
- Java 17 JDK (Required - verified in all pom.xml files)
- Maven 3.8+
- Docker & Docker Desktop
- Git
git clone https://github.com/PeddintiPraneeth759/SpringbootMicroServicesProject.git
cd SpringbootMicroServicesProjectdocker-compose up -d
docker-compose psmvn clean installTerminal 1: API Gateway (Port 4004)
cd api-gateway && mvn spring-boot:runTerminal 2: Patient Service (Port 4000)
cd patient-service && mvn spring-boot:runTerminal 3: Auth Service (Port 4005)
cd auth-service && mvn spring-boot:runTerminal 4: Billing Service (Port 4001 + gRPC 9001)
cd billing-service && mvn spring-boot:runTerminal 5: Analytics Service (Port 4002)
cd analytics-service && mvn spring-boot:run# Access API Gateway (Port 4004)
curl http://localhost:4004/auth/login
# Check Patient Service through Gateway
curl http://localhost:4004/api/patients
# Check Individual Services
curl http://localhost:4000/patients # Patient Service
curl http://localhost:4005/ # Auth Service
curl http://localhost:4002/ # Analytics Service
curl http://localhost:4001/ # Billing Service (HTTP)POST /auth/login # Get JWT token
POST /auth/validate # Validate token
GET /api/patients # List patients
GET /api/patients/{id} # Get patient by ID
POST /api/patients # Create patient
PUT /api/patients/{id} # Update patient
DELETE /api/patients/{id} # Delete patient
Full API Docs: http://localhost:4004/swagger-ui.html
curl -X POST http://localhost:4004/auth/login \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"admin123"}'curl -X GET http://localhost:4004/api/patients \
-H "Authorization: Bearer <JWT_TOKEN>"curl -X POST http://localhost:4004/auth/validate \
-H "Authorization: Bearer <JWT_TOKEN>"- Client β API Gateway (4004)
- API Gateway β Patient Service (4000) / Auth Service (4005)
- Patient Service (4000) β Billing Service gRPC (9001)
- Type-safe message serialization via Protocol Buffers
- Patient Service (4000): Publishes
patient-eventstopic - Analytics Service (4002): Consumes and processes events
- Event schema defined in Protobuf
mvn test
cd patient-service && mvn testmvn verifyUse files in api-requests/ directory for IntelliJ/VS Code HTTP testing
Use utilities in grpc-requests/ directory
lsof -i :4000 # Check Patient Service port
kill -9 <PID> # Kill processdocker-compose logs postgres
# Check application.properties credentialsdocker-compose logs kafka
docker exec kafka kafka-topics.sh --list --bootstrap-server localhost:9092netstat -an | grep 9001
# Verify Billing Service is running on port 4001
mvn clean compile # Recompile proto filesjava -version # Verify Java 17 is installed
update-alternatives --config java # Switch to Java 17- Swagger UI: http://localhost:4004/swagger-ui.html
- OpenAPI Spec: http://localhost:4004/v3/api-docs
- Service Ports Reference: See table above
- Proto Files: Contain gRPC service contracts
git checkout -b feature/YourFeature
git commit -m 'Add YourFeature'
git push origin feature/YourFeatureOpen a Pull Request!
This project demonstrates:
- β Microservices architecture (5 independent services)
- β REST API development with Spring Boot
- β gRPC & Protocol Buffers (Patient β Billing communication)
- β Kafka event streaming (Patient β Analytics)
- β JWT authentication & authorization
- β API Gateway pattern & routing
- β Database design with JPA/Hibernate
- β Docker containerization
- β Service-to-service communication
- β Error handling & validation
MIT License - see LICENSE for details
Praneeth Peddinti
- GitHub: @PeddintiPraneeth759
- Email: [email protected]
- Spring Boot 3.3.5
- Spring Boot 4.0.0
- Java 17 Documentation
- gRPC Java Guide
- Apache Kafka
- Spring Cloud Gateway
- JWT Authentication
Last Updated: December 2025 Status: Active Development Java Requirement: Java 17+ Spring Boot Versions: 3.3.5 & 4.0.0 Verified Port Configuration: All ports tested and documented