PatientHUB is a scalable, event-driven microservices project that simulates a real-world hospital management system. It handles patient records, authentication, billing, and analytics using modern enterprise technologies like Spring Boot, gRPC, Kafka, Docker, and JWT-secured API Gateway.
- Spring Boot – REST API development
- Spring Security + JWT – Authentication and Authorization
- gRPC – Inter-service communication (Patient → Billing)
- Apache Kafka – Real-time event streaming (Patient → Analytics)
- Docker – Containerization for each service
- PostgreSQL / H2 – Databases
- OpenAPI (Swagger) – API documentation
- Spring Cloud Gateway – Central API Gateway for routing
- Build a production-grade healthcare backend system
- Handle secure patient CRUD operations
- Automate billing upon patient creation via gRPC
- Stream patient data for analytics via Kafka
- Secure and centralize access with API Gateway and JWT
- CRUD operations on patient data
- Validates input and throws custom exceptions
- Calls Billing Service via gRPC upon creation
- Publishes Kafka events for analytics
- Receives gRPC requests from Patient Service
- Creates billing accounts for new patients
- Future-ready for invoice/payment integration
- Kafka consumer for patient data events
- Processes and logs insights for real-time analytics
- Can be extended with dashboards (Grafana, ELK)
- User login and registration
- Secure token generation using JWT
- Validates users for protected routes
- Single entry-point to all services
- Applies JWT token filters
- Handles route mapping and security policies
Client ⇄ API Gateway ⇄ Auth / Patient Services
⇓
Patient Service ⇄ gRPC ⇄ Billing Service
⇓
Kafka (Patient Events)
⇓
Analytics Service (Consumer)
- Docker & Docker Compose
- Java 17+
- Maven
- Postman / IntelliJ HTTP Client
-
Clone the repo:
git clone https://github.com/your-username/patienthub.git
-
Build and run services:
./mvnw clean package -DskipTests docker-compose up --build
-
Access APIs:
- API Gateway:
http://localhost:8080 - Swagger Docs:
http://localhost:8080/swagger-ui.html
- API Gateway:
patienthub/
├── api-gateway/
├── auth-service/
├── patient-service/
├── billing-service/
├── analytics-service/
├── docker-compose.yml
└── api-requests/
- ✅ Secure and centralized routing
- ⚙️ Event-driven and reactive communication
- 📈 Real-time analytics via Kafka
- 🧪 Manual API testing using
.httprequest files - 📦 Production-ready with Docker and DB setup
- Admin dashboard with patient and billing insights
- Email notifications using Kafka Consumers
- Role-based access control (RBAC)
- CI/CD integration with GitHub Actions
This project is built as a hands-on implementation of a full-stack enterprise architecture inspired by real healthcare systems and YouTube tutorials.