Unified Healthcare Queue & Secure Prescription Portal
A high-performance, privacy-first, full-stack medical gateway linking Doctors, Patients, and Pharmacies into a secure paperless network.
Patients join waiting lists by scanning the clinic's unique Chamber UUID. The dashboard tracks progress with live blinking status bars:
- 🟠 Doctor is seeing: ANOTHER PATIENT — Flashes amber when the doctor is currently busy in consultation.
- 🟢 Doctor is seeing: YOU — Flashes green when the doctor calls you into the chamber.
- ⚪ Doctor is currently: IDLE — Displays when the chamber is currently waiting for the next patient.
MediQR supports both connected and zero-connectivity environments (such as hospital basements):
- Online Mode (JWT Token): Generates a cryptographically signed 5-minute security token. Pharmacies verify it via the API.
- Offline Mode (QR Passport): Serializes the latest prescription details directly into a compressed Base64 payload embedded inside the QR code. Allows pharmacies to scan and decrypt prescriptions instantly with zero internet access.
[ Patient ] === (Scan Chamber QR) ===> [ Live Queue Room ]
| || (Doctor Calls Next)
| <== (Consultation & RX Issued) <=========||
|
+--- [ Online Mode ] ===> (5-Min Signed JWT) =====> [ Pharmacy Dashboard ]
| || (Verifies & Decrypts)
+--- [ Offline Mode ] ===> (Base64 QR Passport) ============> [ Dispenses Medicine ]
erDiagram
users ||--o| chambers : "doctor_id (one-to-one)"
users ||--o{ queues : "patient_id"
users ||--o{ prescriptions : "patient_id / doctor_id"
chambers ||--o{ queues : "chamber_id"
users {
UUID id PK "Unique identifier"
string role "patient | doctor | pharmacy"
string full_name "User profile name"
string username UK "Alphanumeric key"
string mobile "10-digit verify"
string pin_code "Postal reference"
string address "Residential info"
string hashed_password "Bcrypt secret"
}
chambers {
UUID id PK "Chamber ID"
UUID doctor_id FK "Linked doctor profile"
string clinic_name "Medical center title"
string city "City location"
string open_time "Start timing"
string close_time "End timing"
string qr_code_key UK "Unique QR value UUID"
}
queues {
int id PK "Auto-increment ID"
UUID chamber_id FK "Chamber reference"
UUID patient_id FK "Patient reference"
string status "waiting | active | completed"
datetime joined_at "Audit timestamp"
}
prescriptions {
UUID id PK "Prescription ID"
UUID doctor_id FK "Treating doctor"
UUID patient_id FK "Assigned patient"
string medications "Prescribed drugs"
string instructions "Usage guidance notes"
datetime created_at "Issue timestamp"
}
- Navigate to the backend folder:
cd backend - Setup virtual environment:
python -m venv .venv # Windows: .venv\Scripts\Activate.ps1 # macOS/Linux: source .venv/bin/activate
- Install packages:
pip install fastapi uvicorn sqlalchemy psycopg2-binary pyjwt passlib bcrypt python-dotenv
- Define environment variables in
backend/.env:DB_USER=postgres DB_PASSWORD=your_password DB_HOST=127.0.0.1 DB_PORT=5432 DB_NAME=MEDIQR JWT_SECRET_KEY=4e92b3a8d6f1c7e9a2b5c8d0f1e2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0 ALGORITHM=HS256
- Spin up the FastAPI server:
uvicorn main:app --reload
- Navigate to the frontend folder:
cd frontend - Install Node modules:
npm install
- Start the Vite server:
npm run dev
You can run the entire application stack in containerized environments with a single command if you have Docker installed:
- Build and spin up the containers:
docker-compose up --build
- Access the portals:
- Frontend Web App:
http://localhost - Backend REST API:
http://localhost:8000
- Frontend Web App:
- Navigate to
http://127.0.0.1:8000/docs. - Under the
Developmentsection, runclear-all-usersto start fresh.
- Register a Doctor account (e.g.
dr_house) and log in. - Fill out the clinic details to generate your unique Chamber UUID QR Code.
- Copy the Chamber UUID string.
- Open two separate tabs. Register Patient A (
alice) and Patient B (bob). - Both patients paste the Chamber UUID and click Join Waiting Queue.
- Patient B immediately sees the live indicator:
Doctor is consulting: IDLEand position#2.
- Doctor dashboard shows both patients. Click Call Next Patient.
- Patient A's status instantly updates to
"In Chamber / Consulting". - Patient B's status bar flashes amber:
Doctor is seeing: ANOTHER PATIENT.
- Doctor fills out the prescription form (using shorthand like
TDS PC) and submits. - Patient A opens Share Prescriptions and clicks the Offline QR Passport tab.
- Log in as a Pharmacy account. Paste the offline token into the verification bar.
- The pharmacy dashboard instantly decodes and translates the prescription without calling the database backend!
Give this project a star if you find it helpful!
⭐ MediQR — Open-Source Digital Healthcare Portal ⭐