How joro97/microservices-hospital-webapp works
This repository implements a hospital scheduling web application, with a browser frontend, an OAuth authorization server, a hospital API, and a skin-lesion detection service plus model-training code. The main user workflow is authentication followed by doctor discovery and appointment booking; doctor profiles, availability, and booking are backed by hospital-service. Separate capabilities include file/avatar handling, likes, and lesion prediction. The README documents the cloud-native scheduling product, but the excerpts do not establish most cross-service wiring; dashed, unevidenced links mark likely integration points rather than verified calls.
Main entry points: DoctorsController.java Doctor and schedule API · DBFileStorageServiceImpl.java File storage service · auth.guard.ts Role-based route guard · doctors.component.ts Doctor discovery and profiles
Components 23
Web application
- Login and registration
frontend/src/app/account/login/login.component.ts - Authentication service
frontend/src/app/core/services/authentication.service.ts - Role-based route guard
frontend/src/app/core/helpers/auth.guard.ts - Doctor discovery and profiles
frontend/src/app/doctors/doctors.component.ts - Appointment booking
frontend/src/app/doctors/appointment/appointment.component.ts - Booked hours
frontend/src/app/patients/booked-hours/booked-hours.component.ts - Lesion detection UI
frontend/src/app/doctors/doctor-lesion-detection/doctor-lesion-detection.component.ts
Hospital API
- Doctor and schedule API
hospital-service/src/main/java/com/hospital/webapp/hospitalMicroservice/controllers/DoctorsController.java - Doctor scheduling service
hospital-service/src/main/java/com/hospital/webapp/hospitalMicroservice/services/interfaces/DoctorService.java - Doctor and schedule records
hospital-service/src/main/java/com/hospital/webapp/hospitalMicroservice/models/entity/Doctor.java - File upload and retrieval
hospital-service/src/main/java/com/hospital/webapp/hospitalMicroservice/controllers/FileController.java - File storage service
hospital-service/src/main/java/com/hospital/webapp/hospitalMicroservice/services/services/DBFileStorageServiceImpl.java - Stored files
hospital-service/src/main/java/com/hospital/webapp/hospitalMicroservice/models/entity/DBFile.java - Doctor likes
hospital-service/src/main/java/com/hospital/webapp/hospitalMicroservice/controllers/LikesController.java
Identity service
- OAuth and user endpoints
oauth-authorization-server/src/main/java/com/baeldung/controller/TokenController.java - User and role service
oauth-authorization-server/src/main/java/com/baeldung/service/HospitalUserDetailsService.java - User and authority repositories
oauth-authorization-server/src/main/java/com/baeldung/repository/UserRepository.java
Lesion prediction
- Prediction endpoint
skin-lesion-detection-service/src/controller/predict_controller.py - Lesion detection model
skin-lesion-detection-service/src/model/lesion_detection_model.py
Model training
- Dataset preprocessing
skin-cancer-model-training/src/prepare/preprocessor.py - Model training and evaluation
skin-cancer-model-training/src/train/train_and_eval.py - Training model definition
skin-cancer-model-training/src/train/definitions.py
Other components
- Patient or doctor
Connections 22
- Patient or doctor → Login and registration: enters credentials
- Login and registration → Authentication service: requests login
frontend/src/app/account/login/login.component.ts - Authentication service → OAuth and user endpoints: requests token
frontend/src/app/core/services/authentication.service.ts - OAuth and user endpoints → User and role service: authenticates users
- User and role service → User and authority repositories: loads and saves
oauth-authorization-server/src/main/java/com/baeldung/service/HospitalUserDetailsService.java - Doctor discovery and profiles → Role-based route guard: requires role access
frontend/src/app/doctors/doctors.routing.ts - Appointment booking → Role-based route guard: requires role access
frontend/src/app/doctors/doctors.routing.ts - Booked hours → Role-based route guard: requires role access
frontend/src/app/patients/patients.routing.ts - Doctor discovery and profiles → Doctor and schedule API: loads doctors
- Appointment booking → Doctor and schedule API: books appointment
- Booked hours → Doctor and schedule API: loads bookings
- Doctor and schedule API → Doctor scheduling service: delegates scheduling
hospital-service/src/main/java/com/hospital/webapp/hospitalMicroservice/controllers/DoctorsController.java - Doctor scheduling service → Doctor and schedule records: reads and updates
hospital-service/src/main/java/com/hospital/webapp/hospitalMicroservice/services/interfaces/DoctorService.java - File upload and retrieval → File storage service: stores or retrieves
hospital-service/src/main/java/com/hospital/webapp/hospitalMicroservice/controllers/FileController.java - File storage service → Stored files: persists file data
hospital-service/src/main/java/com/hospital/webapp/hospitalMicroservice/services/services/DBFileStorageServiceImpl.java - File storage service → Doctor and schedule records: updates doctor avatar
hospital-service/src/main/java/com/hospital/webapp/hospitalMicroservice/services/services/DBFileStorageServiceImpl.java - Patient or doctor → Doctor likes: likes doctor
- Lesion detection UI → Prediction endpoint: requests prediction
- Prediction endpoint → Lesion detection model: runs inference
skin-lesion-detection-service/src/controller/predict_controller.py - Dataset preprocessing → Training model definition: uses definitions
skin-cancer-model-training/src/prepare/preprocessor.py - Model training and evaluation → Training model definition: uses definitions
- Model training and evaluation → Lesion detection model: provides trained weights