MediOra is a full-stack doctor appointment platform with role-based panels for patients, doctors, and admins.
Live URL: MediOra
- Sign up and log in as a patient
- Log in as doctor or admin
- Browse doctors by specialty
- View doctor profiles and available booking slots
- Book appointments with selected date/time
- Cancel appointments (patient, doctor, admin by role)
- Pay online with Razorpay
- View role-specific dashboards:
- Patient: profile + appointments
- Doctor: appointments + earnings + status updates
- Admin: doctor management + full appointment monitoring
- Role-based authentication with JWT (
user,doctor,admin) - Protected backend routes with middleware access control
- Doctor listing, filtering, related doctors, and slot visibility
- Appointment booking with slot conflict prevention
- Razorpay order creation + signature verification
- Admin doctor CRUD actions (add/delete doctor)
- Admin and doctor dashboards with recent activity and metrics
- Cloudinary support for doctor image upload
- Redesigned MediOra frontend UI across all roles
- Frontend: React 18, Vite, JavaScript, Tailwind CSS
- Backend: Node.js, Express (ESM)
- Database: MongoDB
- ORM/ODM: Mongoose
- Auth/Security: JWT (
jsonwebtoken),bcryptjs - Payments: Razorpay
- Media: Cloudinary + Multer
- HTTP client: Axios
- UI libs:
lucide-react,react-hot-toast
- API layer is modular (
routes→controllers→models) - JWT middleware validates token and role before protected actions
- Slot booking map is maintained in doctor document (
slots_booked) - Backend includes global Express error handler for stable responses
- MongoDB connection uses cached connection pattern for serverless safety
- Frontend uses shared service modules and axios interceptor flow
- Patient/doctor/admin logs in and receives a JWT.
- Frontend stores token and sends it as
Authorization: Bearer <token>. - Backend middleware validates token and attaches
userId+userRole. - Patient browses doctors and books a slot.
- Backend creates appointment and marks doctor slot as booked.
- Patient can pay online:
- Create order via Razorpay
- Verify payment signature on backend
- Mark appointment as paid
- Doctor can view appointments, mark completed, or cancel.
- Admin can monitor all appointments and manage doctors.
git clone https://github.com/pawanshekhawat/Doctors-Appointment-WebApp.git
cd Doctors-Appointment-WebAppcd backend
npm install
cd ../frontend
npm installCreate backend/.env:
# Core
PORT=4000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
# Admin login (optional; defaults exist in code but set your own for safety)
ADMIN_EMAIL=admin@mediora.com
ADMIN_PASSWORD=admin
# Razorpay
RAZORPAY_KEY_ID=your_razorpay_key_id
RAZORPAY_KEY_SECRET=your_razorpay_key_secret
# Cloudinary
CLOUDINARY_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_SECRET_KEY=your_cloudinary_secret_keyCreate frontend/.env:
VITE_BACKEND_URL=http://localhost:4000cd backend
npm run startcd frontend
npm run devDefault local URLs:
- Frontend:
http://localhost:5173 - Backend:
http://localhost:4000
GET /
POST /api/user/registerPOST /api/user/loginGET /api/user/get-profile(auth: user)PUT /api/user/update-profile(auth: user)
POST /api/doctor/loginGET /api/doctor/listGET /api/doctor/:doctorIdGET /api/doctor/related/:doctorIdGET /api/doctor/slots/:doctorIdGET /api/doctor/get-profile(auth: doctor)PUT /api/doctor/update-profile(auth: doctor)GET /api/doctor/dashboard(auth: doctor)
POST /api/appointment/book(auth: user)GET /api/appointment/user-appointments(auth: user)PUT /api/appointment/cancel/:appointmentId(auth: user)GET /api/appointment/doctor-appointments(auth: doctor)PUT /api/appointment/cancel-by-doctor/:appointmentId(auth: doctor)PUT /api/appointment/complete/:appointmentId(auth: doctor)
POST /api/admin/loginPOST /api/admin/add-doctor(auth: admin)GET /api/admin/dashboard(auth: admin)GET /api/admin/doctors(auth: admin)DELETE /api/admin/doctor/:doctorId(auth: admin)GET /api/admin/appointments(auth: admin)PUT /api/admin/appointment/:appointmentId(auth: admin)
POST /api/razorpay/create-order(auth: user)PUT /api/razorpay/verify-payment(auth: user)
Doctors-Appointment-WebApp/
backend/
config/
controllers/
middleware/
models/
routes/
scripts/
server.js
frontend/
src/
components/
pages/
services/
utils/
- This is a personal/portfolio-level project and a strong base for production hardening.
- For production use, add stronger validations, rate limiting, audit logging, and automated tests.
Contributions are welcome. Open an issue first for major changes so implementation direction stays aligned.