Tech Stack: Python · Flask · MySQL · Bootstrap 5 · QRCode
VGLUG project/
├── app.py ← Main Flask application
├── schema.sql ← MySQL schema + seed data
├── requirements.txt ← Python dependencies
├── static/
│ ├── css/style.css ← Premium dark glassmorphism UI
│ ├── js/main.js ← Frontend interactivity
│ └── qrcodes/ ← Auto-generated QR images
└── templates/
├── base.html ← Layout (navbar, flash messages)
├── doctor_login.html ← Biometric login
├── doctor_dashboard.html
├── patient_register.html
├── create_prescription.html
├── prescription_detail.html ← QR code display + download
├── pharmacy.html ← Pharmacist lookup portal
├── verify.html ← 3-method verification UI
└── issued.html ← Success + receipt
mysql -u root -p < schema.sqlOr run the SQL manually in MySQL Workbench / phpMyAdmin.
app.config["MYSQL_HOST"] = "localhost"
app.config["MYSQL_USER"] = "root"
app.config["MYSQL_PASSWORD"] = "YOUR_PASSWORD_HERE" # ← edit this
app.config["MYSQL_DB"] = "prescription_db"pip install Flask Flask-MySQLdb qrcode[pil] Pillowpython app.pyVisit → http://localhost:5000
| Field | Value |
|---|---|
| Name | Dr. Arun Kumar |
| Fingerprint Passphrase | doctor1_fingerprint |
The SHA-256 hash is stored in the DB. This is the passphrase that maps to it.
1. DOCTOR LOGIN → /doctor/login
↓ (biometric hash)
2. REGISTER PATIENT → /patient/register
↓ (generates Unique Patient ID)
3. CREATE PRESCRIPTION → /prescription/create
↓ (generates Rx ID + QR code PNG)
4. PHARMACY LOOKUP → /pharmacy
↓ (enter Rx ID or scan QR)
5. VERIFY PATIENT → /verify/<presc_id> (choose one of 3 methods)
• Fingerprint passphrase
• Unique Patient ID
• 6-digit OTP (demo: click "Show Demo OTP")
↓
6. MEDICINE ISSUED → /issued/<presc_id>
(status updated to 'Issued' in DB)
| Table | Key Columns |
|---|---|
doctors |
id, name, bio_hash (SHA-256) |
patients |
id, unique_patient_id (PT-XXXXXXXX), name, phone, bio_hash |
prescriptions |
id, presc_id (RX-XXXXXXXX), doctor_id, patient_id, medicine_details, qr_path, status, otp_code |
| Feature | Implementation |
|---|---|
| Biometric | SHA-256 hash of fingerprint passphrase |
| Patient ID | Randomly generated alphanumeric (PT-XXXXXXXX) |
| QR Code | Encodes: Rx ID, patient name/ID, doctor, medicines, date |
| OTP | 6-digit random numeric, stored per prescription |
| Session | Flask secure cookie with secret_key |
- Change
app.secret_keyto a cryptographically random string - Use environment variables for DB credentials (
.env+python-dotenv) - Remove
/otp/<presc_id>demo endpoint - Use HTTPS (SSL certificate e.g. Let's Encrypt)
- Hash OTP before storage; send via SMS API (Twilio / Fast2SMS)
- Replace passphrase fingerprint with real biometric SDK integration
- Add login rate limiting (Flask-Limiter)