Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏥 Hospital Management REST API

A Spring Boot-based backend application for managing patients, doctors, and appointment bookings in a hospital setup.

✅ Features

  • Patient Registration
    • Add, update, delete, and list patient records.
  • Doctor Listing
    • Get all doctors with optional filtering by specialization.
  • Available Appointment Slots
    • View available time slots for a doctor on a given date.
  • Book Appointment
    • Book a time slot with a specific doctor if available.

🛠️ Tech Stack

  • Java 8+
  • Spring Boot
  • Spring Data JPA
  • MySQL
  • Lombok
  • Maven

📁 Project Structure

com.hospital
│
├── controller # REST Controllers
├── service # Business Logic
├── repository # Spring Data JPA Repositories
├── exception # Global Exception Handler
├── entity # JPA Entities
├── dto # Custom DTO classes
├── HospitalManagementApplication.java
└── application.properties

📦 APIs Overview

🔹 Patient APIs

Method Endpoint Description
POST /patient Add new patient
PUT /patient/{id} Update patient
DELETE /patient/{id} Delete patient
GET /patient List all patients

🔹 Doctor APIs

Method Endpoint Description
GET /doctor List all doctors
GET /doctor?specialization=Cardiology Filter by specialization

🔹 Appointment APIs

Method Endpoint Description
GET /appointments/slots?doctorId={id}&date=YYYY-MM-DD Get available time slots
POST /appointments/book Book appointment with doctor

Sample Request Payload:

{
  "patientId": "1",
  "doctorId": "2",
  "date": "2025-06-17",
  "time": "11:00"
}

⚙️ Getting Started

1. Clone the Repository

git clone https://github.com/yourusername/hospital-management-api.git
cd hospital-management-api

2. Configure MySQL

-Update src/main/resources/application.properties:
-spring.datasource.url=jdbc:mysql://localhost:3306/hospital
-spring.datasource.username=root
-spring.datasource.password=yourpassword
-spring.jpa.hibernate.ddl-auto=update
-spring.jpa.show-sql=true

3. Build and Run

-mvn clean install
-mvn spring-boot:run

Made with 💻 by Akrisht Yadav

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages