A Spring Boot REST API for managing hospital operations, developed as part of a university coursework project. The system handles users, doctors, appointments, and medical reports with full CRUD functionality and secure access.
hospital-api/
βββ hospital-coursework/
βββ .gitignore
βββ mvnw / mvnw.cmd
βββ pom.xml
βββ .mvn/
β βββ wrapper/
β βββ maven-wrapper.jar
β βββ maven-wrapper.properties
βββ src/
βββ main/
β βββ java/
β β βββ com/
β β βββ brovko/
β β βββ hospitalcoursework/
β β βββ HospitalCourseworkApplication.java
β β βββ configuration/
β β β βββ security/
β β β βββ AuthenticationFacade.java
β β β βββ IAuthenticationFacade.java
β β β βββ MyUserDetails.java
β β β βββ SecurityConfig.java
β β βββ controller/
β β β βββ AppointmentController.java
β β β βββ DocInfoController.java
β β β βββ ExceptionHandlerController.java
β β β βββ MedicalReportController.java
β β β βββ UserController.java
β β βββ exception/
β β β βββ LogNotFoundException.java
β β β βββ RoleException.java
β β βββ model/
β β β βββ AppointmentPOJO.java
β β β βββ DocInfoPOJO.java
β β β βββ MedicalReportPOJO.java
β β β βββ RoleNamePOJO.java
β β β βββ UserPOJO.java
β β β βββ UserRolePOJO.java
β β β βββ UserView.java
β β βββ repository/
β β β βββ AppointmentRepository.java
β β β βββ DocInfoRepository.java
β β β βββ MedicalReportRepository.java
β β β βββ RoleNameRepository.java
β β β βββ UserRepository.java
β β β βββ UserRoleRepository.java
β β βββ service/
β β βββ AppointmentService.java
β β βββ DocInfoService.java
β β βββ MedicalReportService.java
β β βββ UserDetailsServiceImpl.java
β β βββ UserService.java
β βββ resources/
β βββ application.properties
βββ test/
βββ java/
- Modular clean architecture
- Full REST API for users, doctors, appointments, and medical reports
- Custom Spring Security configuration and user authentication
- DTOs and POJOs for clean model-view separation
- Exception handling and input validation
Custom Spring Security setup:
SecurityConfigβ defines rules, encoders, access restrictionsMyUserDetailsβ bridges domain model with Spring SecurityAuthenticationFacadeβ gets the current logged-in userUserDetailsServiceImplβ loads credentials from the database
GET /usersGET /users/{id}PUT /users/{id}POST /usersDELETE /users/{id}GET /users/doctors/detailsGET /users/doctors/{id}/detailsPUT /users/doctors/{id}/detailsPOST /users/doctors/{docId}/details
GET /appointmentsGET /appointments/{id}PUT /appointments/{id}POST /appointmentsDELETE /appointments/{id}
GET /medical-reportsGET /medical-reports/{id}PUT /medical-reports/{id}POST /medical-reportsDELETE /medical-reports/{id}
- Java 17+
- Spring Boot
- Spring Web
- Spring Data JPA
- Spring Security
- Maven
- Lombok
- MySQL
git clone https://github.com/your-username/hospital-api.git
cd hospital-api/hospital-coursework
./mvnw clean install
./mvnw spring-boot:runAccess the API at: http://localhost:8080/
π§ Configuration
Edit:
src/main/resources/application.properties
To configure:
- DB (MySQL)
- Server port
- Hibernate, logging, etc.