How vel-asthramedtech/medfriend works
MedFriend is a medical-care web app with a React client, Express/MongoDB backend, and Python report-analysis service. A user enters through the landing and authentication flow, then accesses health reports, AI chat, reminders, government schemes, profile, dashboard, and image scanning. The documented report path uploads a file, stores it, requests AI analysis, and saves extracted results. The graph includes documented product areas whose route internals were not sampled; their detailed calls are therefore omitted. Edges reflect visible calls or route registration, with no assumed client-to-server wiring.
Main entry points: App.jsx App routing · index.js Express API · reports.js Report routes · auth.js Auth routes
Components 28
Web client
- App routing
client/src/App.jsx - Auth state
client/src/context/AuthContext.jsx - Landing
client/src/pages/Landing.jsx - Authentication UI
client/src/pages/Auth.jsx - Dashboard
client/src/pages/Dashboard.jsx - Reports UI
client/src/pages/Reports.jsx - Health chat UI
client/src/pages/Chat.jsx - Reminders UI
client/src/pages/Reminders.jsx - Schemes UI
client/src/pages/Schemes.jsx - Profile UI
client/src/pages/Profile.jsx - Scanner UI
client/src/pages/Scanner.jsx
API backend
- Express API
server/index.js - Auth routes
server/routes/auth.js - JWT protection
server/middleware/auth.js - User records
server/models/User.js - Database connection
server/config/db.js
Health features
- Report routes
server/routes/reports.js - Medical reports
server/models/MedicalReport.js - Chat routes
server/routes/chat.js - Reminder routes
server/routes/reminders.js - Scheme routes
server/routes/schemes.js - Scanner routes
server/routes/scanner.js
Report analysis
- AI analysis API
ai-service/main.py - Text extraction
ai-service/ocr.py - Report analysis
ai-service/analyzer.py
Other components
- Patient
- MongoDB
- Cloudinary storage
Connections 29
- Patient → App routing: uses
client/src/App.jsx - App routing → Auth state: provides auth
client/src/App.jsx - App routing → Landing: shows
client/src/App.jsx - App routing → Authentication UI: shows
client/src/App.jsx - App routing → Dashboard: shows
client/src/App.jsx - App routing → Reports UI: shows
client/src/App.jsx - App routing → Health chat UI: shows
client/src/App.jsx - App routing → Reminders UI: shows
client/src/App.jsx - App routing → Schemes UI: shows
client/src/App.jsx - App routing → Profile UI: shows
client/src/App.jsx - App routing → Scanner UI: shows
client/src/App.jsx - Auth state → Auth routes: requests session
- Express API → Database connection: connects
server/index.js - Database connection → MongoDB: connects
server/config/db.js - Express API → Auth routes: mounts
server/index.js - Express API → Report routes: mounts
server/index.js - Express API → Chat routes: mounts
server/index.js - Express API → Reminder routes: mounts
server/index.js - Express API → Scheme routes: mounts
server/index.js - Express API → Scanner routes: mounts
server/index.js - Auth routes → User records: reads and updates
server/routes/auth.js - Auth routes → JWT protection: protects profile routes
server/routes/auth.js - JWT protection → User records: loads user
server/middleware/auth.js - Report routes → JWT protection: protects endpoints
server/routes/reports.js - Report routes → Medical reports: reads and writes
server/routes/reports.js - Report routes → Cloudinary storage: uploads and deletes
server/routes/reports.js - Report routes → AI analysis API: requests analysis
server/routes/reports.js - AI analysis API → Text extraction: extracts text
ai-service/main.py - AI analysis API → Report analysis: analyzes text
ai-service/main.py