This project is a Healthcare Microservices System designed for self-learning and interview preparation. It includes services for authentication, appointments, doctor and patient management, notifications, and more. The system is implemented using Spring Boot, Kafka, MongoDB, ReactJS, and Docker.
-
Install the following tools:
- Java 17
- Maven
- Docker Desktop
- Docker Compose (if not bundled with Docker Desktop)
- MongoDB Compass (optional, for data inspection)
-
Configure email functionality:
- Update
MAIL_SERVER_USERNAMEandMAIL_SERVER_PASSWORDin thedocker-compose.ymlfile.
- Update
The project consists of the following microservices:
- Auth Service: Manages authentication and authorization.
- Doctor Service: Handles doctor-related operations.
- Patient Service: Handles patient-related operations.
- Appointment Service: Manages appointments and sends events to Kafka.
- Notification Service: Listens to Kafka events and sends notifications via email.
- Admin Service: Provides centralized monitoring using Spring Boot Admin.
- Gateway Service: Routes requests to other services and includes circuit breaker patterns.
- UI Service: A ReactJS-based frontend for user interaction.
- MongoDB: Stores data for all services.
- Kafka: Facilitates asynchronous communication between services.
Run the following command to build and start all services:
docker-compose up --build- Gateway API: http://localhost:8080
- Admin Panel: http://localhost:9093
- React UI: http://localhost:9090
Ensure the following environment variables are correctly set in the docker-compose.yml file:
- MongoDB:
MONGO_INITDB_ROOT_USERNAMEMONGO_INITDB_ROOT_PASSWORD
- Kafka:
KAFKA_BOOTSTRAP_SERVERKAFKA_TOPIC
- Mail Server:
MAIL_SERVER_HOSTMAIL_SERVER_PORTMAIL_SERVER_USERNAMEMAIL_SERVER_PASSWORD
-
Authentication:
- Register and log in using the Auth Service.
- Secure communication using JWT.
-
Service Monitoring:
- Admin Service provides centralized monitoring for all microservices.
-
Notification:
- Notification Service sends emails based on appointment status.
-
UI Integration:
- ReactJS frontend communicates with backend services via Gateway Service.
-
Asynchronous Communication:
- Kafka ensures event-driven communication between services.
-
MongoDB not starting:
- Ensure the
mongo-datavolume is correctly mounted. - Check if the port
27017is already in use.
- Ensure the
-
Kafka issues:
- Verify the
KAFKA_BOOTSTRAP_SERVERindocker-compose.yml.
- Verify the
-
Email sending errors:
- Confirm email credentials (
MAIL_SERVER_USERNAMEandMAIL_SERVER_PASSWORD).
- Confirm email credentials (
-
UI not loading:
- Ensure the UI Service is running at http://localhost:9090.
To stop all services, run:
docker-compose downMIT License