A comprehensive full-stack web application for managing hospital operations, appointments, and patient-doctor interactions. Built with the MERN stack (MongoDB, Express.js, React, Node.js), this system provides a seamless experience for patients, doctors, staff, and administrators with advanced features including AI-powered diagnostics, smart scheduling, comprehensive billing, and detailed analytics.
| Feature | Screenshot |
|---|---|
| Home Page | ![]() |
| Doctor Listing | ![]() |
| Doctor Profile | ![]() |
| Appointment Booking | ![]() |
| User Dashboard | ![]() |
| User Dashboard | ![]() |
| User Dashboard | ![]() |
| User Dashboard | ![]() |
| AI Chat Widget | ![]() |
| Symptom Checker | ![]() |
| Feature | Screenshot |
|---|---|
| Doctor Dashboard | ![]() |
| Appointments | ![]() |
| Availability | ![]() |
| Profile | ![]() |
| Feature | Screenshot |
|---|---|
| Staff Dashboard | ![]() |
| Patient Registration | ![]() |
| Patient Check-in | ![]() |
| Appointments | ![]() |
| Billing & Payments | ![]() |
| Feature | Screenshot |
|---|---|
| Admin Dashboard | ![]() |
| Doctors List | ![]() |
| Patients List | ![]() |
| All Appointments | ![]() |
| Analytics | ![]() |
| Billing Analytics | ![]() |
| Staff Management | ![]() |
| Audit Logs | ![]() |
| Settings | ![]() |
| Feature | Screenshot |
|---|---|
| Login Page | ![]() |
| Registration | ![]() |
| Forgot Password | ![]() |
- Password Visibility Toggle: Eye button to show/hide password during login
- Forgot Password: Complete password reset flow with email verification
- Secure Registration: Email verification and strong password requirements
- Two-Factor Authentication Support: Optional 2FA infrastructure for enhanced security
- Role-based Authentication: Separate authentication flows for Patients, Doctors, Staff, and Admins
- Patient Information Collection: Automatic collection of patient details (name, gender, age) during booking
- Profile Validation: System checks existing user profiles and collects missing information
- Real-time Availability: Dynamic slot generation based on doctor schedules
- Multiple Payment Options: Cash payment at clinic or online payment via Razorpay/Stripe
- Appointment History: Complete booking history with status tracking
- Check-in System: Patient check-in functionality for queue management
- Automated Reminders: Email reminders sent 24 hours and 2 hours before appointments
- Interactive Dashboard: Comprehensive overview with key metrics
- Appointment Management: View, accept, complete, and cancel appointments
- Availability Management: Set working hours and manage time slots
- Patient Records: Access to patient history and prescription management
- Prescription System: Generate and manage digital prescriptions
- Earnings Dashboard: Track consultation fees and payment status
- Reviews Management: View patient reviews and ratings
- Interactive Dashboard: Clickable metric cards for quick navigation
- Analytics & Insights: Comprehensive statistics and performance metrics
- Doctor Lifecycle Management: Add, edit, remove, and manage doctors
- Staff Management: Complete staff panel with CRUD operations
- Patient Management: View patient records and appointment history
- Billing & Payments: Invoice generation, payment tracking, refunds
- Audit Logs: Track all admin actions for security
- System Settings: Configure platform-wide settings and policies
- Patient Registration: Register new patients with complete details
- Patient Check-in: Mark patient arrivals for queue management
- Appointment Management: View and manage daily appointments
- Payment Collection: Record and manage payment transactions
- Billing System: Handle itemized billing and partial payments
- Notifications: Real-time notifications for appointments and payments
- Conversational AI Assistant: Gemini-powered chat bot for medical queries
- Symptom Checker: AI-driven symptom analysis for preliminary diagnosis
- Smart Scheduler: Intelligent appointment recommendations
- Prescription Management: Automated prescription generation and tracking
- Medical History Analysis: AI-powered insights from patient records
- Invoice Generation: Automatic invoice creation with unique invoice numbers
- PDF Downloads: Download professional invoice PDFs
- Partial Payments: Support for installment-based payments
- Multiple Payment Methods: Cash, Card, Online (Razorpay/Stripe)
- Payment Tracking: Complete payment history and logs
- Refund Processing: Process refunds for cancelled appointments
- Financial Reports: CSV export of financial data
- Home Page: Hero section, specialty menu, top doctors, promotional banner
- Authentication Pages: Login, registration, password reset, email verification
- Doctor Discovery: Advanced filtering by specialty, location, gender, and availability
- Doctor Profiles: Detailed information, reviews, availability calendar
- Appointment System: Smart booking with patient info collection
- User Dashboard: Profile management, appointment history, payment records
- Payment Integration: Secure processing via Razorpay and Stripe
- My Appointments: View and manage booked appointments
- My Billing: View payment history and invoices
- Notifications: Personalized notification center
- AI Chat Widget: Conversational AI assistant on every page
- Symptom Checker: AI-powered preliminary diagnosis tool
- Smart Scheduler: Intelligent appointment recommendations
- User Management: Complete CRUD operations with authentication
- Doctor Management: Profile management, availability, and schedule tracking
- Appointment Management: Booking, cancellation, status updates, check-in
- Payment Processing: Multi-gateway integration with webhooks
- Staff Management: Authentication, patient registration, queue management
- File Upload System: Secure image management via Cloudinary
- Email Services: Automated notifications and password reset
- AI Integration: Gemini API for symptom analysis and chat
- Invoice Management: Generation, tracking, PDF generation
- Notification System: Automated reminders and real-time notifications
- Audit Logging: Track all admin and staff actions
- Analytics Engine: Comprehensive data processing and reporting
- Dashboard Analytics: Real-time metrics and interactive navigation
- Doctor CRUD Operations: Complete doctor lifecycle management
- Staff Management: Add, edit, and manage staff accounts
- Appointment Monitoring: Advanced filtering and status management
- Patient Oversight: User management and activity tracking
- Financial Reports: Revenue analytics, payment tracking
- Billing Management: Invoice generation, payment processing, refunds
- Audit Logs: View all administrative actions
- Analytics Hub: Advanced analytics with date range filtering
- Billing Analytics: Detailed financial metrics and trends
- Personal Dashboard: Appointment overview and quick actions
- Patient Management: View patient history and manage consultations
- Schedule Management: Set availability and manage time slots
- Prescription System: Create and manage patient prescriptions
- Earnings Tracking: Monitor fees and payment status
- Profile Management: Update professional information and credentials
- Reviews: View patient reviews and ratings
- Patient Registration: Register new patients with full details
- Daily Dashboard: Overview of today's appointments and collections
- Queue Management: Patient check-in and queue tracking
- Appointment Management: View all appointments by date
- Payment Collection: Record payments and handle billing
- Patient Records: View and manage patient information
- React: Component-based UI development
- Vite: Fast build tool and development server
- Tailwind CSS: Utility-first CSS framework
- React Router: Client-side routing
- Axios: HTTP client for API calls
- React Toastify: Notification system
- jsPDF: PDF generation for invoices
- Node.js: JavaScript runtime
- Express.js: Web application framework
- MongoDB: NoSQL database with Mongoose ODM
- JWT: JSON Web Tokens for authentication
- bcrypt: Password hashing
- Cloudinary: Image upload and management
- Multer: File upload middleware
- Razorpay & Stripe: Payment gateways
- Validator: Input validation
- Nodemailer: Email services
- PDFKit: PDF generation
- TensorFlow.js: AI/ML capabilities
- Vitest: Unit testing framework
- React Testing Library: Component testing
MediFlow-HMS/
βββ frontend/ # Patient-facing React application
β βββ src/
β β βββ components/ # Reusable UI components
β β β βββ AIChatWidget.jsx # AI conversational assistant
β β β βββ SmartScheduler.jsx # Smart appointment scheduler
β β β βββ SymptomChecker.jsx # AI symptom analyzer
β β β βββ ...
β β βββ pages/ # Application pages
β β βββ context/ # React context for state management
β β βββ assets/ # Images and static files
β βββ package.json
βββ backend/ # Express.js API server
β βββ config/ # Database and cloud configurations
β βββ controllers/ # Route handlers
β β βββ adminController.js # Admin operations
β β βββ doctorController.js # Doctor operations
β β βββ staffController.js # Staff operations
β β βββ userController.js # User operations
β β βββ aiController.js # AI features
β β βββ notificationController.js # Notifications
β β βββ prescriptionController.js # Prescriptions
β βββ middleware/ # Authentication and file upload middleware
β βββ models/ # MongoDB schemas
β β βββ userModel.js, doctorModel.js, staffModel.js
β β βββ appointmentModel.js, prescriptionModel.js
β β βββ invoiceModel.js, paymentLogModel.js
β β βββ notificationModel.js, auditLogModel.js
β β βββ ...
β βββ routes/ # API endpoints
β β βββ adminRoute.js, doctorRoute.js, staffRoute.js
β β βββ userRoute.js, aiRoute.js, paymentRoute.js
β βββ jobs/ # Cron jobs for automated tasks
β βββ server.js # Main server file
βββ admin/ # Admin management panel (React)
β βββ src/
β β βββ components/ # Admin UI components
β β βββ pages/ # Admin dashboard pages
β β β βββ Admin/ # Admin-specific pages
β β β βββ Doctor/ # Doctor management pages
β β β βββ Staff/ # Staff management pages
β β βββ context/ # Admin context
β β βββ assets/ # Admin assets
β βββ package.json
βββ README.md
-
New User Registration:
- Visit website and click "Create Account"
- Enter full name, email, and password
- Use password visibility toggle to ensure correct entry
- System validates email format and password strength
- Receive email - Click verification link verification link to activate account
-
Login Process:
- Enter email and password on login page
- Use "Forgot Password?" if password is forgotten
- System sends reset token to email
- Enter token and set new password
- Browse Specialties: View specialty menu on homepage
- Advanced Search & Filtering: Filter by specialty, gender, fees, availability
- Doctor Profile Review: View detailed info, ratings, availability calendar
- Booking Flow: Select doctor, choose date/time, provide patient info
- Payment: Cash at clinic or online via Razorpay/Stripe
- Confirmation: Receive booking confirmation with details
- View My Appointments: Access from dashboard
- Appointment Details: View full details and prescriptions
- Cancellation: Cancel within allowed time window
- Update Personal Information: Edit name, phone, address, DOB
- Payment History: View transactions and download invoices
- Account Setup (Admin-Managed): Admin creates doctor account
- Profile Completion: Upload photo, set fees, configure availability
- Login & Overview: View today's appointments, earnings, patient count
- Appointment Management: Accept, complete, or cancel appointments
- Pre-Consultation: Review patient history and previous prescriptions
- During Consultation: Update symptoms, create prescriptions
- Post-Consultation: Generate prescription, mark appointment complete
- Working Hours: Define weekly schedule and consultation duration
- Dynamic Updates: Mark days off or adjust schedule
- Create Prescriptions: Add medicines with dosage and instructions
- View History: Access patient prescription history
- Register New Patient: Enter complete patient details
- Upload Documents: Profile photo, ID proof (Aadhaar)
- Insurance Details: Record insurance provider and ID
- Dashboard Overview: Today's appointments and expected collections
- Patient Check-in: Mark patients as arrived
- Queue Management: Track patient queue
- Record Payments: Handle cash, card, or online payments
- Partial Payments: Support installment-based payments
- Generate Invoices: Create and provide invoices to patients
- View Appointments: See all appointments for any date
- Cancel Appointments: Handle cancellation requests
- Real-time Metrics: View appointments, revenue, patient counts
- Advanced Analytics: Filter by date range, view trends
- Billing Analytics: Revenue trends, payment success rates
- Add Doctor: Create doctor profiles with credentials
- Manage Doctors: Edit info, update availability, deactivate
- Performance Tracking: Monitor doctor appointments and ratings
- Add Staff: Create staff accounts for front desk
- Manage Staff: Edit details, reset passwords
- View Patients: Access complete patient database
- Patient Details: View medical history and appointments
- Generate Invoices: Create invoices for appointments
- Process Payments: Record and track payments
- Handle Refunds: Process refund requests
- Export Reports: Download financial data as CSV
- View Audit Logs: Track all admin actions
- System Settings: Configure platform policies
POST /api/user/register- User registration with email verificationPOST /api/user/login- User login with JWT token generationGET /api/user/get-profile- Retrieve authenticated user profilePOST /api/user/update-profile- Update user profilePOST /api/user/forgot-password- Initiate password reset via emailPOST /api/user/reset-password- Reset password using tokenPOST /api/user/verify-email- Verify email address
POST /api/user/book-appointment- Book new appointmentGET /api/user/appointments- Get user's appointment historyPOST /api/user/cancel-appointment- Cancel appointmentGET /api/user/doctor-slots/:docId- Get available time slots
POST /api/doctor/login- Doctor authenticationGET /api/doctor/profile- Get doctor profilePOST /api/doctor/update-profile- Update doctor infoGET /api/doctor/appointments- Get doctor's appointmentsPOST /api/doctor/change-availability- Update availabilityPOST /api/doctor/generate-prescription- Generate prescriptionGET /api/doctor/reviews/:docId- Get doctor reviewsPOST /api/doctor/add-review- Add review for doctor
POST /api/staff/login- Staff authenticationGET /api/staff/profile- Get staff profilePOST /api/staff/create-patient- Register new patientGET /api/staff/all-patients- Get all patientsPOST /api/staff/mark-checkin- Mark patient check-inPOST /api/staff/update-payment- Update payment statusGET /api/staff/notifications- Get notifications
POST /api/admin/login- Admin authenticationPOST /api/admin/add-doctor- Create new doctorGET /api/admin/doctors- Get all doctorsPOST /api/admin/add-staff- Create new staffGET /api/admin/all-staff- Get all staffGET /api/admin/appointments- Get all appointmentsPOST /api/admin/cancel-appointment- Cancel appointmentGET /api/admin/analytics- Get analytics dataGET /api/admin/advanced-analytics- Advanced analyticsPOST /api/admin/create-patient- Create patient from adminGET /api/admin/patients- Get all patientsPOST /api/admin/generate-invoice- Generate invoiceGET /api/admin/invoices- Get all invoicesPOST /api/admin/process-refund- Process refundGET /api/admin/audit-logs- Get audit logsGET /api/admin/billing-metrics- Billing analyticsGET /api/admin/export-financials- Export CSV
POST /api/ai/chat- Conversational AI assistantPOST /api/ai/symptom-check- AI symptom analysisGET /api/ai/smart-schedule- Smart scheduling
GET /api/notification/reminders- Automated reminders (cron job)- Internal notification creation for various events
- JWT Tokens: Secure authentication for all user types
- Password Hashing: bcrypt for secure password storage
- Input Validation: Server-side validation using validator library
- CORS: Cross-origin resource sharing configuration
- File Upload Security: Multer with file type restrictions
- Role-based Access Control: Separate auth middleware for each role
- Razorpay: Indian payment gateway integration
- Stripe: International payment processing
- Cash Payments: Support for offline payments
- Partial Payments: Installment-based payment system
- Secure Transactions: PCI-compliant payment handling
- Mobile-First: Optimized for mobile devices
- Cross-Browser: Compatible with all modern browsers
- Accessibility: WCAG compliant design principles
- Performance: Optimized loading times and smooth interactions
- Node.js (v16 or higher)
- MongoDB database
- Cloudinary account for image uploads
- Razorpay/Stripe accounts for payments
- Gemini API key for AI features
- Navigate to the backend directory:
bash
cd MediFlow-HMS/backend
- Install dependencies:
bash
npm install
- Create a
.envfile with the following variables:
PORT=4000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
ADMIN_EMAIL=admin@mediflow.com
ADMIN_PASSWORD=your_admin_password
CLOUDINARY_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_SECRET_KEY=your_cloudinary_secret_key
RAZORPAY_KEY_ID=your_razorpay_key_id
RAZORPAY_KEY_SECRET=your_razorpay_key_secret
STRIPE_SECRET_KEY=your_stripe_secret_key
GEMINI_API_KEY=your_gemini_api_key
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_email_app_password
- Start the server:
bash
npm start
- Navigate to the frontend directory:
bash
cd MediFlow-HMS/frontend
- Install dependencies:
bash
npm install
- Start the development server:
bash
npm run dev
- Navigate to the admin directory:
cd MediFlow-HMS/admin
- Install dependencies:
bash
npm install
- Start the development server:
bash
npm run dev
The project includes comprehensive test suites:
bash
cd frontend
npm run test # Run unit tests
npm run test:ui # Run tests with UI
bash
cd backend
npm test # Run backend tests
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the ISC License.
For support, email support@mediflow.com or join our Slack channel.
Built with β€οΈ using MERN Stack for better healthcare management












