A scalable and modular Healthcare Management System built using a microservices architecture. This enterprise-grade solution enables seamless patient management, billing operations, analytics, and more, all while maintaining high security standards and performance.
- Key Features
- Tech Stack
- Project Structure
- Architecture
- Getting Started
- Inter-Service Communication
- Security
- Testing
- Environment Variables
- Useful Commands
- Contributing
- License
- Author
- Microservices Architecture: Modular, scalable, and maintainable services
- API Gateway: Centralized entry point with routing and cross-cutting concerns
- Authentication & Authorization: Secure user access control
- Patient Management: Comprehensive patient data management
- Billing Operations: Streamlined healthcare billing processes
- Analytics: Real-time and historical data analysis
- Containerization: Docker-based deployment for consistency across environments
Layer | Tech |
---|---|
Backend | Java 17, Spring Boot |
API Gateway | Spring Cloud Gateway |
Inter-Service Communication | gRPC |
Asynchronous Messaging | Apache Kafka |
Database | PostgreSQL |
Build Tool | Maven |
Containerization | Docker, Docker Compose |
Testing | JUnit, Integration Tests |
📁 analytics-service → Tracks and logs analytics data
📁 api-gateway → Handles routing and cross-cutting concerns
📁 api-requests → Shared DTOs across microservices
📁 auth-service → Handles user authentication and security
📁 billing-service → Manages billing operations and payment records
📁 grpc-requests → Protobuf contracts for gRPC communication
📁 infrastructure → Kafka, DB configurations, Docker setup
📁 integration-tests → System-wide integration tests
📁 patient-service → Manages patient records and data
📁 .vscode, .gitignore → Dev environment configurations
📄 docker-compose.yml → Spin up the entire system locally
Comprehensive architecture diagram coming soon!
The system follows a clean microservices architecture with:
- Bounded contexts: Each service handles a specific business domain
- API Gateway: Single entry point for external clients
- Service Discovery: Automatic registration and discovery of services
- Circuit Breaking: Preventing cascading failures across services
- Distributed Tracing: Tracking request flows across services
- Java 17+
- Docker & Docker Compose
- Maven 3.8+
- Kafka & PostgreSQL (auto-configured in Docker)
# Clone the repository
git clone https://github.com/khan-sk-dev/Healthcare-Microservices-System.git
cd Healthcare-Microservices-System
# Start all services using Docker Compose
docker-compose up --build
Used for internal synchronous communication between microservices (e.g., patient-service
↔ billing-service
).
Each service contains:
- Protobuf
.proto
definitions insidegrpc-requests
protobuf-maven-plugin
setup inpom.xml
- gRPC server/client configurations
Used for asynchronous messaging (e.g., notifications, logging).
Kafka Topics Example:
spring.kafka.bootstrap-servers=kafka:9092
spring.kafka.consumer.group-id=healthcare-group
spring.kafka.template.default-topic=healthcare-events
Kafka topics are produced and consumed in services like notification-service
and analytics-service
.
auth-service
implements Spring Security- JWT for token handling
- Login and token verification endpoints
- Secured internal and public APIs
- Role-based access control
- Unit tests across microservices
- Integration tests using
integration-tests
module - JUnit and Spring Boot Test used for coverage
- Continuous integration with automated test execution
Each microservice supports the following .env
or system variables:
Variable | Description |
---|---|
SPRING_DATASOURCE_URL |
PostgreSQL DB URL |
KAFKA_BOOTSTRAP_SERVERS |
Kafka broker location |
JWT_SECRET |
Secret key for token signing |
SERVER_PORT |
Custom port per microservice |
# Clean and install all services
mvn clean install
# Compile Protobuf contracts
mvn protobuf:compile
# View running services
docker ps
# View service logs
docker-compose logs -f [service-name]
# Run specific service
docker-compose up -d [service-name]
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
- Fork the project
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
صہیب خان – GitHub