A full-stack MERN (MongoDB, Express, React, Node.js) application that enables seamless patient referrals, hospital management, and appointment scheduling.
- ✨ Features
- 📸 Screenshots
- 📡 API Endpoints
- 🛠️ Tech Stack
- ⚙️ Setup Instructions
- 🤝 Contributing
- 📄 License
- 🧑⚕️ Role-based system for Admins, Doctors, and Patients
- 🏥 Manage hospitals and doctor availability
- 📅 Book, update, and cancel appointments
- 🔁 Refer patients between hospitals/doctors
- 🩺 View and upload medical records
- 🔒 JWT authentication with OTP email verification
- 📊 Admin dashboard for insights and stats
Create and view referrals and appointments
![]()
Search doctors, view hospitals, and book appointments
![]()
Click to expand full documentation:
🔐 Authentication
POST /api/auth/register– Register a new userPOST /api/auth/login– Login with email or usernamePOST /api/auth/verify– Verify OTPPOST /api/auth/resend-otp– Resend OTPGET /api/auth/profile– Get current profilePUT /api/auth/profile– Update profile
👥 User Management (Admin)
GET /api/users– All usersGET /api/users/:id– Single userPUT /api/users/:id– Update userDELETE /api/users/:id– Remove user
🧑⚕️ Doctor
POST /api/doctors– Create profileGET /api/doctors/profile– My profilePUT /api/doctors/profile– Update profileGET /api/doctors– List all doctorsGET /api/doctors/:id– Doctor by IDGET /api/doctors/specialization/:specializationGET /api/doctors/hospital/:hospitalId
🧑🤝🧑 Patient
POST /api/patients– Create profileGET /api/patients/profile– My profilePUT /api/patients/profile– Update profileGET /api/patients– All patients (doctor/admin)GET /api/patients/:id
🏥 Hospitals
POST /api/hospitals– Add hospital (admin)GET /api/hospitals– Public listGET /api/hospitals/:id– Hospital by IDPUT /api/hospitals/:id– Update (admin)DELETE /api/hospitals/:id– Remove (admin)GET /api/hospitals/search?keyword=...
📅 Appointments
POST /api/appointments– Book appointmentGET /api/appointments/patient– Patient viewGET /api/appointments/doctor– Doctor viewGET /api/appointments/all– Admin viewGET /api/appointments/:id– Single viewPUT /api/appointments/:id/status– Update statusPUT /api/appointments/:id/cancel– Cancel appointment
🔁 Referrals
POST /api/referrals– New referralGET /api/referrals/patientGET /api/referrals/referringGET /api/referrals/referredGET /api/referrals/allGET /api/referrals/:idPUT /api/referrals/:id/statusPOST /api/referrals/:id/appointment
🧾 Medical Records
POST /api/medical-records/uploadGET /api/medical-records/patient/:patientIdGET /api/medical-records/:idGET /api/medical-records/download/:idDELETE /api/medical-records/:id
🧑💼 Admin
POST /api/adminsGET /api/admins/profilePUT /api/admins/profileGET /api/admin/db-stats
- Frontend: React, Tailwind CSS, Redux, Framer Motion
- Backend: Node.js, Express.js
- Database: MongoDB Atlas
- Authentication: JWT, OTP via email
- Deployment: Vercel
git clone https://github.com/f6Lcon/medref.gitcd backend && npm install
cd ../frontend && yarnCreate .env files in both the backend and frontend directories with your environment-specific variables.
cd backend
npm run devcd ../frontend
npm run devWe welcome all contributions! Follow these steps:
Fork the repository
Create a new branch: git checkout -b feature-name
Make and commit your changes
Push to your fork
Submit a Pull Request
📄 License
This project is licensed under the MIT License.