MedShield Logo
Rayen Lassoued, Portfolio Project

MedShield

Encrypted. Consent-driven. Audit-logged. A HIPAA-aware medical records platform where patients own their health data and every access is tracked.

React 19 Node.js + Express 5 PostgreSQL AES-256-GCM Groq · Llama 4 Appwrite Storage (local fallback)

Platform Dashboard

2,847
Patient Records
+12 today
14,203
Documents Encrypted
AES-256-GCM at rest
98.4%
Consent Approval Rate
Patient-controlled
0
Unauthorized Accesses
Verified

System Architecture

MedShield Architecture
Encryption Layer:
  Upload -> AES-256-GCM encrypt (DEK per document) -> Appwrite or local disk
  Download -> Appwrite or local disk -> Decrypt with stored DEK -> Serve
  DEK wrapped in SESSION_SECRET HMAC chain

Security Features

AES-256-GCM Encryption

Every document encrypted with a unique DEK. Authenticated encryption prevents tampering. IV + AuthTag stored alongside ciphertext.

Role-Based Access Control

3 roles: patient, doctor, hospital. HMAC-signed bearer tokens. Every API route checks role + ownership before serving data.

Emergency Break-Glass Access

24-hour emergency access window with full audit trail. Patient must opt-in. Every emergency session logged with requester identity.

Consent Governance

Full access lifecycle: request, approve, reject, revoke. Document-level granularity. Access grants expire automatically after 30 days.

Rate Limiting

Login: 20 attempts per 15 min. Registration: 10 attempts per hour. Protects against credential stuffing and brute-force attacks.

AI Medical Summarization

Groq-hosted Llama 4 Scout (vision) reads uploaded images directly; Llama 3.3 70B handles text documents. Returns structured summaries with urgency rating, key findings, and plain-language explanation for patients.

Simulated Patient Record Viewer

Patient: P-00423, Anonymous
Blood Group: A+ | DOB: 1985-03-12 | Emergency Consent: Enabled
Active
Document Type Uploaded By Date Status Actions

AI Document Analysis (Pre-computed Example)

Groq Analysis: CBC_Report_2024-03-15.pdf
Processed in 1.8s | Model: llama-3.3-70b-versatile via Groq

Live Audit Trail

Log Integrity: Verified SHA-256 chained checksums, append-only
Timestamp User Action Resource IP Address
All events signed with SHA-256 chained checksum. Tamper detection active. HIPAA Technical Safeguard §164.312(b).

Drug Interaction Notes

Doctor-authored clinical notes: only the authoring doctor can edit or delete
Visible to the patient and any doctor with an active access grant
Drugs Severity Type Recommendation Noted By

Emergency Break-Glass Access

When a patient who has opted in arrives unconscious or unable to consent, an attending doctor or hospital can open a 24-hour emergency window with one click. The event is fully audited: requester identity, timestamp, and reason.

RL

Rayen Lassoued

github.com/Hamilas

Rayen Lassoued | github.com/Hamilas | linkedin.com/in/Rayen-Lassoued