How charanpreetsingh123/mediscanai works
MediScan AI is a role-based medical imaging platform: patients and doctors authenticate, submit disease-specific scans, review AI findings, and use dashboards or history to follow results. The README also documents Grad-CAM explanations and downloadable PDF reports. The graph connects the documented frontend and API flow; unsampled route and utility implementations limit confidence about internal prediction, persistence, heatmap, and report wiring, so those links are not inferred.
Main entry points: api.js API client · main.py FastAPI application · App.jsx Role-based app · predict.py Prediction routes
Components 32
Web client
- Role-based app
frontend/src/App.jsx - Login and registration
frontend/src/pages/Login.jsx - Registration form
frontend/src/pages/Register.jsx - Patient dashboard
frontend/src/pages/PatientDashboard.jsx - Doctor dashboard
frontend/src/pages/DoctorDashboard.jsx - Patient scan upload
frontend/src/components/Patient/UploadScan.jsx - Doctor scan upload
frontend/src/components/Doctor/UploadScan.jsx - Scan results
frontend/src/components/Patient/ResultCard.jsx - Scan history
frontend/src/components/Patient/ScanHistory.jsx - Doctor analytics
frontend/src/components/Doctor/Analytics.jsx - Patient list
frontend/src/components/Doctor/PatientList.jsx - Report viewer
frontend/src/components/Doctor/ReportViewer.jsx - Heatmap viewer
frontend/src/components/Common/HeatmapViewer.jsx - API client
frontend/src/utils/api.js
API and access
- FastAPI application
backend/main.py - Authentication routes
backend/routes/auth.py - JWT and password auth
backend/auth.py - Prediction routes
backend/routes/predict.py - Doctor routes
backend/routes/doctor.py - Patient routes
backend/routes/patient.py
AI diagnosis
- Brain tumor inference
backend/models/brain_tumor - Retinopathy inference
backend/models/diabetic_retinopathy - Skin cancer inference
backend/models/skin_cancer - Image processing
backend/utils/image_processor.py - Grad-CAM generation
backend/utils/gradcam.py
Records and reports
- PDF report generation
backend/utils/report_generator.py - Scan records
backend/models/scan.py - User records
backend/models/user.py - Database access
backend/database.py
Other components
- Patient
- Doctor
- PostgreSQL
Connections 30
- Patient → Role-based app: uses
- Doctor → Role-based app: uses
- Role-based app → Login and registration: routes to
- Role-based app → Registration form: routes to
- Role-based app → Patient dashboard: routes to
- Role-based app → Doctor dashboard: routes to
- Patient dashboard → Patient scan upload: offers upload
- Patient scan upload → API client: requests prediction
- Doctor dashboard → Doctor scan upload: offers upload
- Doctor scan upload → API client: requests prediction
- Login and registration → API client: submits credentials
- Registration form → API client: submits account
- API client → FastAPI application: sends API requests
- FastAPI application → Authentication routes: dispatches auth
- FastAPI application → Prediction routes: dispatches prediction
- FastAPI application → Doctor routes: dispatches doctor
- FastAPI application → Patient routes: dispatches patient
- Authentication routes → JWT and password auth: uses auth functions
- Authentication routes → User records: reads and writes users
- Prediction routes → Brain tumor inference: runs brain model
- Prediction routes → Retinopathy inference: runs eye model
- Prediction routes → Skin cancer inference: runs skin model
- API client → Scan results: returns findings
- API client → Scan history: loads history
- API client → Doctor analytics: loads statistics
- API client → Patient list: loads patient list
- API client → Report viewer: loads reports
- API client → Heatmap viewer: loads heatmaps
- Database access → PostgreSQL: reads and writes
- FastAPI application → Scan records: registers scan model