Skip to content

Badrinath2006/Badi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏥 AI-Powered Biometric Secure Prescription Verification System

Tech Stack: Python · Flask · MySQL · Bootstrap 5 · QRCode


📁 Project Structure

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

⚙️ Setup Instructions

1. Install MySQL and create the database

mysql -u root -p < schema.sql

Or run the SQL manually in MySQL Workbench / phpMyAdmin.

2. Configure your MySQL credentials in app.py

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"

3. Install Python dependencies

pip install Flask Flask-MySQLdb qrcode[pil] Pillow

4. Run the application

python app.py

Visit → http://localhost:5000


🔑 Default Login Credentials (Doctor)

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.


🔄 Full Workflow

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)

🗄️ Database Schema

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

🛡️ Security Notes

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

🚀 Production Hardening Checklist

  • Change app.secret_key to 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)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors