How syed-mohammad-wasique-junaid/swasthyavault works
SwasthyaVault is a patient-facing health-record platform with a doctor-facing, consent-governed view. Its intended workflow is to upload records, extract and summarize their contents, organize health history, and manage sharing. The sampled backend confirms API routing, document storage, AI analysis, timeline creation, and consent-related doctor access patterns, though some routes still use temporary fixed user IDs. The README describes offline Tesseract/Ollama processing; implementation details for those integrations and several frontend-to-API connections were not shown, so those links are marked unverified.
Main entry points: main.py FastAPI application · database.py Relational database · service.py OCR and summarization · routes.py Authentication
Components 24
User experience
- Patient portal
frontend/src/app/patient/dashboard/page.tsx - Health locker
frontend/src/app/patient/dashboard/locker/page.tsx - Timeline view
frontend/src/app/patient/dashboard/timeline/page.tsx - Consent controls
frontend/src/app/patient/dashboard/consent/page.tsx - Doctor dashboard
frontend/src/app/doctor/dashboard/page.tsx - Patient record view
frontend/src/app/doctor/dashboard/patient/[id]/page.tsx - Sign-in and registration
frontend/src/context/AuthContext.tsx
API and access
- FastAPI application
backend/app/main.py - Authentication
backend/auth/routes.py - Patient profiles
backend/patient/routes.py - Doctor access
backend/doctor/routes.py - Consent management
backend/consent/routes.py - Token security
backend/app/security.py
Health records
- Document management
backend/documents/routes.py - Health timeline
backend/timeline/routes.py - Relational database
backend/app/database.py - Uploaded files
Document processing
- AI analysis endpoint
backend/ai/routes.py - OCR and summarization
backend/ai/service.py - AI prompts
backend/ai/prompts.py
Other components
- Patient
- Doctor
- Tesseract OCR
- Ollama model
Connections 31
- Patient → Sign-in and registration: signs in
- Doctor → Sign-in and registration: signs in
- Patient → Patient portal: manages records
- Doctor → Doctor dashboard: reviews records
- Sign-in and registration → Authentication: authenticates
- Patient portal → Patient profiles: manages profile
- Health locker → Document management: uploads and retrieves
- Timeline view → Health timeline: views history
- Consent controls → Consent management: sets sharing
- Doctor dashboard → Doctor access: lists patients
- Patient record view → Doctor access: requests details
- FastAPI application → Authentication: mounts
backend/app/main.py - FastAPI application → Patient profiles: mounts
backend/app/main.py - FastAPI application → Doctor access: mounts
backend/app/main.py - FastAPI application → Document management: mounts
backend/app/main.py - FastAPI application → AI analysis endpoint: mounts
backend/app/main.py - FastAPI application → Health timeline: mounts
backend/app/main.py - FastAPI application → Consent management: mounts
backend/app/main.py - Authentication → Token security: hashes and signs
backend/auth/routes.py - Authentication → Relational database: reads and writes
backend/auth/routes.py - Patient profiles → Relational database: reads and writes
backend/patient/routes.py - Doctor access → Relational database: checks access and reads
backend/doctor/routes.py - Consent management → Relational database: reads and writes
backend/consent/routes.py - Document management → Uploaded files: saves upload
backend/documents/routes.py - Document management → Relational database: stores metadata
backend/documents/routes.py - AI analysis endpoint → Relational database: reads document and writes event
backend/ai/routes.py - AI analysis endpoint → OCR and summarization: extracts and summarizes
backend/ai/routes.py - OCR and summarization → AI prompts: uses prompts
backend/ai/service.py - OCR and summarization → Tesseract OCR: extracts text
- OCR and summarization → Ollama model: generates summary
- Health timeline → Relational database: reads timeline
backend/timeline/routes.py