Skip to content

Latest commit

Β 

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯ Doctor Appointment Booking System (MERN Stack)

A full-stack Doctor Appointment Booking Application built using the MERN Stack (MongoDB, Express.js, React.js, Node.js).

The application provides separate dashboards and functionalities for Patients, Doctors, and Administrators. Users can book appointments, doctors can manage appointments and earnings, and admins can manage doctors and appointments. The application also supports secure online payments using Razorpay and image uploads using Cloudinary.


Live Deployments

Patient Portal

https://go-doctor-one.vercel.app

Admin & Doctor Dashboard

https://go-doctor-faht.vercel.app

Backend API

https://go-doctor-server.vercel.app

Demo Credentials

Admin Login

Email: admin@example.com

Password: ********

πŸš€ Features

πŸ‘€ Patient Features

  • User Registration & Login
  • JWT Authentication
  • Browse Doctors by Speciality
  • View Doctor Details
  • Book Appointments
  • Cancel Appointments
  • View Appointment History
  • Update Profile Information
  • Upload Profile Image
  • Online Payment using Razorpay

πŸ‘¨β€βš•οΈ Doctor Features

  • Doctor Login
  • Manage Appointments
  • Mark Appointments as Completed
  • Cancel Appointments
  • View Dashboard Statistics
  • View Earnings
  • Manage Availability Status
  • Update Profile Information

πŸ›‘οΈ Admin Features

  • Admin Login
  • Add New Doctors
  • Upload Doctor Images
  • Manage Doctor Availability
  • View All Doctors
  • View All Appointments
  • Cancel Appointments
  • Dashboard Analytics

πŸ’³ Payment Integration

  • Razorpay Payment Gateway
  • Secure Payment Verification
  • Payment Status Tracking
  • Automatic Appointment Payment Updates

☁️ Cloud Services

  • MongoDB Atlas
  • Cloudinary Image Storage

πŸ› οΈ Tech Stack

Frontend

  • React.js
  • React Router DOM
  • Tailwind CSS
  • Axios
  • React Toastify
  • Vite

Backend

  • Node.js
  • Express.js
  • MongoDB Atlas
  • Mongoose
  • JWT Authentication
  • Bcrypt.js
  • Multer
  • Cloudinary
  • Razorpay

πŸ“ Project Structure

Doctor-Appointment-System/
β”‚
β”œβ”€β”€ frontend/                 # User Frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ public/
β”‚   └── package.json
β”‚
β”œβ”€β”€ admin/                    # Admin + Doctor Panel
β”‚   β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ public/
β”‚   └── package.json
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ controllers/
β”‚   β”œβ”€β”€ middleware/
β”‚   β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ uploads/
β”‚   β”œβ”€β”€ server.js
β”‚   └── package.json
β”‚
└── README.md

βš™οΈ Prerequisites

Before running the project, make sure you have:

  • Node.js (v18+ recommended)
  • npm
  • MongoDB Atlas Account
  • Cloudinary Account
  • Razorpay Account
  • Git

Verify installation:

node -v
npm -v
git --version

πŸ“₯ Clone Repository

git clone https://github.com/YOUR_USERNAME/doctor-appointment-booking.git

cd doctor-appointment-booking

πŸ”‘ Environment Variables

Create a .env file inside the backend folder.

backend/.env

PORT=4000

MONGODB_URI=YOUR_MONGODB_CONNECTION_STRING

JWT_SECRET=YOUR_SECRET_KEY

ADMIN_EMAIL=admin@gmail.com
ADMIN_PASSWORD=admin123

CLOUDINARY_CLOUD_NAME=YOUR_CLOUD_NAME
CLOUDINARY_API_KEY=YOUR_API_KEY
CLOUDINARY_SECRET_KEY=YOUR_SECRET_KEY

RAZORPAY_KEY_ID=YOUR_RAZORPAY_KEY_ID
RAZORPAY_KEY_SECRET=YOUR_RAZORPAY_SECRET

CURRENCY=INR

πŸ“¦ Install Dependencies

Backend

cd backend

npm install

Frontend

cd frontend

npm install

Admin Panel

cd admin

npm install

▢️ Running the Project

Open three terminals.


Terminal 1 - Backend

cd backend

npm run server

or

npm start

Server:

http://localhost:4000

Terminal 2 - Frontend

cd frontend

npm run dev

Frontend:

http://localhost:5173

Terminal 3 - Admin Panel

cd admin

npm run dev

Admin Panel:

http://localhost:5174

πŸ—„οΈ Database Setup

MongoDB Atlas

  1. Create MongoDB Atlas Account.
  2. Create a Cluster.
  3. Create Database User.
  4. Whitelist IP Address.
  5. Copy Connection String.
  6. Add Connection String in:
MONGODB_URI=

☁️ Cloudinary Setup

  1. Create Cloudinary Account.
  2. Go to Dashboard.
  3. Copy:
Cloud Name
API Key
API Secret
  1. Add them to .env.

πŸ’³ Razorpay Setup

  1. Create Razorpay Account.
  2. Open Dashboard.
  3. Generate API Keys.
  4. Add keys to .env.
RAZORPAY_KEY_ID=
RAZORPAY_KEY_SECRET=

πŸ” Authentication

The project uses:

  • JWT Authentication
  • Password Hashing with Bcrypt
  • Role-Based Authorization

Roles

Role Access
User Book Appointments
Doctor Manage Appointments
Admin Manage Entire Platform

πŸ“Œ Main API Endpoints

Admin APIs

POST /api/admin/login
POST /api/admin/addDoctor
GET  /api/admin/allDoctors
POST /api/admin/changeAvailability
GET  /api/admin/dashboard
GET  /api/admin/appointments

User APIs

POST /api/user/register
POST /api/user/login

GET  /api/user/getProfile
POST /api/user/updateProfile

POST /api/user/bookAppointment
GET  /api/user/appointments

POST /api/user/cancelAppointment

POST /api/user/paymentRazorpay
POST /api/user/verifyRazorpay

Doctor APIs

POST /api/doctor/login

GET  /api/doctor/appointments

POST /api/doctor/completeAppointment
POST /api/doctor/cancelAppointment

GET  /api/doctor/dashboard

GET  /api/doctor/profile
POST /api/doctor/updateProfile

πŸ§ͺ Test Flow

Patient

Register
↓
Login
↓
Select Doctor
↓
Book Appointment
↓
Pay Online
↓
View Appointment

Doctor

Login
↓
View Appointments
↓
Complete Appointment
↓
Check Earnings

Admin

Login
↓
Add Doctor
↓
Manage Doctors
↓
View Appointments
↓
Dashboard Analytics

πŸš€ Future Improvements

  • Stripe Integration
  • Email Notifications
  • SMS Reminders
  • Video Consultation
  • Prescription Management
  • Patient Medical Records
  • Doctor Ratings & Reviews
  • Real-Time Chat
  • Appointment Rescheduling

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
git checkout -b feature-name
  1. Commit changes
git commit -m "Added feature"
  1. Push branch
git push origin feature-name
  1. Create Pull Request

πŸ“„ License

This project is licensed under the MIT License.


πŸ‘¨β€πŸ’» Author

Vaibhav Patil

GitHub: https://github.com/VPatil3155


⭐ If you found this project useful, please give it a star on GitHub.

About

Modern healthcare management platform built using the MERN stack with doctor appointment scheduling, patient records, authentication, role-based access control, and prescription management.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages