How manis30/careflow works
CareFlow is a multi-tenant clinic and consultation platform for patients, clinicians, front-desk staff, and administrators. The main patient journey is discovering a doctor, booking an available slot, settling payment, attending a consultation, and accessing records or prescriptions. The graph preserves documented clinical, operational, AI, and administration capabilities. The excerpts show application route mounting and AI orchestration; several domain implementations and frontend API calls were not sampled, so those links are marked unverified rather than asserted as source-confirmed calls.
Main entry points: app.js HTTP API application · appointment.js Appointment lifecycle · App.jsx React application · aiGateway.js AI gateway
Components 25
Role-based experience
- React application
frontend/src/App.jsx - Role-based routes
frontend/src/routes/AppRoutes.jsx - Authentication state
frontend/src/context/AuthContext.jsx - Appointment booking
frontend/src/pages/patient/BookAppointment.jsx - Video consultation
frontend/src/pages/common/MeetingRoom.jsx - Clinic administration
frontend/src/pages/admin/Dashboard.jsx
Clinical operations
- Clinics and doctors
backend/src/controller/doctor.js - Appointment lifecycle
backend/src/service/appointment.js - Medical records
backend/src/controller/medicalRecord.js - Prescriptions and medication
backend/src/controller/prescription.js - Messaging and telehealth
backend/src/controller/chat.js - Video consultation service
backend/src/service/meetingService.js
Platform services
- HTTP API application
backend/src/app.js - Accounts and access
backend/src/controller/user.js - Payments
backend/src/controller/payment.js - MongoDB domain data
backend/src/model/appointment.js
AI assistance
- AI gateway
backend/src/service/ai/aiGateway.js - Agent orchestration
backend/src/service/ai/orchestrator/agentOrchestrator.js - Workflow planning
backend/src/service/ai/orchestrator/workflowPlanner.js - Document Q&A and OCR
backend/src/service/ai/documentQaService.js - Document embeddings
backend/src/service/ai/embeddingService.js - Gemini provider client
backend/src/service/ai/geminiClient.js
Other components
- Patients
- Clinicians and staff
- Razorpay
Connections 31
- Patients → React application: use platform
- Clinicians and staff → React application: use platform
- React application → Role-based routes: renders routes
frontend/src/App.jsx - React application → Authentication state: provides auth
frontend/src/App.jsx - Role-based routes → Appointment booking: routes to
frontend/src/routes/AppRoutes.jsx - Role-based routes → Video consultation: routes to
frontend/src/routes/AppRoutes.jsx - Appointment booking → HTTP API application: submits booking
- Video consultation → Video consultation service: joins consultation
- React application → HTTP API application: requests API
- HTTP API application → Accounts and access: mounts routes
backend/src/app.js - HTTP API application → Clinics and doctors: mounts routes
backend/src/app.js - HTTP API application → Appointment lifecycle: mounts routes
backend/src/app.js - HTTP API application → Medical records: mounts routes
backend/src/app.js - HTTP API application → Prescriptions and medication: mounts routes
backend/src/app.js - HTTP API application → Payments: mounts routes
backend/src/app.js - HTTP API application → Messaging and telehealth: mounts routes
backend/src/app.js - Clinics and doctors → Appointment lifecycle: supports booking
- Appointment lifecycle → Payments: queues payment
- Appointment lifecycle → Video consultation service: enables consultation
- Appointment lifecycle → Medical records: records encounter
- Medical records → Prescriptions and medication: archives prescription
- Payments → Razorpay: verifies payments
- Appointment lifecycle → MongoDB domain data: persists lifecycle
- HTTP API application → AI gateway: mounts AI route
backend/src/app.js - AI gateway → Agent orchestration: dispatches assistant
backend/src/service/ai/orchestrator/agentOrchestrator.js - Agent orchestration → Workflow planning: plans workflow
backend/src/service/ai/orchestrator/agentOrchestrator.js - Agent orchestration → Gemini provider client: synthesizes response
backend/src/service/ai/orchestrator/agentOrchestrator.js - AI gateway → Document Q&A and OCR: supports document Q&A
- Document Q&A and OCR → Document embeddings: generates vectors
backend/src/service/ai/documentQaService.js - Document Q&A and OCR → Gemini provider client: synthesizes answer
backend/src/service/ai/documentQaService.js - Gemini provider client → AI gateway: uses provider gateway
backend/src/service/ai/geminiClient.js