A Spring Boot REST API for managing hospital operations such as Patients, Doctors, Appointments, Insurance, and Departments. This project demonstrates the use of Spring Boot, Spring Data JPA, Hibernate, PostgreSQL, and RESTful APIs while following a layered architecture.
- 👨⚕️ Doctor Management
- 🧑 Patient Management
- 🏥 Department Management
- 📅 Appointment Scheduling
- 🛡️ Insurance Management
- 🔗 Entity Relationships using JPA
- ✅ Validation and Constraint Handling
- 🗄️ PostgreSQL Database Integration
- Java 22
- Spring Boot
- Spring Data JPA
- Hibernate ORM
- PostgreSQL
- Lombok
- Maven
- JUnit 5
src
├── controller
├── service
├── repository
├── entity
├── dto
├── exception
└── config
- Id
- Name
- Gender
- Date of Birth
- Blood Group
- Created At
- Id
- Name
- Specialization
- Id
- Time
- Reason
- Id
- Policy Number
- Provider
- Valid Until
- Created At
- Id
- Name
Patient
│
├─────────────── One-to-One ───────────────► Insurance
Patient
│
└────────────── One-to-Many ───────────────► Appointment
Doctor
│
└────────────── One-to-Many ───────────────► Appointment
Department
│
└────────────── One-to-Many ───────────────► Doctor
- One-to-One
- One-to-Many
- Many-to-One
- Dependency Injection
- Service Layer
- Repository Layer
- Entity Mapping
- Hibernate ORM
- Cascade Operations
- Fetching Data using JPA
- Derived Query Methods
- Transaction Management
- Constraint Handling
The project includes JUnit tests for:
- Patient Repository
- Insurance Assignment
- Appointment Creation
- Entity Relationships
Database: PostgreSQL
Example configuration:
spring.datasource.url=jdbc:postgresql://localhost:5432/hospitalDB
spring.datasource.username=postgres
spring.datasource.password=****
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=trueClone the repository
git clone https://github.com/your-username/hospital-management.gitNavigate into the project
cd hospital-managementRun using Maven
mvn spring-boot:runOr run the HospitalmanagementApplication class directly from your IDE.
This project helped in understanding:
- Spring Boot Architecture
- REST API Development
- Hibernate ORM
- Entity Relationships
- Database Normalization
- PostgreSQL Integration
- Layered Architecture
- Repository Pattern
- Transaction Management
- JUnit Testing
- JWT Authentication & Authorization
- Role-Based Access Control
- DTO Mapping using MapStruct
- Swagger/OpenAPI Documentation
- Global Exception Handling
- Pagination & Sorting
- Search & Filtering APIs
- Docker Support
- Spring Security
- File Uploads
- Email Notifications
- Audit Logging
Prabuddha Pal