A Django-based multi-hospital health management platform that centralizes patient records, appointment scheduling, pharmacy, laboratory, and real-time doctor-patient communication.
- Overview
- Objectives
- Core Features
- System Architecture
- User Roles
- Tech Stack
- Setup & Installation
- Usage
- API Endpoints
- UI Snapshots
- Configuration & Security
- Repository Layout
- About
- License
Managing patient records and healthcare workflows across multiple hospitals is complex, fragmented, and error-prone when handled manually. HealthStack System is a full-stack Django web application that digitizes and unifies healthcare operations across multiple hospitals on a single platform.
From the moment a patient registers, the system connects them with hospitals, doctors, laboratories, and pharmacies through a seamless, role-aware workflow:
- Discover — Patients search hospitals, browse departments, and find doctors
- Book — Patients book appointments; doctors accept or reject with automatic email notifications
- Treat — Doctors create prescriptions; lab workers generate reports — all downloadable as PDFs
- Pharmacy — Patients browse and cart medicines; pharmacists manage stock and billing
- Communicate — Doctors and patients chat in real time after appointment linkage
- Audit — Hospital admins oversee all transactions, billing records, and bed availability
The result: a transparent, efficient, and connected healthcare ecosystem for patients and providers alike.
| Goal | Description |
|---|---|
| 🏥 Centralize Records | Unify patient health records across multiple hospitals on one platform |
| 📅 Streamline Appointments | Automate the booking and acceptance workflow with email notifications |
| 💊 Digitize Pharmacy | Enable patients to browse, cart, and track medicine orders online |
| 🧪 Integrate Laboratory | Allow lab workers to create tests and reports accessible by patients |
| 💬 Enable Communication | Provide real-time doctor-patient chat via Django Channels |
| 🔐 Ensure Security | Enforce role-based access control with OTP-protected password changes |
| 🧾 Simplify Billing | Give patients a unified view of all payment types and statuses |
- Hospital Discovery — Search hospitals, browse departments, find and profile doctors
- Appointment Booking — Book appointments online; receive email confirmation on accept/reject
- Prescription Access — View and download doctor prescriptions as PDF
- Lab Results — View and download laboratory test reports as PDF
- Pharmacy Cart — Browse medicines, add to cart, and track payment status
- Lab Test Cart — Add/remove lab tests with live pricing
- Unified Billing — View all payments (appointments, pharmacy, lab) in one place
- Real-time Chat — Chat directly with your appointed doctor
- Doctor Reviews — Rate and review doctors after appointments
- Profile Management — Update blood group, NID, address, and date of birth
- OTP Password Change — Secure 6-digit OTP verification via email
- Profile Builder — Add education, experience, and certifications
- Multi-Hospital Registration — Register at multiple hospitals with certificate upload
- Appointment Management — Accept or reject patient appointments with email notifications
- Prescription Management — Create and manage patient prescriptions
- Patient Profiles — Search and view patient profiles and reports
- Schedule Management — Set and update availability timings
- Real-time Chat — Communicate with appointed patients
- OTP Password Change — Secure account management
- Admin Dashboard — Statistics overview of hospitals, staff, and transactions
- Hospital & Department CRUD — Manage multiple hospitals and their departments
- Staff Management — Create and manage Lab Worker and Pharmacist accounts
- Doctor Registry — View all registered doctors and their profiles
- Manual Billing — Create invoices and track all transaction records
- Bed Tracking — Manage General, ICU, Regular Cabin, Emergency Cabin, and VIP Cabin availability
- OTP Password Change — Secure account management
- Lab Dashboard — Overview of pending test orders
- Test Management — Create and manage hospital-specific tests with pricing
- Report Generation — Create patient lab reports
- Payment Tracking — Record test payment status
- Order Queue — View and manage incoming test orders
- Pharmacy Dashboard — Overview of medicine orders
- Medicine CRUD — Manage medicine inventory: name, weight, type, category, price, and stock
- Medicine Search — Quickly find medicines in the catalog
- Order Management — View patient orders and record payment status
Patient
│
├─ Search Hospitals / Departments / Doctors
├─ Book Appointment
├─ Cart: Medicines & Lab Tests
└─ Chat with Doctor
│
▼
┌──────────────────────┐
│ HealthStack DB │
│ (SQLite) │
└────────┬─────────────┘
│
┌─────────┴──────────┐
│ │
▼ ▼
┌─────────────┐ ┌─────────────────────┐
│ Doctor │ │ Hospital Admin │
│ Dashboard │ │ Dashboard │
│ (Accept / │ │ (Billing / Beds / │
│ Prescribe │ │ Staff / Reports) │
│ / Chat) │ └─────────────────────┘
└──────┬──────┘
│
┌────┴────┐
│ │
▼ ▼
┌──────┐ ┌──────────┐
│ Lab │ │Pharmacist│
│Worker│ │Dashboard │
└──────┘ └──────────┘
Patient Books ──► Pending ──► Doctor Reviews
│
┌─────────────┴────────────┐
▼ ▼
Accepted Rejected
(Email Sent) (Email Sent)
│
▼
Consultation ──► Prescription Created
│
▼
Patient Downloads PDF
Appointment ─┐
Pharmacy Cart ─┼──► Unified Billing View ──► Pay at Cashier / Counter
Lab Test Cart ─┘ (Patient)
| Role | Access Level |
|---|---|
| Patient | Search hospitals/doctors, book appointments, manage cart, view records, chat |
| Doctor | Manage profile/schedule, handle appointments, create prescriptions, chat |
| Hospital Admin | Full hospital management, billing, staff CRUD, bed tracking |
| Lab Worker | Create tests/reports, manage order queue, record payments |
| Pharmacist | Manage medicine inventory, view orders, record payments |
| Layer | Technology |
|---|---|
| Web Framework | Django 4.1.13 |
| Language | Python 3.10+ |
| Database | SQLite 3 |
| REST API | Django REST Framework 3.14 |
| Real-time Chat | Django Channels |
| PDF Generation | xhtml2pdf + ReportLab |
| Image Handling | Pillow 10.3 |
| Static Files | WhiteNoise 6.2 |
| Email Testing | Mailtrap SMTP |
| Form Rendering | django-widget-tweaks |
| Debugging | Django Debug Toolbar |
| Environment | django-environ / python-decouple |
| API Tunneling | ngrok HTTP |
- Python 3.10+
- pip
- Git
- Mailtrap account (for email notifications)
1. Clone the repository
git clone <repository-url>
cd HealthStack-System2. Create and activate a virtual environment
# Windows (PowerShell)
python -m venv venv
.\venv\Scripts\Activate# macOS / Linux
python3 -m venv venv
source venv/bin/activate3. Install dependencies
pip install -r requirements.txt4. Configure environment variables
Copy the example environment file and fill in your credentials:
cp .env.example .envOpen .env and set the required values — see .env.example for the full list. The key credentials to configure:
SECRET_KEY— Django secret keyEMAIL_HOST_USER/EMAIL_HOST_PASSWORD— Mailtrap SMTP credentials for email notifications
5. Upgrade JWT (optional but recommended)
pip install --upgrade djangorestframework-simplejwt6. Run database migrations
python manage.py migrate7. Start the development server
python manage.py runserverThe application will be available at http://127.0.0.1:8000/
- Register or log in at the home page
- Search for a hospital → browse departments → find a doctor
- View the doctor's profile and book an appointment
- Receive an email when the doctor accepts or rejects the booking
- After acceptance: view prescriptions, lab reports, and chat with your doctor
- Browse the pharmacy, add medicines to cart, and track payment status
- Add lab tests to your test cart and track results
- Register and build your profile (education, experience, certifications)
- Register at a hospital and upload your certificate
- Review incoming appointment requests — accept or reject with automatic patient notification
- Create and manage prescriptions for accepted patients
- Chat with appointed patients directly from your dashboard
- Log in to the admin dashboard
- Manage hospitals, departments, lab workers, and pharmacists
- Track bed availability across all cabin types
- Create patient invoices and view all transaction records
- Log in to the lab dashboard
- Create tests for the hospital with pricing
- Generate patient lab reports
- Record payment status and manage the order queue
- Log in to the pharmacy dashboard
- Manage medicine inventory (add, update, delete)
- View patient orders and record payment status
| Endpoint | Method | Description |
|---|---|---|
/api/token/ |
POST |
Obtain JWT authentication token |
/api/token/refresh/ |
POST |
Refresh an expired JWT token |
/api/hospitals/ |
GET |
List all registered hospitals |
/api/hospitals/<id>/ |
GET |
Retrieve a specific hospital's profile |
Note: The REST API uses JWT authentication via
djangorestframework-simplejwt. Include theAuthorization: Bearer <token>header for protected routes.
A visual tour of each role's dashboard and key pages.
| Landing Page |
|---|
![]() |
| Login Page |
|---|
![]() |
| Login Page |
|---|
![]() |
| Login Page |
|---|
![]() |
Login shared with Hospital Admin & Lab Worker — see Staff Login above (
/hospital_admin/)
Login shared with Hospital Admin & Pharmacist — see Staff Login above (
/hospital_admin/)
⚠️ Before deploying to production, review all of the following:
| Setting | Default | Recommendation |
|---|---|---|
DEBUG |
True |
Set to False and configure ALLOWED_HOSTS |
SECRET_KEY |
.env file |
Rotate and load from a secrets manager |
DATABASE |
SQLite | Migrate to PostgreSQL for production workloads |
| Static/Media files | Local media/ |
Move to S3/CDN and configure WhiteNoise |
| Mailtrap (testing) | Switch to a production SMTP provider (SendGrid, SES) | |
| WebSockets | Django Channels | Configure a production-grade channel layer (Redis) |
- OTP Password Verification — Password changes require a 6-digit OTP sent via email (10-minute expiry)
- Role-based Access Control — Separate dashboards and permissions for each user type
- Session Management — Login status tracking and secure logout
- Environment Isolation — All secrets managed via
.envusingdjango-environ/python-decouple
HealthStack-System/
├── healthstack/ # Django project: settings, urls, wsgi, asgi
├── hospital/ # Hospital models, views, search
├── hospital_admin/ # Admin dashboard, billing, bed tracking
├── doctor/ # Doctor profiles, appointments, prescriptions
├── pharmacy/ # Medicine inventory, cart, orders
├── ChatApp/ # Django Channels real-time chat
├── api/ # REST API endpoints (JWT, hospitals)
├── heath_doc/ # Core health records and patient views
├── sslcommerz/ # Payment gateway integration
├── sslcommerz_lib/ # SSLCommerz library
├── templates/ # Shared HTML templates
├── static/ # Project-level CSS, JS, images
├── media/ # Uploaded files (prescriptions, reports, profiles)
├── build/ # Build artifacts
├── setup.py # Setup configuration
├── manage.py
├── requirements.txt
├── .env.example # Environment variable template
└── db.sqlite3 # SQLite database (development)
HealthStack System was developed as a Software Engineering capstone project for the B.Sc. in Information Systems program. It was built to address the challenges of fragmented healthcare record-keeping and the lack of a unified platform for multi-hospital patient management.
The system brings together the full healthcare journey — from hospital discovery and appointment booking, through prescription management and lab testing, to pharmacy fulfillment and real-time communication — into a single, role-aware digital platform.
| 🎓 Program | B.Sc. in Information Systems |
| 🎯 Problem Solved | Fragmented, paper-based patient records and disconnected hospital workflows |
| 👥 Users Served | Patients, Doctors, Hospital Admins, Lab Workers, Pharmacists |
| 🗓️ Project Duration | April 2026 – May 2026 |
- Multi-Hospital Architecture — A single platform serves multiple hospitals, departments, and their respective staff, eliminating the need for separate systems per institution.
- Role-Based Dashboards — Each user type sees a purpose-built interface showing only the actions and data relevant to their role, reducing confusion and preventing unauthorized access.
- Real-time Communication — Django Channels powers a WebSocket-based chat feature, enabling direct doctor-patient communication after appointment linkage without third-party messaging tools.
- PDF-First Documents — Prescriptions and lab reports are generated as downloadable PDFs via
xhtml2pdf, providing a portable, printable record for patients. - OTP Security Layer — All password changes are gated behind a time-limited 6-digit OTP sent to the user's registered email, preventing unauthorized account takeovers.
- Unified Billing View — Rather than separate billing pages per service, patients see all charges (appointments, pharmacy, lab) in a single consolidated view.
This system was designed with patients and healthcare providers in mind — making healthcare coordination faster, clearer, and more accessible for everyone involved.
John Tyrone P. Coronel — TheUnshackled1
This project is licensed under the MIT License — see the LICENSE file for full details.
MIT License
Copyright (c) 2026 John Tyrone P. Coronel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.



