Encrypted. Consent-driven. Audit-logged. A HIPAA-aware medical records platform where patients own their health data and every access is tracked.
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
Every document encrypted with a unique DEK. Authenticated encryption prevents tampering. IV + AuthTag stored alongside ciphertext.
3 roles: patient, doctor, hospital. HMAC-signed bearer tokens. Every API route checks role + ownership before serving data.
24-hour emergency access window with full audit trail. Patient must opt-in. Every emergency session logged with requester identity.
Full access lifecycle: request, approve, reject, revoke. Document-level granularity. Access grants expire automatically after 30 days.
Login: 20 attempts per 15 min. Registration: 10 attempts per hour. Protects against credential stuffing and brute-force attacks.
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.
| Document | Type | Uploaded By | Date | Status | Actions |
|---|
| Timestamp | User | Action | Resource | IP Address |
|---|
| Drugs | Severity | Type | Recommendation | Noted By |
|---|
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.
github.com/Hamilas