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/:specialization
GET /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/patient
GET /api/referrals/referring
GET /api/referrals/referred
GET /api/referrals/all
GET /api/referrals/:id
PUT /api/referrals/:id/status
POST /api/referrals/:id/appointment
🧾 Medical Records
POST /api/medical-records/upload
GET /api/medical-records/patient/:patientId
GET /api/medical-records/:id
GET /api/medical-records/download/:id
DELETE /api/medical-records/:id
🧑💼 Admin
POST /api/admins
GET /api/admins/profile
PUT /api/admins/profile
GET /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/your-username/your-project.git
2. Install Dependencies
cd backend && npm install
cd ../frontend && npm install
3. Configure Environment Variables
Create .env files in both the backend and frontend directories with your environment-specific variables.
4. Run the Project
# Backend
cd backend
npm run dev
# Frontend
cd ../frontend
npm run dev
🤝 Contributing
We 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.