How rohit-create-ctrl/agentic-ai-doctor-and-chatbot works
MedAI is a health-information web app combining a local symptom/chat assistant, medicine lookup, prescription-upload demo, emergency guidance, and a health-history dashboard backed by an Express API and MongoDB. The evidenced consultation path is symptom entry in the chat page, local analysis in the data module, and a displayed response; dashboard records have a separate authenticated backend path. The prescription page simulates analysis rather than calling an OCR service. Frontend API wiring and unsampled page behavior are not asserted here.
Main entry points: chat/page.tsx Consultation chat · server.js Express server · dataRoutes.js Record routes · app/page.tsx Home
Components 21
Web experience
- Home
ai-doctor/src/app/page.tsx - Consultation chat
ai-doctor/src/app/chat/page.tsx - Health dashboard
ai-doctor/src/app/dashboard/page.tsx - Medicine lookup
ai-doctor/src/app/medicine/page.tsx - Prescription reader
ai-doctor/src/app/prescription/page.tsx - Emergency support
ai-doctor/src/app/emergency/page.tsx - Frontend API client
ai-doctor/src/lib/api.ts
Health information
- Symptom analysis
ai-doctor/src/lib/data.ts - Medicine and advice data
ai-doctor/src/lib/data.ts
Backend API
- Express server
backend/server.js - Auth routes
backend/routes/authRoutes.js - Auth controller
backend/controllers/authController.js - Record routes
backend/routes/dataRoutes.js - Record controller
backend/controllers/dataController.js - JWT protection
backend/middlewares/authMiddleware.js - Error handling
backend/middlewares/errorMiddleware.js
Persistence
- User model
backend/models/User.js - Record model
backend/models/Record.js - Database connection
backend/config/db.js - MongoDB
Other components
- User
Connections 20
- User → Home: opens
- Home → Consultation chat: starts consultation
- User → Consultation chat: enters symptoms
- Consultation chat → Symptom analysis: analyzes symptoms
- Consultation chat → Medicine and advice data: generates reply
- Symptom analysis → Consultation chat: returns diagnosis
- User → Medicine lookup: searches medicines
- User → Prescription reader: uploads image
- User → Emergency support: requests guidance
- User → Health dashboard: views history
- Express server → Auth routes: mounts routes
- Express server → Record routes: mounts routes
- Express server → Error handling: handles errors
- Auth routes → Auth controller: dispatches
- Record routes → JWT protection: protects records
- Record routes → Record controller: dispatches
- Auth controller → User model: reads and creates
- JWT protection → User model: loads user
- Record controller → Record model: manages records
- Database connection → MongoDB: connects