medisync is a sample backend system for managing healthcare data, built in Java with Spring. It includes separate microservices with their own MySQL databases, and a module that translates natural language requests into API calls using an LLM.
Auth Service
: User registration, login, password resetPatient Service
: Patient profile managementDoctor Service
: Doctor availability and profileAppointment Service
: Scheduling and managing appointmentsAI Assistant Service
: Natural language processing and REST API mapping- Each service has its own database
The system is structured in the following layers:
-
Client Applications
- Web Application
- Mobile Application
-
Service Discovery
- Eureka Server: Central registry for all microservices
-
API Gateway
- Handles:
- JWT Token validation
- Routing
- Rate Limiting
- Load Balancing
- Service Discovery integration
- Handles:
-
External Storage
- AWS S3 (planned) for storing medical documents and images
-
Database Layer
- Individual databases per service:
medisync_auth_db
,medisync_doctor_db
,medisync_patient_db
,medisync_appointments_db
- Individual databases per service:
Below is the system architecture diagram of medisync:
- Java 17
- Spring Boot
- Spring Cloud Netflix Eureka
- Spring Cloud Gateway
- Spring Data JPA
- MySQL
- Maven
- Purpose: Service discovery and registration
- Port: 8761 (default)
- Features:
- Central registry for all microservices
- Health monitoring
- Load balancing support
- Purpose: Single entry point for all client requests
- Features:
- Request routing to appropriate microservices
- JWT token validation
- Rate limiting
- Load balancing
- Service discovery integration
- Purpose: User authentication and authorization
- Features:
- User registration and login
- JWT token generation and validation
- Password management
- Role-based access control
- Purpose: Doctor profile and management
- Features:
- Doctor profile management
- Availability scheduling
- Specialization management
- Purpose: Patient profile and management
- Features:
- Patient profile management
- Medical history tracking
- Personal information management
- Purpose: Simplifies user interaction through natural language processing
- Features:
- Accepts natural language requests (e.g., "get all users")
- Maps requests to appropriate REST API endpoints using an LLM
- Sends HTTP requests to internal microservices
- Formats and returns structured responses to users
- Add Medical Records Service (EHR/EMR)
- Add Appointment Service
- Add Notification Service
- Integrate Message Broker (e.g., Kafka or RabbitMQ)
- CI/CD Pipeline
- Docker & Kubernetes support
- Monitoring and Logging (ELK Stack)
- Database migration to PostgreSQL
- Java 17
- Maven 3.6+
- MySQL 8.0+
- IntelliJ IDEA (recommended)
-
Start Eureka Server
cd eureka-server mvn spring-boot:run
-
Start API Gateway
cd api-gateway mvn spring-boot:run
-
Start Microservices
# Auth Service cd auth-service mvn spring-boot:run # Doctor Service cd doctor-service mvn spring-boot:run # Patient Service cd patient-service mvn spring-boot:run # AI Assistant Service cd ai-assistant-service mvn spring-boot:run
- Eureka Dashboard:
http://localhost:8761
- API Gateway:
http://localhost:8080
- Auth Service:
http://localhost:8081
- Doctor Service:
http://localhost:8082
- Patient Service:
http://localhost:8083
- AI Assistant Service:
http://localhost:8084
Enjoy, and feel free to contribute!