A desktop Hospital Management System built with Java Swing. The application provides role-based access for hospital staff and covers patient intake, medical records, pharmacy, billing, and user administration.
This project is a Windows desktop application for hospital staff. It supports multiple user roles, simple file-based persistence, and a custom Swing UI for managing patients, doctors, pharmacy stock, bills, and security audit logs.
- Secure login with username/password authentication
- Role-based access control for Admin, Receptionist, Doctor, Accountant, Pharmacist
- Patient management for OPD, Emergency, and Admitted care
- Doctor profiles and medical record entry
- Pharmacy inventory management and medicine issue logging
- Billing generation and accounting support
- Audit log tracking for user actions and security events
- Password change workflow and account lockout after failed login attempts
src/— Java source fileshospital/auth/— authentication flow, user management, password utilities, audit logginghospital/gui/— Swing UI components and application windowshospital/model/— domain classes for patients, doctors, records, medicines, billshospital/service/— business logic managers for patients, doctors, records, pharmacy, billinghospital/util/— shared utilities such as file handling
bin/— compiled class output (generated bycompile.bat, not included in repository)data/— runtime data files used for persistence (generated at runtime, not included in repository)compile.bat— compile Java source intobin/run.bat— launch the application
- Java JDK installed and available in
PATH - Windows environment (batch scripts provided)
- Recommended Java version: 8 or later
-
Clone the repository and open Command Prompt in the project root:
cd "Hospital Management System"
-
Compile the project:
.\compile.bat
-
Run the application:
.\run.bat
-
If using an IDE, import the folder as a Java project and set
hospital.gui.MainLauncheras the main class.
On first startup, the app creates a default administrator account if no users exist:
- Username:
admin - Password:
Admin@123
Important: change the admin password immediately after first login.
- All application data is stored in plain text files under
data/. - The
data/folder is created automatically at runtime — it is not included in the repository. - Keep the
data/folder in the same project root as the compiledbin/folder. - Removing or renaming files in
data/will reset stored state, including users, patients, bills, and logs.
- Compilation fails: verify
javacis available inPATHand thatbin/exists or can be created. - Application does not start: inspect console output for runtime exceptions and missing data file errors.
- User login issues: accounts are locked after 3 failed login attempts; use an admin account to unblock.
- Add a dedicated signup/register screen for new staff accounts
- Improve form validation and password-strength feedback
- Migrate persistence from plain text files to a database for reliability
- Add export/import support for reports and audit logs
This repository does not include an explicit license. Add a LICENSE file if you plan to distribute the project.