This is a Java-based web application that manages patient registrations, appointments, and user logins for a hospital. Built using Servlets, JSP, and MySQL, this project provides a basic hospital workflow management interface for both admins and patients.
- 🧾 User Registration: Patients can register with email, password, and personal information.
- 🔐 Login System: Authenticates users securely and redirects based on role (Admin/Patient).
- 📄 Dynamic Dashboard: Displays personalized content after login.
- 🏥 Appointment Management: Patients can book appointments; admins can view and manage them.
- 🗃️ MySQL Integration: Data like user records and appointments are stored in a structured database.
- 📤 Auto Login After Registration: Once registered, the user is automatically logged in and redirected to their dashboard.
- Java (Servlets, JSP)
- Apache Tomcat
- HTML/CSS
- Eclipse IDE
- MySQL
- JDBC
- Git & GitHub
-
Clone the repository:
git clone https://github.com/your-username/Hospital-Management-System.git -
Import the project into Eclipse as a Maven or Dynamic Web Project.
-
Configure the database:
- Create a MySQL database (e.g., hospital_db)
- Run the provided SQL script or create required tables manually
-
Update database connection credentials in your DAO or utility class.
-
Deploy the project to Apache Tomcat from Eclipse.
-
Open browser and access:
http://localhost:8080/Hospital-Management-System/
A simple web-based hospital management system that allows admins, doctors, and users to manage appointments, doctors, and patient information efficiently.
- Login with default credentials:
admin / admin123 - Add, View, and Manage:
- Doctors
- Patients
- Appointments
- Specialists
- Update doctor details
- Monitor system dashboard stats
- Login with credentials provided by Admin
- View assigned patients
- Comment on patient records
- Update profile
- Change password
- Register and login
- Book appointments
- View appointment status
- Change password
Doctors have a login page similar to Admin. Credentials are provided by the Admin.
- Admin Dashboard for managing doctors, users, and appointments.
- Doctor dashboard with patient management and profile features.
- User interface for booking and tracking appointments.
- Role-based access for Admin, Doctor, and User.
All screenshots are located in the screenShort/ folder and referenced throughout this README.
Below document provides the instructions to set up the database for the Hospital Management System using MySQL. The system uses four tables to manage data related to users, doctors, specialists, and appointments.
- MySQL 8.0 or higher (you can use other versions as well)
- Basic understanding of SQL
- A MySQL client to execute the SQL queries (e.g., MySQL Workbench, phpMyAdmin, or command-line MySQL)
-
Create database in MySql I have used MySql 8.0 but you can use any.
CREATE DATABASE hospital_management_system- The database will consist of four tables: user_details, doctor, specialist, and appointment. Follow the steps below to create each table.
-
Create Tables 2.1 create
user_detailstablesCREATE TABLE user_details ( id INT NOT NULL AUTO_INCREMENT, full_name VARCHAR(45) NOT NULL, email VARCHAR(25) NOT NULL, password VARCHAR(20) NOT NULL, PRIMARY KEY (id));2.2 Create
doctortableCREATE TABLE doctor ( id INT NOT NULL AUTO_INCREMENT, full_name VARCHAR(20) NOT NULL, dob VARCHAR(20) NOT NULL, qualification VARCHAR(20) NOT NULL, specalist VARCHAR(20) NOT NULL, email VARCHAR(45) NOT NULL, mobno VARCHAR(20) NOT NULL, password VARCHAR(20) NOT NULL, PRIMARY KEY (id));2.3 Create
SpecalistTableCREATE TABLE specialist ( id INT NOT NULL AUTO_INCREMENT, spec_name VARCHAR(20) NOT NULL, PRIMARY KEY (id));2.4 Create
AppointmenttableCREATE TABLE appointment ( id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, user_id INT NOT NULL, fullname VARCHAR(20) NOT NULL, gender VARCHAR(20) NOT NULL, age VARCHAR(20) NOT NULL, appoint_date VARCHAR(20) NOT NULL, email VARCHAR(45) NOT NULL, phno VARCHAR(12) NOT NULL, diseases VARCHAR(25) NOT NULL, doctor_id INT NOT NULL, address VARCHAR(100) NOT NULL, status VARCHAR(100) NOT NULL, FOREIGN KEY (user_id) REFERENCES user_details(id) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY (doctor_id) REFERENCES doctor(id) ON UPDATE CASCADE ON DELETE CASCADE);
Feel free to fork and contribute. Pull requests are welcome.
For queries, open an issue.
















