A Python and Tkinter desktop application demonstrating patient, doctor, secretary, and appointment-management workflows backed by MySQL.
This is an academic, learning-oriented desktop project. It is not production hospital software and must not be used with real patient data.
The reorganized source was compiled and dependency-tested with Python 3.12.13. The environment used for the repository audit did not include a MySQL server, so database import and end-to-end role flows were not claimed as runtime verified. A controlled missing-database launch test confirmed that the application reports a readable startup error instead of exposing a traceback to the user.
| Check | Result |
|---|---|
| Clean virtual environment and dependency install | Passed |
| Python compilation and module imports | Passed |
| Asset existence and image decoding | Passed |
| MySQL SQL dialect parsing | Passed |
| Missing database configuration handling | Passed |
| Live MySQL import and end-to-end role flows | Not run; MySQL server unavailable |
The application contains three role-specific flows:
| Role | Implemented capabilities |
|---|---|
| Patient | Registration, sign-in, patient information, specialty and doctor selection, date and time selection, appointment creation, active appointment list, and completed appointment list |
| Doctor | Sign-in, approved appointment list, assigned patient details, complaint visibility, and marking an approved appointment as completed |
| Secretary | Sign-in, complete appointment list, approving planned appointments, listing doctors, and registering a doctor |
These capabilities were established through a complete source and SQL audit. They require a correctly configured local MySQL database to operate.
- A patient registers or signs in.
- The patient selects a specialty.
- The application presents doctors with name, surname, and specialty while retaining the database ID separately.
- The patient selects a date and an explicit time slot.
- Past date and time values are rejected.
- The appointment is stored with the
Planlananstatus. - The database prevents a doctor from receiving two appointments at the same date and time.
- A secretary can change a planned appointment to
Onaylanan. - The assigned doctor can change an approved appointment to
Tamamlandı.
Appointment updates use the appointment primary key rather than applying a status change to every record belonging to a doctor.
- Python 3
- Tkinter
- MySQL
mysql-connector-python- Pillow
tkcalendarpython-dotenv
The schema uses seven InnoDB tables with utf8mb4_turkish_ci collation.
| Table | Purpose |
|---|---|
hastalar |
Patient identity, contact, local login, and profile fields |
doktorlar |
Doctor identity, specialty, contact, and local login fields |
sekreterler |
Secretary identity, contact, and local login fields |
randevular |
Appointment date/time, patient, doctor, status, and complaint |
hasta_randevu |
Retained patient-to-appointment junction table |
doktor_randevu |
Retained doctor-to-appointment junction table |
sekreterler_randevu |
Retained secretary-to-appointment junction table |
The current Python application reads relationships directly from the foreign
keys in randevular; the three junction tables are retained from the academic
schema but are not queried by the application.
Supported appointment statuses are:
PlanlananOnaylananTamamlandı
.
├── app/
│ ├── assets/
│ │ ├── icons/
│ │ └── images/
│ ├── database.py
│ └── main.py
├── database/
│ ├── sample-data.sql
│ └── schema.sql
├── .env.example
├── .gitignore
├── README.md
└── requirements.txt
Prerequisites:
- Python 3.10 or newer
- A local MySQL server
- MySQL command-line client or another tool capable of importing SQL files
Windows PowerShell:
git clone https://github.com/UAJOP/Hospital-Appointment-System.git
Set-Location Hospital-Appointment-System
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
Copy-Item .env.example .envEdit .env with the credentials for a local development database:
DB_HOST=localhost
DB_PORT=3306
DB_USER=root
DB_PASSWORD=your_mysql_password
DB_NAME=hastaneImport the schema first and the synthetic sample data second:
Get-Content -Raw database/schema.sql | mysql -u root -p
Get-Content -Raw database/sample-data.sql | mysql -u root -pThen run:
python app/main.pyAsset paths are resolved from the source file location, so the application is not dependent on the shell's current working directory.
The sample data contains synthetic local demo accounts only.
| Role | Username | Password |
|---|---|---|
| Patient | demo_patient |
demo123 |
| Doctor | demo_doctor |
demo123 |
| Secretary | demo_secretary |
demo123 |
Additional synthetic doctor: demo_doctor_two / demo123.
- The archived learning implementation stores and compares passwords as plain text. This approach must not be used in production systems.
- There are no production security controls, encryption guarantees, or healthcare-compliance claims.
- The project requires a separately configured local MySQL server.
- Live MySQL import and end-to-end UI flows were not executed in the audit environment because no database server was available.
- There is no automated test suite.
- Patient appointment cancellation and editing are not implemented.
- Secretary management is limited to doctor registration, doctor listing, appointment listing, and planned-appointment approval.
- The doctor/time unique constraint prevents doctor double-booking, but the schema does not prevent a patient from booking two different doctors at the same time.
- The interface is desktop-only and does not provide email/SMS notifications, a web client, or a mobile client.