Skip to content

AnilaAnilaN/HealthCare_management_system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯ Healthcare Management System

A modern, full-stack healthcare management application built with Spring Boot 4.0.2 and React, designed to streamline patient and doctor management with secure authentication.

πŸ“‹ Table of Contents


🎯 Overview

The Healthcare Management System is a comprehensive solution for managing healthcare operations. It provides a secure platform for:

  • User Authentication: Email-based registration with OTP verification
  • Patient Management: Complete patient records including medical history, allergies, and medications
  • Doctor Management: Doctor profiles with specializations, availability, and consultation fees
  • Role-Based Access: Secure access control with JWT authentication

This system aims to digitize and simplify healthcare administration, making it easier for healthcare providers to manage patient information and appointments efficiently.


✨ Features

Authentication & Security

  • βœ… Email-based user registration
  • βœ… OTP verification for email confirmation
  • βœ… JWT token-based authentication
  • βœ… Password encryption with BCrypt
  • βœ… Secure session management

Patient Management

  • βœ… Create, read, update, and delete patient records
  • βœ… Comprehensive patient profiles (personal info, medical history, allergies)
  • βœ… Emergency contact information
  • βœ… Blood group and vital statistics
  • βœ… Search patients by name

Doctor Management

  • βœ… Doctor profiles with specialization and qualifications
  • βœ… License number verification
  • βœ… Consultation fees (in-person and online)
  • βœ… Available days and consultation hours
  • βœ… Filter doctors by specialization or department

Additional Features

  • βœ… Soft delete functionality (records marked inactive, not deleted)
  • βœ… Global exception handling
  • βœ… Input validation
  • βœ… RESTful API design
  • βœ… CORS support for frontend integration

πŸ› οΈ Tech Stack

Backend

  • Framework: Spring Boot 4.0.2
  • Language: Java 25 (LTS)
  • Database: Oracle Database 23ai Free
  • Security: Spring Security + JWT
  • ORM: JPA/Hibernate
  • Build Tool: Maven
  • Email: JavaMailSender (SMTP)

Frontend

  • Framework: React 18
  • Build Tool: Vite
  • Styling: Tailwind CSS v4
  • HTTP Client: Axios
  • Routing: React Router v7

πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed:

  • JDK 25 (or JDK 17/21)
  • Maven 3.6+
  • Oracle Database 23ai Free (or any Oracle DB version)
  • Node.js 18+ and npm (for frontend)
  • Git

πŸš€ Installation

1. Clone the Repository

git clone https://github.com/yourusername/healthcare-management-system.git
cd healthcare-management-system

2. Set Up Oracle Database

Download and install Oracle Database 23ai Free:

https://www.oracle.com/database/technologies/oracle-database-software-downloads.html

Create database user:

sqlplus sys as sysdba

CREATE USER HEALTHCARE_USER IDENTIFIED BY YourPassword123;
GRANT CONNECT, RESOURCE TO HEALTHCARE_USER;
GRANT CREATE SESSION TO HEALTHCARE_USER;
GRANT CREATE TABLE TO HEALTHCARE_USER;
GRANT CREATE SEQUENCE TO HEALTHCARE_USER;
GRANT UNLIMITED TABLESPACE TO HEALTHCARE_USER;
EXIT;

3. Install Backend Dependencies

cd backend
./mvnw clean install

4. Install Frontend Dependencies

cd frontend
npm install

βš™οΈ Configuration

Backend Configuration

Edit backend/src/main/resources/application.properties:

# Database
spring.datasource.url=jdbc:oracle:thin:@localhost:1521:FREE
spring.datasource.username=HEALTHCARE_USER
spring.datasource.password=YourPassword123

# Email (Gmail)
spring.mail.username=your-email@gmail.com
spring.mail.password=your-gmail-app-password

# JWT Secret (change this!)
jwt.secret=your-super-secret-jwt-key-minimum-256-bits-long

Get Gmail App Password:

  1. Go to Google Account β†’ Security
  2. Enable 2-Step Verification
  3. App Passwords β†’ Generate new app password
  4. Copy the 16-character password

Frontend Configuration

Create frontend/.env:

VITE_API_BASE_URL=http://localhost:8080

πŸƒ Running the Application

Start Backend Server

cd backend
./mvnw spring-boot:run

Backend will run on: http://localhost:8080

Start Frontend Development Server

cd frontend
npm run dev

Frontend will run on: http://localhost:5173


πŸ“š API Endpoints

Authentication

Method Endpoint Description
POST /api/auth/signup Register new user
POST /api/auth/verify Verify email with OTP
POST /api/auth/login Login user
POST /api/auth/resend-otp Resend OTP
GET /api/auth/health Health check

Patients (Protected - Requires JWT)

Method Endpoint Description
GET /api/patients Get all patients
GET /api/patients/{id} Get patient by ID
POST /api/patients Create new patient
PUT /api/patients/{id} Update patient
DELETE /api/patients/{id} Delete patient (soft)
GET /api/patients/search?name={name} Search patients

Doctors (Protected - Requires JWT)

Method Endpoint Description
GET /api/doctors Get all doctors
GET /api/doctors/{id} Get doctor by ID
POST /api/doctors Create new doctor
PUT /api/doctors/{id} Update doctor
DELETE /api/doctors/{id} Delete doctor (soft)
GET /api/doctors/search?name={name} Search doctors
GET /api/doctors/specialization/{spec} Get by specialization
GET /api/doctors/department/{dept} Get by department

πŸ—„οΈ Database Schema

Tables Created Automatically

  • USERS - User authentication and profiles
  • OTPS - Email verification codes
  • PATIENTS - Patient records and medical history
  • DOCTORS - Doctor profiles and availability

Sequences

  • USER_SEQ
  • OTP_SEQ
  • PATIENT_SEQ
  • DOCTOR_SEQ

πŸ§ͺ Testing the API

Example: User Signup

curl -X POST http://localhost:8080/api/auth/signup \
  -H "Content-Type: application/json" \
  -d '{
    "email": "john@example.com",
    "password": "Password123",
    "name": "John Doe"
  }'

Example: Create Patient (with JWT)

curl -X POST http://localhost:8080/api/patients \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -d '{
    "firstName": "Jane",
    "lastName": "Smith",
    "email": "jane@example.com",
    "phone": "+1234567890",
    "dateOfBirth": "1990-05-15",
    "gender": "FEMALE",
    "bloodGroup": "O+"
  }'

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘¨β€πŸ’» Author

Your Name

πŸ“ž Support

For support, email anilanawaz531@gmail.com or open an issue in the repository.

About

A modern, full-stack healthcare management application built with Spring Boot 4.0.2 and React, designed to streamline patient and doctor management with secure authentication.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages